/* Local body font: DM Sans variable (opsz + wght 100-1000).
   One file covers Extralight 200 through Bold 700.
   NOTE: font URLs carry no ?v= — fonts change ~never; on a font swap,
   RENAME the file (same rule as content images) so the 1-year cache busts.
   Everything else busts automatically via tmj_asset() in config/site.php. */
@font-face {
  font-family: "DM Sans";
  src: url("../fonts/DMSans-VariableFont_opsz,wght.woff2") format("woff2"),
    url("../fonts/DMSans-VariableFont_opsz,wght.ttf") format("truetype");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("../fonts/DMSans-Italic-VariableFont_opsz,wght.woff2") format("woff2"),
    url("../fonts/DMSans-Italic-VariableFont_opsz,wght.ttf") format("truetype");
  font-weight: 100 1000;
  font-style: italic;
  font-display: swap;
}

/* Local logo font: single thin cut declared at 400 only, so headings
   at 600/700 get browser-synthesized bold instead of staying hairline. */
@font-face {
  font-family: "Elegant Lux Mager";
  src: url("../fonts/ElegantLux-Mager.woff2") format("woff2"),
    url("../fonts/ElegantLux-Mager.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 200;
  font-size: var(--text-body);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
}

main { flex: 1; }

/* Flex-children shrink guard: header/main/footer must never force the
   page wider than the viewport (body is the flex column). No-op healthy. */
header, main, footer { min-width: 0; }

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  margin: 0 0 var(--space-4);
  line-height: 1.15;
}

a { color: var(--color-secondary); }

.container {
  width: min(100% - 48px, 1280px);
  margin-inline: auto;
}

@media (max-width: 767px) {
  .container {
    width: calc(100% - 32px);
  }
  .page-hero { padding: var(--space-7) 0; }
}

.hero {
  background: var(--color-primary);
  color: var(--tmj-off-white);
  padding: var(--space-10) 0;
}

.hero h1 { color: var(--tmj-off-white); }

.hero p {
  color: var(--tmj-sand);
  max-width: 680px;
}

/* Page hero — the ONE shared intro band for every non-home page (about,
   resources, stories, legal, faq, donate, contact). Dark anthracite,
   text-hero H1, sand lede, one padding. Pages add ONLY their background
   art via a second class; type and spacing never diverge per page.
   Documented exceptions: donate (form-overlap clearance + off-white lede
   over a 45% veil), contact + story-masthead (light editorial variants). */
.page-hero {
  background: var(--color-primary-dark);
  color: var(--tmj-off-white);
  padding: var(--space-8) 0;
}

.page-hero h1 {
  color: var(--tmj-off-white);
  font-size: var(--text-hero);
  margin: 0 0 var(--space-3);
}

.page-hero p {
  margin: 0;
  max-width: 680px;
  font-size: var(--text-lede);
  color: var(--tmj-sand);
}

.page-hero-eyebrow {
  margin: 0 0 var(--space-3);
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--tmj-sand);
}

/* CTASection — global inset action card. A sand clearing with a yellow
   action rule: separation from surrounding sections without another dark
   band melting into the footer. Pages provide the words; this is the room. */
.cta-card {
  background: var(--tmj-sand);
  border-top: 6px solid var(--tmj-yellow);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-6), 6vw, var(--space-9));
  text-align: center;
}

.cta-card h2 {
  margin: 0 0 var(--space-3);
  color: var(--tmj-anthracite);
  font-size: var(--text-h2);
}

.cta-card p {
  max-width: 680px;
  margin: 0 auto var(--space-5);
  color: var(--tmj-anthracite);
  font-size: var(--text-lede);
}

.cta-card .cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
}

.cta-card p a { font-weight: 700; text-decoration: none; }
.cta-card p a:hover { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 767px) {
  .cta-card .cta-row { flex-direction: column; align-items: stretch; }
  .cta-card .cta-row a { text-align: center; }
}

:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
}

