/* =========================================================
   DOMINIC RYAN — SHARED NAVIGATION & EDITORIAL FOOTER

   Applies to:
   - A Personal Message
   - The Maison
   - Explore the Collection

   Includes:
   - Shared primary navigation
   - Continuous traveling active underline
   - Desktop and mobile navigation
   - Unified editorial footer
   - Native cross-document View Transitions
   - JavaScript animation fallback

   MOTION SYSTEM
   - Page transition: 650ms
   - Traveling underline: 700ms
   - Balanced, measured movement
   - Position and width animate together
   - Direction-aware page movement

   ========================================================= */


/* =========================================================
   01 — PRIMARY NAVIGATION
   ========================================================= */

.collection-navigation,
.maison-primary-nav {
  display: flex;
  justify-content: center;
  align-items: center;

  gap: 32px;

  margin: 50px auto 0;
  padding: 0 20px;
}


/* PRIMARY NAVIGATION LINKS */

.collection-navigation a,
.maison-primary-nav a {
  position: relative;
  display: inline-block;

  padding-bottom: 9px;

  font-family:
    "DR Avenir Next",
    "Avenir Next",
    Arial,
    sans-serif;

  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;

  letter-spacing: .16em;

  color: #655d56;
  text-decoration: none;

  white-space: nowrap;
  opacity: .55;

  transition:
    opacity 300ms ease,
    color 300ms ease;

  -webkit-tap-highlight-color: transparent;
}


/* ACTIVE PRIMARY PAGE */

.collection-navigation a.active,
.collection-navigation a[aria-current="page"],
.maison-primary-nav a.active,
.maison-primary-nav a[aria-current="page"] {
  opacity: 1;
  color: #51463e;
}


/* PRIMARY UNDERLINE */

.collection-navigation a::after,
.maison-primary-nav a::after {
  content: "";

  position: absolute;

  left: 0;
  right: 0;
  bottom: 0;

  height: 1px;

  background: #51463e;

  opacity: 0;

  transform: scaleX(0);
  transform-origin: center;

  transition:
    transform 550ms cubic-bezier(.22, .61, .36, 1),
    opacity 350ms ease;

  pointer-events: none;
}


/* ACTIVE UNDERLINE */

.collection-navigation a.active::after,
.collection-navigation a[aria-current="page"]::after,
.maison-primary-nav a.active::after,
.maison-primary-nav a[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
}


/* DESKTOP HOVER */

@media (hover: hover) and (pointer: fine) {

  .collection-navigation a:not(.active):not([aria-current="page"]):hover,
  .maison-primary-nav a:not(.active):not([aria-current="page"]):hover {
    opacity: .85;
  }

  .collection-navigation a:not(.active):not([aria-current="page"]):hover::after,
  .maison-primary-nav a:not(.active):not([aria-current="page"]):hover::after {
    opacity: .65;
    transform: scaleX(1);
  }

}


/* PRIMARY NAVIGATION FOCUS */

.collection-navigation a:focus-visible,
.maison-primary-nav a:focus-visible {
  outline: 1px solid #51463e;
  outline-offset: 5px;
}


/* =========================================================
   02 — CONTINUOUS TRAVELING NAVIGATION UNDERLINE

   One underline is positioned beneath the
   active navigation label.

   Native cross-document View Transitions interpolate
   its position and dimensions between pages.

   Duration: 700ms

   ========================================================= */


/* NAVIGATION POSITIONING CONTEXT */

.collection-navigation.dr-travel-nav,
.maison-primary-nav.dr-travel-nav {
  position: relative;
}


/* SINGLE MOVING UNDERLINE */

.dr-traveling-underline {
  position: absolute;

  display: block;

  height: 1px;

  background: #51463e;

  opacity: 0;

  pointer-events: none;

  z-index: 2;
}


/* HIDE ORIGINAL ACTIVE UNDERLINE
   WHEN TRAVELING UNDERLINE IS AVAILABLE */

.collection-navigation.dr-travel-nav a.active::after,
.collection-navigation.dr-travel-nav a[aria-current="page"]::after,
.maison-primary-nav.dr-travel-nav a.active::after,
.maison-primary-nav.dr-travel-nav a[aria-current="page"]::after {
  content: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  background: transparent !important;
  transform: scaleX(0) !important;
  animation: none !important;
  transition: none !important;
}


/* RETAIN HOVER UNDERLINES FOR INACTIVE LINKS */

@media (hover: hover) and (pointer: fine) {

  .dr-travel-nav a:not(.active):not([aria-current="page"]):hover::after {
    opacity: .65;
    transform: scaleX(1);
  }

}


