/* Site navbar and menu, shared by every page (index.html, rsvp.html). Moved out of home.css on 23 Nov so the
   RSVP page uses the exact same navbar. The home page drives theme, hide/show and the logo landing (js/home.js);
   rsvp.js sets them for the RSVP screens. Base .nav, .pill and the colour themes are in components.css. */

/* Navbar height (12px + the 60px logo + 12px; 16px + 80px + 16px from tablet up), for pages that pad below it */
:root { --nav-h: 84px; }
@media (min-width: 810px) { :root { --nav-h: 112px; } }

/* ───────── 0 · Site navbar ─────────
   Two versions, set by body[data-version] (js/home.js):
   bj  Bea & Josh: Menu left, logo centre, RSVP right.
   jb  Josh & Bea: logo left, section links centre, RSVP right; RSVP appears once the hero name has landed.
   Logos stay hidden until the hero title has shrunk onto them. Theme and hide/show are set by js/home.js. */
.site-nav {
  --logo-s: .18;                    /* bj logo = the hero name frame (394 × 332) at this scale */
  --jb-logo-s: .21;                 /* jb logo = the hero name's 342 × 288 box at this scale */
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  grid-template-areas: "left centre right";
  padding: 12px 16px;
  --nav-mark: var(--nav-fg);        /* the logo takes the text colour (cream on olive, black on light) */
  transition: background-color var(--dur-nav) var(--ease-swing), color var(--dur-nav) var(--ease-swing), transform var(--dur-nav) var(--ease-swing);
}
@media (min-width: 810px) { .site-nav { --logo-s: .24; --jb-logo-s: .278; padding: 16px 32px; } }
.site-nav.is-hidden { transform: translateY(-100%); }
.site-nav.is-measuring { transform: none; transition: none; }
.site-nav .pill { grid-area: right; justify-self: end; border-radius: 0; transition: opacity .3s var(--ease-standard), translate .3s var(--ease-out-quart), background-color .2s, color .2s; }

.site-nav .nav__brand { position: relative; display: block; color: var(--nav-mark); }
.nav__logo { position: absolute; left: 0; top: 0; transform-origin: 0 0; opacity: 0; }
.site-nav.is-named .nav__logo { opacity: 1; }
.nav__links { display: none; }

/* Bea & Josh */
body[data-version="bj"] .nav__menu { grid-area: left; justify-self: start; }
body[data-version="bj"] .nav__brand { grid-area: centre; width: calc(394.25px * var(--logo-s)); height: calc(332px * var(--logo-s)); }
.nav__logo--bj { width: 394.25px; height: 332px; scale: var(--logo-s); }
body:not([data-version="bj"]) .nav__logo--bj { display: none; }

/* Josh & Bea */
body[data-version="jb"] .nav__brand { grid-area: left; justify-self: start; width: calc(342px * var(--jb-logo-s)); height: calc(288px * var(--jb-logo-s)); }
.nav__logo--jb { width: 342px; height: 288px; scale: var(--jb-logo-s); }
body:not([data-version="jb"]) .nav__logo--jb { display: none; }
body[data-version="jb"] .nav__menu { grid-area: right; justify-self: end; margin-right: 104px; }
body[data-version="jb"]:not(.hero-landed) .site-nav .pill { opacity: 0; translate: 0 -8px; pointer-events: none; }
@media (min-width: 810px) {
  body[data-version="jb"] .nav__menu { display: none; }
  body[data-version="jb"] .nav__links { grid-area: centre; display: flex; gap: 32px; }
  .nav__links a { color: inherit; text-decoration: none; }
  .nav__links a:hover { text-decoration: underline; text-underline-offset: 4px; }
}
@media (min-width: 1200px) { body[data-version="jb"] .nav__links { gap: 56px; } }

/* Logo glyphs: the navbar logo is the hero title's name frame at a small scale */
.bjn-word {
  position: absolute; white-space: nowrap; line-height: 1;
  font-family: var(--font-poetry-night); font-weight: 400;
  font-feature-settings: "blwf", "cv03", "cv04", "cv09", "cv11";
  rotate: -34deg;
}
.bjn-word--josh { left: 43.81px; top: 94.53px; font-size: 130px; }
.bjn-word--amp  { right: 49.57px; top: 48.42px; font-size: 149px; }
.bjn-word--bea  { right: 62.25px; bottom: 21.9px; font-size: 130px; }

/* Navbar type (Framer: Redward VF Mono, weight 503, for Menu, the section links and RSVP) */
.site-nav :is(.nav__links a, .nav__menu .t-button, .pill), .menu__close .t-button {
  font-family: var(--font-redward-mono); font-size: var(--type-nav-size); line-height: var(--type-nav-lh);   /* Nav text style */
  font-weight: 503; font-variation-settings: "wght" 503, "slnt" 0;
}
.site-nav .pill { padding: 12px 20px; }