/* Touch: no tap-highlight ink box on links/buttons. Keyboard :focus-visible above is untouched. */
a, button { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -48px;
  background: var(--color-surface);
  color: var(--color-primary);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.skip-link:focus { top: var(--space-2); }

/* Screen-reader-only text: announced + crawled, zero visual footprint. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Header — universal */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-primary);
  transition: background 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site-header.scrolled {
  background: var(--color-primary-dark);
  border-bottom: 1px solid var(--color-bg-darker);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: 80px;
  padding-block: var(--space-3);
}

.brand { display: inline-flex; padding: 0; margin: 0; line-height: 0; }
.brand img { display: block; height: 64px; width: auto; }

/* .site-nav holds two flex children: the .nav-list and the pinned
   #donate-nav CTA (always visible). Five top items fit the desktop bar, so
   the list never wraps and no measuring script is involved. */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-width: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.site-nav li.nav-item { flex: 0 0 auto; }
#donate-nav { flex: 0 0 auto; }

.site-nav a {
  display: inline-block;
  color: var(--tmj-off-white);
  text-decoration: none;
  font-size: var(--text-small);
  font-weight: 500;
  white-space: nowrap;
}

.site-nav a:hover { color: var(--tmj-sand); }
.site-nav a.active { color: var(--tmj-sage); font-weight: 700; transform: scale(1.08); text-decoration: underline; text-underline-offset: 4px; }

/* Mega menu — full-width editorial panels, one per parent (panel copy
   lives in includes/nav-mega.php). Desktop: caret toggles
   for touch, hover and focus-within reveal for mouse and keyboard. The
   panel hangs off a warm sand rule inside a hairline frame; items wake with
   a terracotta tick — the timeline's counting mark. Columns split 1fr/1fr/
   1.1fr with sage hairline separators. */
.mega-item {
  position: static;
  display: flex;
  align-items: center;
}

.mega-parent { letter-spacing: 0.04em; }

.mega-toggle {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 0;
  padding: var(--space-1);
  color: var(--tmj-off-white);
  font-size: 0.7em;
  cursor: pointer;
}

.mega-toggle:hover { color: var(--tmj-sand); }

.mega-caret { display: inline-block; transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1); }

.mega-item.is-open .mega-caret { transform: rotate(180deg); }

/* An open panel tints its parent sand; the parent of the current page
   reads sage. Colour never signals alone — caret/underline agree. */
.mega-item.is-open > .mega-parent { color: var(--tmj-sand); }
.site-nav a.mega-parent.is-active { color: var(--tmj-sage); font-weight: 700; }

.mega-panels {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  pointer-events: none; /* closed panels stay rendered for the close fade — never intercept */
}

/* Open fades+rises (250ms); close settles back (200ms) instead of popping.
   visibility (not display) carries the hide so the fade can play and so
   hidden panels leave the tab order. JS defers the `hidden` attr ~200ms. */
.mega-panel {
  display: block;
  position: absolute; /* all panels share one slot — hidden ones must not stack */
  top: 0;
  left: 0;
  right: 0;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 180ms ease-out, transform 200ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 200ms;
  background: var(--color-primary-dark);
  border-top: 2px solid var(--tmj-sand);
  border-bottom: 1px solid var(--color-bg-darker);
  box-shadow: 0 16px 32px color-mix(in srgb, var(--color-bg-darker) 35%, transparent);
}

.mega-panel.is-open {
  visibility: visible;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: opacity 220ms ease-out, transform 250ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
}

.mega-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: var(--space-7);
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
  align-items: start;
}

.mega-col1 ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mega-kicker {
  margin: 0 0 var(--space-4);
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--tmj-sand);
}

.mega-panel .mega-col1 li a {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--text-small);
  font-weight: 500;
  line-height: 1.6;
  color: var(--tmj-off-white);
  text-decoration: none;
  white-space: normal;
}

.mega-num {
  font-size: var(--text-caption);
  font-weight: 500;
  color: var(--tmj-terracotta);
  font-variant-numeric: tabular-nums;
}