/* =========================================================
   03 — MOBILE PRIMARY NAVIGATION
   ========================================================= */

@media (max-width: 760px) {

  .collection-navigation,
  .maison-primary-nav {
    margin-top: 45px;

    gap: clamp(10px, 4vw, 22px);

    padding: 0 12px;
  }

  .collection-navigation a,
  .maison-primary-nav a {
    font-size: clamp(8px, 2.3vw, 9px);
    letter-spacing: .08em;
  }

}


/* MOBILE PRIMARY NAVIGATION TAP */

@media (hover: none) {

  .collection-navigation a:not(.active):not([aria-current="page"]):active,
  .maison-primary-nav a:not(.active):not([aria-current="page"]):active {
    opacity: 1;
  }

  .collection-navigation a:not(.active):not([aria-current="page"]):active::after,
  .maison-primary-nav a:not(.active):not([aria-current="page"]):active::after {
    opacity: .65;
    transform: scaleX(1);
  }

}


/* =========================================================
   04 — UNIFIED FOOTER CONTAINER
   ========================================================= */

.dr-unified-footer {
  position: relative;

  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;

  width: 100%;

  min-height: 0;

  padding: 72px 24px 66px;

  background: #f2ede6;

  border-top: 1px solid #e0d5c8;

  text-align: center;

  font-family:
    "DR Avenir Next",
    "Avenir Next",
    Arial,
    sans-serif;
}


/* =========================================================
   05 — FOOTER MONOGRAM & PAGE IDENTIFIER
   ========================================================= */

.dr-footer-end-mark {
  display: flex;
  flex-direction: column;

  align-items: center;

  gap: 19px;
}


/* DISCREET MONOGRAM BUTTON */

.dr-footer-monogram {
  display: block;

  width: clamp(54px, 5.5vw, 86px);
  height: 100px;

  padding: 0;
  margin: 0;

  appearance: none;
  -webkit-appearance: none;

  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;

  color: inherit;

  cursor: pointer;

  -webkit-tap-highlight-color: transparent;

  transition:
    opacity 350ms ease;
}


/* MONOGRAM IMAGE */

.dr-footer-monogram img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: contain;

  border: none;
  background: transparent;

  pointer-events: none;
}


/* SUBTLE DESKTOP HOVER */

@media (hover: hover) and (pointer: fine) {

  .dr-footer-monogram:hover {
    opacity: .72;
  }

}


/* KEYBOARD FOCUS */

.dr-footer-monogram:focus-visible {
  outline: 1px solid #51463e;
  outline-offset: 6px;
}


/* PAGE IDENTIFIER — DIDOT */

.dr-footer-page-title {
  display: block;

  font-family:
    "DR Didot",
    Didot,
    "Bodoni 72",
    Georgia,
    serif;

  font-size: 12px;
  font-style: normal;
  font-weight: 400;

  line-height: 1.5;
  letter-spacing: .16em;

  color: #51463e;
}


/* =========================================================
   06 — EDITORIAL DIVIDER
   ========================================================= */

.dr-footer-rule {
  width: min(360px, 75vw);
  height: 1px;

  margin: 28px auto 0;

  background: rgba(177, 155, 129, .29);
}


/* =========================================================
   07 — ITALICIZED BRAND STATEMENT
   ========================================================= */

.dr-footer-tagline {
  margin: 16px 0 0;

  padding: 0 24px;

  font-family:
    "DR Avenir Next",
    "Avenir Next",
    Arial,
    sans-serif;

  font-size: 11px;
  font-style: italic;
  font-weight: 400;

  line-height: 1.8;
  letter-spacing: .025em;

  color: #84776d;

  text-align: center;
}


/* =========================================================
   08 — FOOTER NAVIGATION
   ========================================================= */

.dr-footer-nav {
  display: flex;

  flex-direction: row;
  flex-wrap: wrap;

  justify-content: center;
  align-items: center;

  gap: clamp(16px, 3vw, 35px);

  width: 100%;

  margin-top: 35px;
  padding: 0 20px;

  font-family:
    "DR Avenir Next",
    "Avenir Next",
    Arial,
    sans-serif;

  font-size: 9px;
  font-weight: 500;

  line-height: 1.8;
  letter-spacing: .15em;
}


/* DESKTOP: GROUPS SHARE ONE CONTINUOUS ROW */

.dr-footer-nav-group {
  display: contents;
}


/* =========================================================
   09 — FOOTER LINKS
   ========================================================= */

.dr-footer-nav a {
  position: relative;

  display: inline-block;

  padding-bottom: 5px;

  font: inherit;

  color: #655d56;

  text-decoration: none;

  white-space: nowrap;

  opacity: .75;

  transition:
    opacity 300ms ease,
    color 300ms ease;

  -webkit-tap-highlight-color: transparent;
}