/* ───────── Menu (Framer "Phone menu" overlay) ─────────
   Bea, 9 Nov: the full-screen chartreuse sheet at every size. Bea, 24 Nov: everything fits in the window (no
   scrolling); every number sits above its title, lined up with it; the titles are 64px (the tablet and desktop
   Section size) wherever the window allows; the shell and "UM WEDDING NAS ÁGUAS DE MARÇO NA ILHA DE SIARGAO"
   (from the RSVP invite card) sit in the upper right, and the photo of us at sunset in the lower right.
   Close sits exactly where the Menu button was (js/components.js copies its spot into --close-x/--close-y), and
   the links start right under its X. */
.menu {
  --pad-t: 88px; --pad-b: 24px; --pad-r: 20px; --gap: 12px; --num-h: 16px;
  /* Title size: 64px, smaller only when six numbers + titles + gaps wouldn't fit the window's height or width */
  --fs: min(64px, 17vw, calc((100dvh - var(--pad-t) - var(--pad-b) - 5 * var(--gap) - 6 * (8px + var(--num-h))) / 6));
  position: fixed; inset: 0; z-index: 30; height: 100dvh; overflow: hidden;
  padding: var(--pad-t) var(--pad-r) var(--pad-b); display: flex; flex-direction: column;
  background: var(--color-chartreuse); color: var(--color-black);
  animation: menu-sheet .3s var(--ease-out-quart);
}
@keyframes menu-sheet { from { opacity: 0; } }
.menu[hidden] { display: none !important; }
.menu__close {
  position: absolute; left: var(--close-x, 16px); top: var(--close-y, 24px); height: var(--close-h, auto);
  display: inline-flex; align-items: center; gap: 10px; padding: 0;
  border: 0; background: none; color: var(--color-black); cursor: pointer;
}
.menu__close svg { width: 22px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; overflow: visible; }
.menu__close:hover .t-button, .menu__close:focus-visible .t-button { text-decoration: underline; text-underline-offset: 4px; }
/* The links start exactly under Close's X, wherever the Menu button put it; the X is drawn 4px in */
.menu { padding-left: calc(var(--close-x, 24px) + 4px); }
.menu__links { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--gap); }
.menu__links li { padding-left: var(--indent, 0); }
.menu__links a {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 6px;
  color: inherit; text-decoration: none; white-space: nowrap;
  font-family: var(--font-greenstone); font-size: var(--fs); line-height: 1; letter-spacing: -0.01em;
}
.menu__links a:hover .menu__label, .menu__links a:focus-visible .menu__label { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.menu__num { flex: none; height: var(--num-h); line-height: var(--num-h); }

/* Upper right: the shell over the caps */
.menu__mark { position: absolute; top: var(--close-y, 24px); right: var(--pad-r); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.menu__shell { display: block; width: var(--shell, 84px); height: auto; aspect-ratio: 512 / 463; object-fit: cover; }
.menu__caps { margin: 0; text-align: center; font-family: var(--font-redward-mono); font-size: var(--caps, min(13px, 3.2vw)); line-height: 1.05;
  color: var(--color-magenta); white-space: nowrap; }
/* Lower right: the photo. On phones it sits beside RSVP and runs from the top of "N° 06" to the bottom edge */
.menu__footer { position: absolute; right: var(--pad-r); bottom: var(--pad-b); }
.menu__photo { display: block; height: var(--photo); width: auto; aspect-ratio: 766 / 1100; object-fit: cover; }
.menu {
  --rsvp-top: calc(var(--pad-t) + 5 * (var(--fs) + 6px + var(--num-h) + var(--gap)));
  --photo: max(120px, min(320px, calc(100dvh - var(--pad-b) - var(--rsvp-top))));   /* short phones: at least 120px, rising beside Reminders' short end */
}
body.menu-open { overflow: hidden; }
@media (min-width: 810px) {
  .menu { --pad-t: 112px; --pad-b: 40px; --pad-r: 48px; }
  .menu__links li { padding-left: calc(var(--indent, 0px) * 2); }
  /* Tablet and desktop: a big photo on its own in the lower right, and a bigger shell */
  .menu { --photo: clamp(240px, min(58dvh, 50vw), 560px); --shell: clamp(110px, 12vw, 160px); --caps: 16px; }
}
/* Phone: a clearer zigzag like tablet and desktop (the same steps, larger) */
@media (max-width: 809px) {
  .menu__links li { padding-left: calc(var(--indent, 0px) * 1.4); }
  .menu__links a { white-space: normal; }
}