.mega-col1 li a:hover { color: var(--tmj-sand); }

/* Trailing arrow wakes on hover/focus — same → idiom as the Explore links. */
.mega-panel .mega-col1 li a::after {
  content: "→";
  color: var(--tmj-sand);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 200ms ease-out, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.mega-col1 li a:hover::after,
.mega-col1 li a:focus-visible::after { opacity: 1; transform: none; }

/* The index number stays terracotta on hover — it is the column's
   signature, not a second copy of the title treatment. */

.mega-col2 {
  border-left: 1px solid color-mix(in srgb, var(--color-surface) 22%, transparent);
  padding-left: var(--space-6);
}

.mega-context {
  margin: 0 0 var(--space-4);
  max-width: 32ch;
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--tmj-off-white);
}

.mega-panel a.mega-explore {
  font-size: var(--text-small);
  font-weight: 700;
  color: var(--tmj-sand);
  text-decoration: none;
}

.mega-explore .btn-arrow {
  display: inline-block;
  margin-left: var(--space-1);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mega-explore:hover .btn-arrow { transform: translateX(3px); }

.mega-panel a.mega-feat {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  border-left: 1px solid color-mix(in srgb, var(--color-surface) 22%, transparent);
  padding: 0 0 0 var(--space-6);
  text-decoration: none;
}

.mega-frame {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 16 / 10;
  background: var(--tmj-sand);
}

.mega-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mega-feat:hover .mega-frame img { transform: scale(1.03); }

.mega-feat-text { display: block; }

.mega-feat-text .mega-kicker { margin-bottom: var(--space-1); }

.mega-feat-title {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  line-height: 1.25;
  color: var(--tmj-off-white);
}

.mega-feat-sub {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-small);
  color: var(--tmj-sand);
}

.mega-go {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--tmj-sand);
}

.mega-go .btn-arrow {
  display: inline-block;
  margin-left: var(--space-1);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mega-feat:hover .mega-go .btn-arrow { transform: translateX(3px); }

/* Mobile menu list: rendered always, shown only under the hamburger. */
.m-list { display: none; }

.btn-accent {
  display: inline-block;
  background: var(--color-accent-green);
  color: var(--color-text);
  font-size: var(--text-body);
  font-weight: 700;
  text-decoration: none;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-sm);
}

.btn-accent:hover { background: var(--color-accent-green-dark); color: var(--color-text); }

/* Header Donate — standalone accent button. The ONE sanctioned yellow-button
   treatment is Yellow + Anthracite; ID-scoped so nav-link rules
   (.site-nav a and its :hover) can never bleach its text to off-white. */
#donate-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-green);
  color: var(--tmj-anthracite);
  font-weight: 700;
  text-decoration: none;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-sm);
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1),
    background 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

#donate-nav:hover {
  background: var(--color-accent-green-dark);
  color: var(--tmj-anthracite);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--color-bg-darker) 35%, transparent);
}

#donate-nav .btn-arrow {
  display: inline-block;
  margin-left: var(--space-1);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

#donate-nav:hover .btn-arrow { transform: translateX(3px); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: 0;
  padding: var(--space-2);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--tmj-off-white);
  border-radius: 2px;
  transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Below 1024px the hamburger owns navigation: the full menu drops down as
   a column, sub-items reading as indented groups. Five top items always
   fit the desktop bar above that, so no breakpoint in between needs help. */

