/*
 * Shared site shell: skip link, navbar (desktop + mobile), logo, footer.
 * Single source of truth. Loaded by every page, including the homepage.
 * Markup lives in src/layout.mjs (header(), footer()); behavior in assets/js/shell.js.
 * Self-contained on purpose: it defines its own tokens (--sh-*) so it renders the
 * same whether the page also loads style.css or the homepage's own stylesheet.
 */
.nav,
.site-footer,
.skiplink {
  --sh-ink: #111111;
  --sh-or: #F2A33A;
  --sh-line: rgba(17, 17, 17, 0.14);
  --sh-soft: rgba(17, 17, 17, 0.62);
  --sh-h: 64px;
  --sh-font: Georgia, "K57 Serif", "Times New Roman", serif;
  --sh-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nav *, .nav *::before, .nav *::after,
.site-footer *, .site-footer *::before, .site-footer *::after { box-sizing: border-box; }

/* ---------- skip link ---------- */
.skiplink { position: fixed; left: 12px; top: -60px; z-index: 10001; background: var(--sh-ink); color: #fff; padding: 10px 16px; font: 400 14px/1.2 var(--sh-font); transition: top 0.2s; }
.skiplink:focus { top: 12px; }

/* ---------- logo (approved 57K graphic) ---------- */
.logo { display: inline-flex; align-items: center; flex: none; line-height: 0; text-decoration: none; color: var(--sh-ink); }
.logo-img { display: block; width: auto; height: 30px; }
.site-footer .logo-img { height: 36px; }

/* ---------- navbar ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 10000;
  height: var(--sh-h);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--sh-line);
  color: var(--sh-ink);
  font-family: var(--sh-font);
  font-size: 16px; line-height: 1.55;
  transform: translate3d(0, -101%, 0);
  transition: transform 0.9s var(--sh-ease);
}
.nav.on { transform: none; }
.nav .in { display: flex; align-items: center; gap: clamp(20px, 3vw, 44px); max-width: 1320px; height: 100%; margin: 0 auto; padding: 0 clamp(16px, 4vw, 56px); }
.nav nav { min-width: 0; }
.nav .bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--sh-or); transform: scaleX(0); transform-origin: left center; }

.nav .links { display: flex; gap: clamp(16px, 1.9vw, 28px); list-style: none; margin: 0; padding: 0; }
.nav .links > li { display: flex; align-items: center; position: relative; height: var(--sh-h); margin: 0; padding: 0; }
.nav .links a { position: relative; padding: 4px 0; color: inherit; font-size: 15px; text-decoration: none; white-space: nowrap; }
.nav .links > li > a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--sh-or); transform: scaleX(0); transform-origin: left center; transition: transform 0.5s var(--sh-ease); }
.nav .links > li > a:hover::after,
.nav .links > li > a[aria-current="page"]::after,
.nav .links > li.has-sub:focus-within > a::after { transform: scaleX(1); }

.nav .cta { display: inline-flex; align-items: center; gap: 8px; flex: none; margin-left: auto; padding: 10px 18px; background: var(--sh-or); color: var(--sh-ink); border: 1.5px solid var(--sh-ink); font: 700 13px/1 var(--sh-font); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; white-space: nowrap; cursor: pointer; transition: transform 0.3s, box-shadow 0.3s; }
.nav .cta:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--sh-ink); }

/* dropdowns (desktop: hover or keyboard focus) */
.nav .links .sub { position: absolute; top: 100%; left: -16px; z-index: 1; min-width: 250px; margin: 0; padding: 8px 0; list-style: none; background: #fff; border: 1.5px solid var(--sh-ink); box-shadow: 5px 5px 0 var(--sh-or); opacity: 0; visibility: hidden; transform: translate3d(0, 6px, 0); transition: opacity 0.25s, transform 0.35s var(--sh-ease), visibility 0s 0.25s; }
.nav .links .has-sub:hover > .sub,
.nav .links .has-sub:focus-within > .sub,
.nav .links .has-sub.open > .sub { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.nav .links .sub li { display: block; height: auto; }
.nav .links .sub a { display: block; padding: 9px 18px; font-size: 15px; }
.nav .links .sub a:hover,
.nav .links .sub a[aria-current="page"] { background: rgba(242, 163, 58, 0.18); }
.nav .sub-toggle, .nav .links > li.menu-cta, .nav .links > li.menu-tsz { display: none; }

/* text-size control: three "A"s, small / default / large (same idea as the approved concept) */
.tsz { display: inline-flex; align-items: flex-end; flex: none; height: 34px; border: 1.5px solid var(--sh-ink); background: #fff; }
.nav .tsz-bar { margin-left: auto; }
.nav .in > .cta { margin-left: 0; }
.tsz button { all: unset; box-sizing: border-box; display: grid; place-items: center; width: 30px; height: 100%; cursor: pointer; font-family: var(--sh-font); font-weight: 700; line-height: 1; color: var(--sh-ink); transition: background 0.25s, color 0.25s; }
.tsz button + button { border-left: 1px solid var(--sh-line); }
.tsz button.tsz-s { font-size: 13px; } .tsz button.tsz-m { font-size: 18px; } .tsz button.tsz-l { font-size: 24px; }
.tsz button:hover { background: rgba(242, 163, 58, 0.22); }
.tsz button[aria-pressed="true"] { background: var(--sh-ink); color: var(--sh-or); }
.tsz button:focus-visible { outline: 2px solid var(--sh-or); outline-offset: -3px; }

/* the control scales the page content, not the navigation or Kelvin (zoom is how the approved concept did it) */
main .content, .site-footer { zoom: var(--z, 1); }

/* burger (mobile only) */
.nav .burger { display: none; position: relative; flex: 0 0 42px; width: 42px; height: 42px; padding: 0; background: #fff; border: 1.5px solid var(--sh-ink); cursor: pointer; }
.nav .burger span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--sh-ink); transition: transform 0.4s var(--sh-ease), top 0.4s; }
.nav .burger span:first-child { top: 15px; }
.nav .burger span:last-child { top: 23px; }
.nav.open .burger span:first-child { top: 19px; transform: rotate(45deg); }
.nav.open .burger span:last-child { top: 19px; transform: rotate(-45deg); }
.nav a:focus-visible, .nav button:focus-visible, .site-footer a:focus-visible { outline: 2px solid var(--sh-or); outline-offset: 3px; }

/* tighter desktop: keep one row without crowding the logo */
@media (max-width: 1180px) {
  .nav .in { gap: 20px; }
  .nav .links { gap: 16px; }
  .nav .links a { font-size: 14px; }
  .nav .cta { padding: 9px 14px; font-size: 12px; }
}

/* ---------- mobile / tablet ---------- */
@media (max-width: 980px) {
  .nav .in { gap: 12px; }
  .nav .tsz-bar { display: none; }
  .nav .in > .cta { margin-left: auto; }
  .nav .burger { display: block; }
  .nav .links { display: none; }
  .nav.open .links {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: var(--sh-h); left: 0; right: 0;
    max-height: calc(100vh - var(--sh-h)); max-height: calc(100dvh - var(--sh-h));
    overflow-y: auto; overscroll-behavior: contain;
    padding: 6px clamp(16px, 4vw, 56px) 20px;
    background: #fff;
    border-bottom: 1px solid var(--sh-line);
    box-shadow: 0 18px 30px -18px rgba(17, 17, 17, 0.35);
  }
  .nav.open .links > li { flex-wrap: wrap; height: auto; border-top: 1px solid var(--sh-line); }
  .nav.open .links > li:first-child { border-top: 0; }
  .nav.open .links > li > a { flex: 1 1 0; min-width: 0; padding: 14px 0; font-size: 19px; white-space: normal; }
  .nav .links > li > a::after { display: none; }
  .nav.open .links > li > a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--sh-or); padding-left: 12px; }

  .nav.open .sub-toggle { display: grid; place-items: center; flex: 0 0 48px; height: 48px; padding: 0; background: none; border: 0; cursor: pointer; color: var(--sh-ink); }
  .nav .sub-toggle span { width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); transition: transform 0.35s var(--sh-ease); }
  .nav .has-sub.open > .sub-toggle span { transform: translateY(3px) rotate(-135deg); }

  /* submenus are collapsed until their toggle opens them */
  .nav .links .sub { position: static; display: none; flex: 0 0 100%; min-width: 0; padding: 0 0 10px 14px; background: none; border: 0; box-shadow: none; opacity: 1; visibility: visible; transform: none; }
  .nav .links .has-sub.open > .sub { display: block; }
  .nav .links .sub a { padding: 9px 0; font-size: 16px; color: var(--sh-soft); }
  .nav .links .sub a:hover { background: none; color: var(--sh-ink); }

  .nav.open .links > li.menu-cta { display: block; padding-top: 16px; }
  .nav.open .links > li.menu-tsz { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; font-size: 16px; }
  .menu-tsz-l { color: var(--sh-soft); }
  .nav .menu-cta .cta { margin: 0; width: 100%; justify-content: center; padding: 14px 18px; font-size: 13px; }
}
@media (max-width: 560px) {
  .nav .in > .cta { display: none; }
  .nav .burger { margin-left: auto; }
}
@media (max-width: 420px) {
  .nav .in { padding: 0 12px; }
  .logo-img { height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav, .nav .links .sub, .nav .burger span, .nav .sub-toggle span { transition: none; }
}

/* ---------- footer ---------- */
.site-footer { display: block; max-width: none; margin: 0; padding: 0; background: var(--paper, #fff); color: var(--sh-ink); border-top: 1px solid var(--sh-ink); font-family: var(--sh-font); font-size: 15px; line-height: 1.55; letter-spacing: 0; }
.site-footer .fgrid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; max-width: 1320px; margin: 0 auto; padding: 56px clamp(16px, 4vw, 56px) 36px; }
.site-footer .fbrand p { max-width: 36ch; margin: 14px 0; color: var(--sh-soft); }
.site-footer .fbrand .fcontact { color: var(--sh-ink); line-height: 1.8; }
.site-footer h2 { display: flex; align-items: center; gap: 10px; max-width: none; margin: 0 0 14px; font: 700 12px/1.2 var(--sh-font); letter-spacing: 0.22em; text-transform: uppercase; color: var(--sh-ink); }
.site-footer h2::before { content: ""; width: 18px; height: 2px; background: var(--sh-or); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 4px 0; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer .linkbtn { padding: 0; margin: 0; background: none; border: 0; font: inherit; letter-spacing: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--sh-or); text-underline-offset: 3px; }
.site-footer li a:hover, .site-footer .fcontact a:hover { box-shadow: inset 0 -2px 0 var(--sh-or); }
.site-footer .fbase { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; max-width: 1320px; margin: 0 auto; padding: 20px clamp(16px, 4vw, 56px) calc(150px + env(safe-area-inset-bottom)); border-top: 1px solid var(--sh-line); font-size: 13px; letter-spacing: 0.06em; }
@media (max-width: 980px) { .site-footer .fgrid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 650px) { .site-footer .fgrid { grid-template-columns: 1fr; padding-top: 40px; } }