/* =========================================================
   10 — CURRENT PAGE
   BOLD, NON-CLICKABLE, NO UNDERLINE
   ========================================================= */

.dr-footer-current {
  display: inline-block;

  padding-bottom: 5px;

  font: inherit;

  font-weight: 600;

  color: #51463e;

  opacity: 1;

  white-space: nowrap;

  cursor: default;
}


/* =========================================================
   11 — ANIMATED FOOTER UNDERLINE
   ========================================================= */

.dr-footer-nav a::after {
  content: "";

  position: absolute;

  left: 0;
  right: 0;
  bottom: 0;

  height: 1px;

  background: currentColor;

  opacity: 0;

  transform: scaleX(0);
  transform-origin: center;

  transition:
    transform 550ms cubic-bezier(.22, .61, .36, 1),
    opacity 350ms ease;

  pointer-events: none;
}


/* DESKTOP HOVER */

@media (hover: hover) and (pointer: fine) {

  .dr-footer-nav a:hover {
    opacity: 1;
  }

  .dr-footer-nav a:hover::after {
    opacity: .7;
    transform: scaleX(1);
  }

}


/* FOOTER LINK FOCUS */

.dr-footer-nav a:focus-visible {
  outline: 1px solid #51463e;
  outline-offset: 5px;
}


/* =========================================================
   12 — EXPLICIT RETURN TO TOP
   ========================================================= */

.dr-footer-return {
  margin-top: 25px;

  padding: 10px 0;

  appearance: none;
  -webkit-appearance: none;

  background: transparent;

  border: 0;
  border-bottom: 1px solid #9d8873;

  color: #51463e;

  cursor: pointer;

  font-family:
    "DR Avenir Next",
    "Avenir Next",
    Arial,
    sans-serif;

  font-size: 8px;
  font-weight: 400;

  line-height: 1.4;
  letter-spacing: .16em;

  opacity: .6;

  transition: opacity 300ms ease;
}

.dr-footer-return:hover {
  opacity: 1;
}

.dr-footer-return:focus-visible {
  outline: 1px solid #51463e;
  outline-offset: 5px;
}


/* =========================================================
   13 — MOBILE FOOTER
   TWO DELIBERATE, SINGLE-LINE ROWS
   ========================================================= */

@media (max-width: 760px) {

  .dr-unified-footer {
    padding:
      62px
      12px
      calc(65px + env(safe-area-inset-bottom));
  }


  /* PAGE IDENTIFIER */

  .dr-footer-page-title {
    font-size: 11px;
    letter-spacing: .14em;
  }


  /* BRAND STATEMENT */

  .dr-footer-tagline {
    font-size: 10.5px;

    line-height: 1.8;
    letter-spacing: .01em;

    padding: 0 12px;
  }


  /* TWO ROWS */

  .dr-footer-nav {
    display: flex;

    flex-direction: column;
    flex-wrap: nowrap;

    align-items: center;
    justify-content: center;

    gap: 17px;

    width: 100%;

    margin-top: 38px;
    padding: 0;
  }


  /* EACH GROUP OCCUPIES ONE ROW */

  .dr-footer-nav-group {
    display: flex;

    flex-direction: row;
    flex-wrap: nowrap;

    justify-content: center;
    align-items: center;

    width: 100%;

    min-width: 0;

    gap: clamp(7px, 2.5vw, 18px);
  }


  /* MOBILE LINK TYPOGRAPHY */

  .dr-footer-nav a,
  .dr-footer-current {
    flex: 0 1 auto;

    font-size: clamp(7px, 2vw, 9px);

    letter-spacing: clamp(.015em, .15vw, .1em);

    line-height: 1.6;

    padding-bottom: 4px;

    white-space: nowrap;
  }


  /* MOBILE CURRENT PAGE */

  .dr-footer-current {
    font-weight: 600;
  }


  /* MOBILE TAP FEEDBACK */

  .dr-footer-nav a:active {
    opacity: 1;
    color: #51463e;
  }

  .dr-footer-nav a:active::after {
    opacity: .65;
    transform: scaleX(1);
  }


  /* RETURN CONTROL */

  .dr-footer-return {
    margin-top: 22px;
  }

}


/* =========================================================
   14 — EXTRA-NARROW MOBILE
   ========================================================= */

@media (max-width: 360px) {

  .dr-unified-footer {
    padding-left: 6px;
    padding-right: 6px;
  }

  .dr-footer-nav-group {
    gap: 4px;
  }

  .dr-footer-nav a,
  .dr-footer-current {
    font-size: clamp(5.5px, 1.8vw, 6.5px);
    letter-spacing: 0;
  }

}