@media (max-width: 1023px) {
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--color-primary-dark);
    border-bottom: 1px solid var(--color-bg-darker);
    max-height: calc(100dvh - 100%);
    max-height: calc(100vh - 100%);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  body.menu-open { overflow: hidden; }

  .site-nav.open { display: flex; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: wrap;
    overflow: visible;
    gap: 0;
    padding: var(--space-2) var(--space-4) 0;
  }

  /* Mobile menu: the desktop row hides, groups accordion with a compact
     featured card each. Menu order reads groups → contact → donate. */
  .nav-list { display: none; }

  .m-list { display: block; order: -1; padding: var(--space-2) var(--space-4) 0; }

  .m-group { border-top: 1px solid color-mix(in srgb, var(--color-surface) 22%, transparent); }
  .m-group:last-child { border-bottom: 1px solid color-mix(in srgb, var(--color-surface) 22%, transparent); }

  .m-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
  }

  .site-nav a.m-parent {
    display: flex;
    flex: 1;
    align-items: center;
    min-height: 44px;
    padding: var(--space-3) 0;
    font-size: var(--text-lede);
    font-weight: 700;
  }

  /* Contact link is a direct nav child (not in a list) — give it the same
     full-width block treatment so it is a 44px+ target, not inline text. */
  .site-nav a.nav-contact {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin: 0 var(--space-4);
    padding: var(--space-3) 0;
    font-size: var(--text-lede);
    font-weight: 700;
    border-top: 1px solid color-mix(in srgb, var(--color-surface) 22%, transparent);
  }

  .m-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 0;
    cursor: pointer;
  }

  .m-mark { position: relative; width: 16px; height: 16px; }

  .m-mark::before,
  .m-mark::after {
    content: "";
    position: absolute;
    background: var(--tmj-terracotta);
    border-radius: var(--radius-pill);
    transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .m-mark::before { left: 0; top: 7px; width: 16px; height: 2px; }
  .m-mark::after { left: 7px; top: 0; width: 2px; height: 16px; }

  .m-group.is-open .m-mark::after { transform: rotate(90deg); opacity: 0; }

  .m-sub { display: none; padding-bottom: var(--space-4); }
  .m-group.is-open .m-sub { display: block; }

  .m-sub ul { margin: 0 0 var(--space-3); padding: 0; list-style: none; }

  .m-sub li a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: var(--space-2) 0;
    color: var(--tmj-sand);
  }

  .site-nav a.m-feat {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid color-mix(in srgb, var(--color-surface) 22%, transparent);
    border-radius: var(--radius-md);
  }

  .m-thumb {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--tmj-sand);
  }

  .m-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

  .m-feat-text { display: block; flex: 1; min-width: 0; }

  .m-kicker {
    display: block;
    font-size: var(--text-caption);
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--tmj-sand);
  }

  .m-feat-title {
    display: block;
    font-weight: 700;
    color: var(--tmj-off-white);
  }

  .m-feat .btn-arrow { color: var(--tmj-sand); }

  .site-nav li a { display: block; padding: var(--space-3) 0; text-align: left; }
  .site-nav li a.active { transform: none; }

  #donate-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    text-align: center;
    margin: var(--space-3) var(--space-4) var(--space-4);
  }

  /* Anthracite focus ring is invisible on the dark header — use sand there. */
  .site-header :focus-visible { outline-color: var(--tmj-sand); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Footer — universal (anthracite surface) */
.site-footer {
  background: var(--color-primary);
  color: var(--tmj-off-white);
  padding: var(--space-6) 0 var(--space-4);
}

.site-footer a { color: var(--tmj-off-white); text-decoration: none; }
.site-footer a:hover { color: var(--color-accent-cyan); }

/* Footer Donate shares the one sanctioned treatment (Yellow + Anthracite);
   footer link rules must never bleach it. */
.site-footer .btn-accent,
.site-footer .btn-accent:hover { color: var(--tmj-anthracite); }

.foot-top {
  display: grid;
  grid-template-columns: 5fr 8fr;
  gap: var(--space-6);
  padding-bottom: var(--space-4);
}

.foot-brand .brand img { height: 64px; }

.foot-brand p { color: var(--tmj-sand); max-width: 420px; margin: var(--space-3) 0 var(--space-4); }

.foot-donate .btn-arrow {
  display: inline-block;
  margin-left: var(--space-1);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.foot-donate:hover .btn-arrow { transform: translateX(3px); }

.foot-news h2,
.foot-news .foot-news-title {
  color: var(--tmj-off-white);
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.15;
  margin: 0 0 var(--space-3);
}

.foot-news > p { color: var(--tmj-sand); margin: 0 0 var(--space-3); }

.news-form { max-width: 560px; }

.news-form label {
  display: block;
  font-size: var(--text-small);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.news-row { display: flex; align-items: stretch; gap: var(--space-3); }

.news-row input {
  flex: 1;
  min-width: 0;
  padding: var(--space-2) var(--space-4);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--text-body);
  color: var(--color-text);
  background: var(--color-surface);
}

.news-row input[aria-invalid="true"] { border-color: var(--color-error); }

.news-row button {
  padding: var(--space-2) var(--space-5);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--color-accent-green);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-body);
  font-weight: 700;
  cursor: pointer;
  transition: background 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.news-row button:hover { background: var(--color-accent-green-dark); }

.news-row button:disabled { opacity: 0.7; cursor: wait; }

.news-msg { min-height: 0; margin: 0; font-size: var(--text-small); }
.news-msg.is-error, .news-msg.is-ok { min-height: 24px; margin: var(--space-2) 0 0; }
.news-msg.is-error { color: var(--tmj-off-white); text-decoration: underline; text-underline-offset: 3px; }
.news-msg.is-ok { color: var(--color-accent-green); font-weight: 700; }

.news-note { margin: var(--space-2) 0 0; font-size: var(--text-caption); color: var(--tmj-sand); }

.foot-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  padding: var(--space-4) 0;
  border-top: 1px solid color-mix(in srgb, var(--color-surface) 25%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--color-surface) 25%, transparent);
}

