/* The site's look, on the Stitch-served gallery pages (/widget/gallery/…).

   Stitch renders our <nav> (pasted into its admin Photo Management page)
   above every public gallery page it serves on this domain, with this
   stylesheet linked after its own widget.css. Two jobs:

   1. The page's palette. Stitch's pages are built on --st-* tokens — the
      same ones gallery.html hands the embedded widget in Stitch.init({theme})
      — and this file loads after widget.css, so the :root block below wins
      at equal specificity and the whole page takes our colours. The values
      are that theme object; change both together.
   2. The nav's own rules. Only those — the site's full stylesheet set would
      fight widget.css over body/html — so a change to the nav in
      css/components.css needs mirroring here.

   Two deliberate departures from components.css, both because Stitch
   strips scripts from the pasted markup and js/nav.js never runs there:
   - The mobile menu opens on a checkbox (#nav-toggle, first child of the
     <header>) that the hamburger <label> toggles, in place of the button
     nav.js wires. The `~` selectors below are what make that work, which
     is why the checkbox has to precede both navs in the markup.
   - The bar is sticky with the solid `.scrolled` background rather than
     fixed with the translucent one: nothing adds `.scrolled` on scroll,
     and a fixed bar over Stitch's page would cover the top of the photo.

   Kept in sync with: the theme object in gallery.html, the tokens named
   below (css/variables.css) and the NAVIGATION block of css/components.css. */

@import url("https://fonts.googleapis.com/css2?family=Alegreya+Sans:wght@400;500;700&display=swap");

:root {
  --color-charcoal:   #00202e;
  --color-blue:       #006892;
  --color-gold:       #ffce5b;
  --color-warm-white: #fff9ea;
  --color-white:      #FFFFFF;
  --font-serif: 'Alegreya Sans', 'Georgia', sans-serif;
  --font-sans:  'Alegreya Sans', 'Inter', sans-serif;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-3xl:  2.5rem;
  --weight-medium:   500;
  --weight-semibold: 600;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --container-xl: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius-full: 9999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast:   150ms;
  --duration-normal: 280ms;
  --z-sticky: 100;

  /* ── Stitch page theme — mirrors Stitch.init({theme}) in gallery.html ── */
  --st-color-primary:       #006892;
  --st-color-primary-hover: #004f6e;
  --st-color-primary-light: rgba(0,104,146,0.10);
  --st-color-bg:            #fff9ea;
  --st-color-surface:       #ffe9a8;
  --st-color-field:         #ffffff;
  --st-color-field-hover:   #eaf3f7;
  --st-color-surface-hover: #ecd48f;
  --st-color-border:        #ecd48f;
  --st-color-text:          #00202e;
  --st-color-text-muted:    #4a6572;
  --st-ring-color:          rgba(0,104,146,0.30);
  --st-radius:              8px;
  --st-radius-sm:           4px;
  --st-max-width:           1440px;
}

/* Stitch wraps the fragment in .st-chrome-tenant inside a padded page root,
   and --st-max-width above centres that whole page as a 1440px column — so
   a plain negative page-padding margin (what coffey-offroad uses) stops the
   bar at the column's edge on any wider screen. calc(50% - 50vw) is the
   full-bleed breakout: it pulls each side out by exactly the gap between the
   column and the viewport, so the bar spans the screen while .nav-inner
   stays centred, as on the site's own pages. The bottom margin gives the
   content below it room. */
.st-chrome-tenant {
  margin: calc(-1 * var(--st-spacing)) calc(50% - 50vw) 16px;
}

/* 100vw counts a classic (non-overlay) scrollbar, so the breakout can
   overshoot by its width; clip rather than hidden, since clip creates no
   scroll container and so leaves the sticky nav working. */
html {
  overflow-x: clip;
}

/* The checkbox behind the hamburger. Kept focusable (not display:none) so
   the menu opens from the keyboard; the label draws its focus ring. */
.nav-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--color-charcoal);
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
  padding-block: var(--space-5);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-img {
  height: 40px;
  width: auto;
  flex-shrink: 0;
}

/* Desktop nav links */
.nav-links {
  display: none;
  align-items: center;
  gap: var(--space-8);
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 900px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: color var(--duration-fast);
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-blue);
  transition: width var(--duration-normal) var(--ease-out);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-white);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* CTA button in nav */
.nav-cta {
  display: none;
}

.nav-links .nav-cta {
  padding-bottom: var(--space-2);
}

@media (min-width: 900px) {
  .nav-cta {
    display: inline-flex;
    align-items: center;
    padding: var(--space-2) var(--space-6);
    background: var(--color-blue);
    color: var(--color-white) !important;
    border-radius: var(--radius-full);
    font-size: var(--text-sm) !important;
    font-weight: var(--weight-semibold) !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background var(--duration-fast);
    white-space: nowrap;
  }
  .nav-cta:hover {
    background: var(--color-gold) !important;
    color: var(--color-white) !important;
  }
  .nav-cta::after {
    display: none !important;
  }
}

/* Hamburger — a <label> for #nav-toggle here, a <button> on the site */
.nav-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  margin-left: auto;
  border-radius: 4px;
}

@media (min-width: 900px) {
  .nav-hamburger {
    display: none;
  }
}

.nav-hamburger span {
  display: block;
  height: 1.5px;
  background: var(--color-white);
  border-radius: var(--radius-full);
  transition: transform var(--duration-normal) var(--ease-out),
              opacity var(--duration-fast);
  transform-origin: center;
}

.nav-toggle-input:checked ~ .site-nav .nav-hamburger span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-toggle-input:checked ~ .site-nav .nav-hamburger span:nth-child(2) {
  opacity: 0;
}
.nav-toggle-input:checked ~ .site-nav .nav-hamburger span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}
.nav-toggle-input:focus-visible ~ .site-nav .nav-hamburger {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* Mobile menu overlay */
.nav-mobile {
  position: fixed;
  inset: 0;
  background: var(--color-charcoal);
  z-index: calc(var(--z-sticky) - 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.nav-toggle-input:checked ~ .nav-mobile {
  opacity: 1;
  pointer-events: auto;
}

.nav-mobile a {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  color: var(--color-warm-white);
  opacity: 0.85;
  text-decoration: none;
  transition: color var(--duration-fast), opacity var(--duration-fast);
}

.nav-mobile a:hover,
.nav-mobile a.active {
  color: var(--color-blue);
  opacity: 1;
}

.nav-mobile-phones {
  margin-top: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: center;
}

.nav-mobile-phones a {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
}