/* =========================================================
   15 — THE MAISON HEADER ALIGNMENT

   Matches A Personal Message and Explore the Collection.

   ========================================================= */

.dr-site-header .dr-brand-mark {
  display: block;
  width: 72px;
  height: auto;
  flex: none;
}

.dr-site-header .dr-brand-mark img {
  display: block;
  width: 100%;
  height: auto;
}

.dr-site-header .dr-brand-name {
  display: block;
  margin: 3px 0 0;

  font-family:
    "DR Didot",
    Didot,
    Georgia,
    serif;

  font-size: clamp(18px, 1.7vw, 27px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: .24em;

  color: #4e443d;
}

@media (max-width: 760px) {

  .dr-site-header .dr-brand-mark {
    width: 54px;
  }

}

@media (max-width: 420px) {

  .dr-site-header .dr-brand-name {
    font-size: 18px;
    letter-spacing: .17em;
  }

}


/* =========================================================
   16 — CROSS-DOCUMENT VIEW TRANSITIONS

   Page:
   650ms directional glide

   Navigation underline:
   700ms position and width interpolation

   Character:
   Balanced — measured throughout

   ========================================================= */


/* NATIVE CROSS-DOCUMENT TRANSITION OPT-IN */

@view-transition {
  navigation: auto;
}


/* SHARED MOTION VARIABLES */

:root {
  --dr-page-duration: 650ms;
  --dr-line-duration: 700ms;

  --dr-page-easing:
    cubic-bezier(.45, 0, .25, 1);

  --dr-line-easing:
    cubic-bezier(.45, 0, .25, 1);

  --dr-swipe-out: -22px;
  --dr-swipe-in: 22px;
}


/* =========================================================
   NATIVE VIEW TRANSITIONS — PAGE
   ========================================================= */

::view-transition-old(root) {
  animation:
    var(--dr-page-duration)
    var(--dr-page-easing)
    both dr-page-out;
}

::view-transition-new(root) {
  animation:
    var(--dr-page-duration)
    var(--dr-page-easing)
    both dr-page-in;
}


/* =========================================================
   NATIVE VIEW TRANSITIONS — UNDERLINE
   ========================================================= */


/*
   JavaScript assigns the matching identity
   before the browser captures each snapshot.
*/

html.dr-native-underline .dr-traveling-underline {
  view-transition-name: dr-navigation-underline;
}


/*
   Position and width interpolate together.

   The browser moves the named transition group
   between the outgoing and incoming geometry.

   Duration: 700ms
*/

::view-transition-group(dr-navigation-underline) {
  animation-duration: var(--dr-line-duration);

  animation-timing-function:
    var(--dr-line-easing);

  animation-fill-mode: both;

  z-index: 2;
}


/*
   SINGLE VISIBLE UNDERLINE

   Hide the outgoing snapshot and display the
   incoming snapshot.

   This prevents two overlapping underline
   images from appearing simultaneously.
*/

::view-transition-old(dr-navigation-underline) {
  animation: none;
  opacity: 0;
}

::view-transition-new(dr-navigation-underline) {
  animation: none;
  opacity: 1;
}


/* =========================================================
   NATIVE EXIT
   ========================================================= */

@keyframes dr-page-out {

  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: .88;
    transform: translateX(var(--dr-swipe-out));
  }

}


/* =========================================================
   NATIVE ENTRY
   ========================================================= */

@keyframes dr-page-in {

  from {
    opacity: .88;
    transform: translateX(var(--dr-swipe-in));
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }

}


/* =========================================================
   JAVASCRIPT FALLBACK — EXIT
   ========================================================= */

html.dr-fallback-leaving body {
  animation:
    var(--dr-page-duration)
    var(--dr-page-easing)
    both dr-fallback-out;
}


/* =========================================================
   JAVASCRIPT FALLBACK — ENTRY
   ========================================================= */

html.dr-fallback-entering body {
  animation:
    var(--dr-page-duration)
    var(--dr-page-easing)
    both dr-fallback-in;
}


/* =========================================================
   FALLBACK EXIT KEYFRAMES
   ========================================================= */

@keyframes dr-fallback-out {

  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: .88;
    transform: translateX(var(--dr-swipe-out));
  }

}


/* =========================================================
   FALLBACK ENTRY KEYFRAMES
   ========================================================= */

@keyframes dr-fallback-in {

  from {
    opacity: .88;
    transform: translateX(var(--dr-swipe-in));
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }

}