.f-group h3, .f-title {
  margin: 0 0 var(--space-2);
  color: var(--tmj-off-white);
  font-size: var(--text-h3);
  font-weight: 700;
}

.f-toggle {
  background: none;
  border: 0;
  padding: 0;
  color: var(--tmj-off-white);
  font: inherit;
  font-size: var(--text-h3);
  font-weight: 700;
  cursor: pointer;
}

.f-toggle .chev { display: none; }

.f-group ul { margin: 0; padding: 0; list-style: none; }

.f-group li { margin-bottom: var(--space-2); }
.f-group li a, .f-group li span { font-size: var(--text-small); overflow-wrap: anywhere; }
.f-group li span { color: var(--tmj-sand); }

.foot-social {
  display: flex;
  gap: var(--space-3);
}

.soc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--color-surface) 40%, transparent);
  border-radius: var(--radius-pill);
  color: var(--tmj-off-white);
}

.foot-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-3);
  font-size: var(--text-caption);
  color: var(--tmj-sand);
}

.legal-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.foot-legal p { margin: 0; }

.foot-legal ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.credit {
  margin: 0;
  font-size: var(--text-caption);
  color: color-mix(in srgb, var(--color-surface) 70%, transparent);
}

@media (max-width: 1023px) {
  .foot-top { grid-template-columns: 1fr; }
  .foot-nav { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .site-footer { padding: var(--space-7) 0 var(--space-4); }
  .foot-nav { grid-template-columns: 1fr; gap: 0; }
  .f-group.is-collapsible { border-bottom: 1px solid color-mix(in srgb, var(--color-surface) 25%, transparent); }
  /* Static groups (Contact) are not collapsible: no divider, own top room. */
  .f-group:not(.is-collapsible) { padding-top: var(--space-3); }
  .f-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-3) 0;
  }
  .f-toggle .chev {
    display: inline-block;
    transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .f-group.open .f-toggle .chev { transform: rotate(45deg); }
  .f-group.is-collapsible ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .f-group.is-collapsible.open ul { max-height: 480px; }
  .f-group li a { display: block; padding: var(--space-2) 0; }
  .news-row { flex-direction: column; }
  .news-row button { width: 100%; }
  .legal-left { flex-direction: column; align-items: flex-start; gap: var(--space-3); }
  .foot-legal { flex-direction: column; align-items: flex-start; }
}

/* Site-wide slow-image handling: content first, photos enhance.
   Photo frames hold a Sand wash while bytes are in flight; images fade in
   via .is-loaded on the img + frame (footer.js, no :has dependency).
   Logos/icons (.mq-frame, .partner-logo, .brand, .svc-icon) are untouched —
   transparent art must never sit on a sand box. Tokens only. */
.docu-frame,
.proj-media,
.svc-media,
.res-thumb,
.side-fig,
.team-media {
  background: var(--tmj-sand);
  overflow: hidden;
}

/* Fade applies only when JS is alive to complete it (html.tmj-imgfade);
   no-JS / deferred-JS-failed pages show photos normally, never stuck at 0. */
.tmj-imgfade .docu-frame img,
.tmj-imgfade .proj-media img,
.tmj-imgfade .svc-media img,
.tmj-imgfade .res-thumb img,
.tmj-imgfade .side-fig img,
.tmj-imgfade .team-media img {
  opacity: 0;
  transition: opacity 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tmj-imgfade .docu-frame img.is-loaded,
.tmj-imgfade .proj-media img.is-loaded,
.tmj-imgfade .svc-media img.is-loaded,
.tmj-imgfade .res-thumb img.is-loaded,
.tmj-imgfade .side-fig img.is-loaded,
.tmj-imgfade .team-media img.is-loaded {
  opacity: 1;
}

/* Shimmer sweep while the photo is in flight — sage on sand, calm.
   Parent carries position so the sweep can never escape onto neighbours
   (e.g. hero); parent .is-loaded (set by footer.js) kills it. Killed
   entirely under reduced-motion (static sand instead). */
.docu-frame:empty,
.proj-media:empty {
  min-height: 180px;
}

.docu-frame,
.proj-media,
.svc-media {
  position: relative;
}

.docu-frame::after,
.proj-media::after,
.svc-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--tmj-sage) 35%, var(--tmj-sand)) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: tmj-img-sweep 1.8s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  pointer-events: none;
}

.docu-frame.is-loaded::after,
.proj-media.is-loaded::after,
.svc-media.is-loaded::after {
  display: none;
}

@keyframes tmj-img-sweep {
  to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .docu-frame::after,
  .proj-media::after,
  .svc-media::after { display: none; }
}

/* Floating Follow Us rail — universal quick social access. */
.follow-rail {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-1);
  background: var(--color-primary-dark);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  box-shadow: -2px 2px 10px color-mix(in srgb, var(--color-bg-darker) 25%, transparent);
}

.follow-rail .follow-label {
  writing-mode: vertical-rl;
  color: var(--tmj-off-white);
  font-size: var(--text-fine);
  font-weight: 500;
  letter-spacing: 2px;
}

.follow-rail .soc {
  width: 36px;
  height: 36px;
  transition: border-color 200ms cubic-bezier(0.22, 1, 0.36, 1), color 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.follow-rail .soc:hover { border-color: var(--color-accent-cyan); color: var(--color-accent-cyan); }

@media (max-width: 767px) {
  /* Mobile: footer social row serves this role - no floating overlap. */
  .follow-rail { display: none; }
}

/* Promo banner — editor-managed CTA strip above the header (see
   BANNER-PLAN.md). Static (scrolls away), one quiet row, colours arrive
   inline from brand-validated slots. Hidden until dismissal JS approves. */
.tmj-banner[hidden] { display: none; }
.tmj-banner { overflow: hidden; transition: max-height 300ms cubic-bezier(0.22, 1, 0.36, 1), opacity 250ms ease; }
.tmj-banner.is-closing { max-height: 0 !important; opacity: 0; }
.tmj-banner-in { padding: var(--space-2) 0; }
.tmj-banner-row { display: flex; align-items: center; gap: var(--space-3); }
.tmj-banner-text { margin: 0; font-size: var(--text-small); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tmj-banner-text strong { font-size: var(--text-body); }
.tmj-banner-text span { font-style: italic; }
.tmj-banner-text a { color: inherit; font-weight: 700; text-underline-offset: 3px; }
.tmj-banner-x {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
  font-size: var(--text-body);
}