/* ==========================================================================
   The Edited Wild — main.css
   Mobile-first. All CSS custom properties defined in :root.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  --tew-bg:      #FCF6EE;
  --tew-ink:     #221812;
  --tew-accent:  #C96546;
  --tew-accent-ink: #B14E2E; /* WCAG AA for small text on cream: 4.88:1 */
  --tew-sage:    #4B6646;
  --tew-muted:   #6B635B;
  --tew-rule:    rgba(34, 24, 18, .14);

  /* Score-type colors: design/beauty = rust, family/workable = green.
     Aliased to the existing accent/sage tokens for consistency with
     .scores-explainer__letter--design / --family elsewhere on the site. */
  --tew-rust:    var(--tew-accent);
  --tew-green:   var(--tew-sage);

  --tew-serif:   "Instrument Serif", Georgia, serif;
  --tew-sans:    "Work Sans", ui-sans-serif, system-ui, sans-serif;

  --tew-maxw:    1200px;
  --tew-read:    42rem;

  /* Fluid type scale */
  --tew-h1:      clamp(2.4rem, 7vw, 4.5rem);
  --tew-h2:      clamp(1.6rem, 3.5vw, 2.4rem);
  --tew-eyebrow: .72rem;

  /* Header */
  --tew-header-h:      64px;
  --tew-header-bg:     var(--tew-bg);
  --tew-header-border: var(--tew-rule);

  /* Menu panel */
  --tew-panel-w:  min(360px, 90vw);
  --tew-panel-bg: var(--tew-bg);

  /* Transition */
  --tew-ease: cubic-bezier(.4, 0, .2, 1);
}

/* --------------------------------------------------------------------------
   2. Modern CSS reset
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  scroll-behavior: smooth;
}

body {
  font-family: var(--tew-sans);
  font-size: 18px;
  line-height: 1.62;
  color: var(--tew-ink);
  background-color: var(--tew-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

ul, ol {
  list-style: none;
}

a {
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

/* Skip-to-content for accessibility */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: .5rem 1rem;
  background: var(--tew-accent-ink);
  color: #fff;
  font-size: .875rem;
  font-family: var(--tew-sans);
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 9999;
  transition: top .2s;
}
.skip-link:focus {
  top: 0;
}

/* --------------------------------------------------------------------------
   3. Base typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--tew-serif);
  font-weight: 400;
  line-height: 1.15;
  color: var(--tew-ink);
  text-wrap: balance; /* avoid heading widows / orphan words */
}

h1 { font-size: var(--tew-h1); }
h2 { font-size: var(--tew-h2); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.1rem; }

p { max-width: var(--tew-read); }

a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--tew-accent-ink);
}

/* Eyebrow / overline label */
.tew-eyebrow {
  display: block;
  font-family: var(--tew-sans);
  font-size: var(--tew-eyebrow);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tew-muted);
}

/* Accent colour utility */
.tew-accent { color: var(--tew-accent-ink); }

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--tew-rule);
  margin-block: 2rem;
}

/* --------------------------------------------------------------------------
   4. Container utility
   -------------------------------------------------------------------------- */
.tew-container {
  max-width: var(--tew-maxw);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
  /* No overflow-x clip here: body { overflow-x: hidden } is the page-level
     scrollbar guard. Clipping at the container level cuts off intentional
     full-bleed breakouts (e.g. .story__body .wp-block-columns) nested inside
     narrower descendants such as .tew-prose. */
}

/* --------------------------------------------------------------------------
   5. Site header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--tew-header-h);
  padding-inline: clamp(1rem, 4vw, 2.5rem);
  background-color: var(--tew-header-bg);
  border-bottom: 1px solid var(--tew-header-border);
  transition: background-color .3s var(--tew-ease), border-color .3s var(--tew-ease);
}

/* Transparent over hero: header overlaps hero image */
body.tew-has-hero .site-header {
  position: absolute;
  width: 100%;
  background-color: transparent;
  border-bottom-color: transparent;
}

body.tew-has-hero .site-header .site-logo a,
body.tew-has-hero .site-header .menu-toggle {
  color: #fff;
}

/* Logo — text fallback */
.site-logo a {
  font-family: var(--tew-serif);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--tew-ink);
  text-decoration: none;
  line-height: 1;
}

.site-logo a:hover {
  color: var(--tew-accent-ink);
}

/* Logo — custom image (uploaded via Customizer) */
.site-logo .custom-logo-link {
  display: block;
  line-height: 0;
}

.site-logo .custom-logo {
  display: block;
  max-height: 40px;
  width: auto;
}

body.tew-has-hero .site-header .site-logo .custom-logo {
  filter: brightness(0) invert(1);
}

/* Burger button */
.menu-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 44px;
  min-height: 44px;
  padding: .5rem;
  color: var(--tew-ink);
  font-family: var(--tew-sans);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: color .2s;
}

.menu-toggle:hover { color: var(--tew-accent-ink); }

.menu-toggle .burger-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 22px;
}

.menu-toggle .burger-icon span {
  display: block;
  height: 1.5px;
  background: currentColor;
  transition: transform .3s var(--tew-ease), opacity .3s;
}

/* Burger → X when open */
.menu-toggle[aria-expanded="true"] .burger-icon span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .burger-icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.menu-toggle[aria-expanded="true"] .burger-icon span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   6. Full-screen Kinfolk overlay menu
   -------------------------------------------------------------------------- */

/* Backdrop — not used for full-screen overlay, kept as transparent fallback
   so menu.js backdrop logic doesn't break */
.menu-backdrop {
  display: none;
}

/* Overlay panel */
#tew-menu {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  background: var(--tew-bg);
  z-index: 400;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  /* Hidden state: clipped upward + transparent */
  opacity: 0;
  transform: translateY(-1.5rem);
  pointer-events: none;
  transition:
    opacity .42s var(--tew-ease),
    transform .42s var(--tew-ease);
  /* panel is always in DOM but invisible; aria-hidden handles AT */
}

#tew-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  #tew-menu {
    transition: opacity .2s linear;
    transform: none;
  }
}

/* ── Head bar ── */
.tew-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1.5rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--tew-rule);
  flex-shrink: 0;
}

.tew-menu__site-name {
  font-family: var(--tew-serif);
  font-size: 1.15rem;
  letter-spacing: .01em;
  color: var(--tew-ink);
}

/* Close button */
.menu-close {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: .5rem;
  color: var(--tew-muted);
  border-radius: 50%;
  transition: color .2s, background .2s;
}

.menu-close:hover,
.menu-close:focus-visible {
  color: var(--tew-ink);
  background: rgba(34, 24, 18, .06);
}

/* ── Two-column body ── */
.tew-menu__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0;
  /* align-items: stretch (default) — both columns fill the full body height */
}

/* Left column — pages + meta */
.tew-menu__pages {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* Top padding is the vertical centering mechanism — eyebrows align at same y */
  padding: clamp(3rem, 10vh, 6rem) clamp(1.5rem, 5vw, 3.5rem) clamp(2.5rem, 6vw, 5rem);
  border-right: 1px solid var(--tew-rule);
}

/* Column eyebrows */
.tew-menu__eyebrow {
  display: block;
  font-family: var(--tew-sans);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--tew-muted);
  margin-bottom: 1.75rem;
}

.tew-menu__eyebrow--right {
  text-align: right;
}

/* WordPress nav_menu output */
.tew-menu__pages-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tew-menu__pages-list li a,
.tew-menu__pages-list li > a {
  display: flex;
  align-items: center;
  font-family: var(--tew-serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -.01em;
  line-height: 1.15;
  color: var(--tew-ink);
  text-decoration: none;
  padding-block: clamp(.2rem, .6vw, .45rem);
  min-height: 44px;
  transition: color .2s, transform .18s var(--tew-ease);
  transform-origin: left center;
}

.tew-menu__pages-list li a:hover,
.tew-menu__pages-list li > a:hover {
  color: var(--tew-accent);
  transform: translateX(.35rem);
}

.tew-menu__pages-list li a[aria-current],
.tew-menu__pages-list li > a[aria-current] {
  color: var(--tew-accent);
}

/* .tew-menu__meta and .tew-menu__meta-link removed — Instagram now renders as a large serif link in .tew-menu__pages-list */

/* Right column — large serif section list */
.tew-menu__sections {
  /* Same top padding as left column so eyebrows share baseline */
  padding: clamp(3rem, 10vh, 6rem) clamp(1.5rem, 5vw, 3.5rem) clamp(2.5rem, 6vw, 5rem);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
}

.tew-menu__sections-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: flex-end;
}

.tew-menu__section-link {
  display: block;
  font-family: var(--tew-serif);
  font-size: clamp(1.8rem, 5vw, 3.8rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--tew-ink);
  text-decoration: none;
  padding-block: clamp(.2rem, .8vw, .5rem);
  transition: color .18s, transform .18s var(--tew-ease);
  transform-origin: right center;
}

.tew-menu__section-link:hover {
  color: var(--tew-accent);
  transform: translateX(-.35rem);
}

.tew-menu__section-link[aria-current="page"] {
  color: var(--tew-accent);
}

/* ── Mobile: keep two columns, scaled for narrow screens ── */
@media (max-width: 768px) {
  .tew-menu__body {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  /* Tighten column padding and gap for narrow viewports */
  .tew-menu__pages {
    padding: clamp(1.5rem, 5vh, 3rem) clamp(.75rem, 3vw, 1.5rem) clamp(1.5rem, 4vw, 2.5rem);
    border-right: 1px solid var(--tew-rule);
  }

  .tew-menu__sections {
    padding: clamp(1.5rem, 5vh, 3rem) clamp(.75rem, 3vw, 1.5rem) clamp(1.5rem, 4vw, 2.5rem);
    align-items: flex-end;
  }

  /* Eyebrow spacing tightened */
  .tew-menu__eyebrow {
    margin-bottom: 1rem;
  }

  /* Left column page links — scale down for half-width at 375px */
  .tew-menu__pages-list li a,
  .tew-menu__pages-list li > a {
    font-size: clamp(1.1rem, 5vw, 1.8rem);
    padding-block: clamp(.15rem, .4vw, .3rem);
  }

  /* Right column section links — scale so 4 items fit half-width at 375px */
  .tew-menu__section-link {
    font-size: clamp(1.1rem, 5vw, 1.8rem);
    padding-block: clamp(.15rem, .4vw, .3rem);
    transform-origin: right center;
  }

  .tew-menu__section-link:hover {
    transform: translateX(-.35rem);
  }
}

/* Stagger children into view when overlay opens */
#tew-menu.is-open .tew-menu__eyebrow,
#tew-menu.is-open .tew-menu__pages-list li,
#tew-menu.is-open .tew-menu__meta-link,
#tew-menu.is-open .tew-menu__sections-list li {
  animation: tewFadeUp .38s var(--tew-ease) both;
}

#tew-menu.is-open .tew-menu__eyebrow { animation-delay: .02s; }

#tew-menu.is-open .tew-menu__pages-list li:nth-child(1) { animation-delay: .06s; }
#tew-menu.is-open .tew-menu__pages-list li:nth-child(2) { animation-delay: .10s; }
#tew-menu.is-open .tew-menu__pages-list li:nth-child(3) { animation-delay: .14s; }
#tew-menu.is-open .tew-menu__pages-list li:nth-child(4) { animation-delay: .18s; }
#tew-menu.is-open .tew-menu__pages-list li:nth-child(5) { animation-delay: .22s; }
#tew-menu.is-open .tew-menu__meta-link:nth-child(1)     { animation-delay: .28s; }
#tew-menu.is-open .tew-menu__meta-link:nth-child(2)     { animation-delay: .32s; }

#tew-menu.is-open .tew-menu__sections-list li:nth-child(1) { animation-delay: .08s; }
#tew-menu.is-open .tew-menu__sections-list li:nth-child(2) { animation-delay: .13s; }
#tew-menu.is-open .tew-menu__sections-list li:nth-child(3) { animation-delay: .18s; }
#tew-menu.is-open .tew-menu__sections-list li:nth-child(4) { animation-delay: .23s; }
#tew-menu.is-open .tew-menu__sections-list li:nth-child(5) { animation-delay: .28s; }

@keyframes tewFadeUp {
  from { opacity: 0; transform: translateY(.6rem); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  #tew-menu.is-open .tew-menu__eyebrow,
  #tew-menu.is-open .tew-menu__pages-list li,
  #tew-menu.is-open .tew-menu__meta-link,
  #tew-menu.is-open .tew-menu__sections-list li {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   7. Site footer
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--tew-ink);
  color: var(--tew-bg);
  padding-block: clamp(3rem, 6vw, 5rem);
  margin-top: clamp(4rem, 8vw, 7rem);
}

.site-footer a {
  color: rgba(250, 246, 240, .7);
  text-decoration: none;
  transition: color .2s;
}

.site-footer a:hover {
  color: var(--tew-bg);
}

.tew-footer__inner {
  max-width: var(--tew-maxw);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.tew-footer__blurb {
  font-family: var(--tew-serif);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  line-height: 1.5;
  max-width: 36rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  color: rgba(250, 246, 240, .85);
}

/* 4-column grid: 1 col phone → 2 col tablet → 4 col desktop */
.tew-footer__cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 48rem) and (max-width: 63.9375rem) {
  .tew-footer__cols {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
}

@media (min-width: 64rem) {
  .tew-footer__cols {
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
  }
}

.tew-footer__col-heading {
  font-family: var(--tew-sans);
  font-size: var(--tew-eyebrow);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(250, 246, 240, .62);
  margin-bottom: 1rem;
}

.tew-footer__col ul {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.tew-footer__col li a {
  font-size: .95rem;
  line-height: 1.4;
}

.tew-footer__bottom {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid rgba(250, 246, 240, .12);
  font-size: .8rem;
  color: rgba(250, 246, 240, .62);
}

/* --------------------------------------------------------------------------
   8. Link & accent utilities
   -------------------------------------------------------------------------- */
.tew-link--accent {
  color: var(--tew-accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tew-link--accent:hover {
  color: var(--tew-ink);
}

/* Pill/tag */
.tew-tag {
  display: inline-block;
  font-family: var(--tew-sans);
  font-size: var(--tew-eyebrow);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--tew-muted);
  border: 1px solid var(--tew-rule);
  border-radius: 100px;
  padding: .2em .75em;
  text-decoration: none;
  transition: border-color .2s, color .2s;
}

.tew-tag:hover {
  color: var(--tew-accent-ink);
  border-color: var(--tew-accent);
}

/* Score badge */
.tew-score {
  display: inline-flex;
  align-items: baseline;
  gap: .2em;
  font-family: var(--tew-serif);
  font-size: 2rem;
  color: var(--tew-ink);
}

.tew-score__denom {
  font-size: .85rem;
  font-family: var(--tew-sans);
  color: var(--tew-muted);
}

/* Body scroll lock */
body.tew-menu-open {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Shared: card grid
   Canonical responsive grid used by home, archive, and story (related).
   home.css and archive.css must NOT redefine .card-grid — they only add
   context-specific child styles. story.css relies on this for related stories.
   -------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

@media (min-width: 48rem) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 1.75rem;
  }
}

@media (min-width: 64rem) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem 2rem;
  }
}

/* --------------------------------------------------------------------------
   Shared: story card
   Cards render on home, archives, and single (related) — so these live in
   main.css (loaded everywhere), NOT in a page-specific component file.

   Markup is now <div class="story-card-cell"><a class="story-card">…</a>
   <a class="story-card__book">…</a></div> — the cell is the grid item (an
   <a> can't wrap another <a>, so the "Request these dates" CTA has to be a
   sibling of the card link, not nested in it). The cell becomes a flex
   column so .story-card + the optional CTA stack, and it still stretches to
   fill the grid row for equal-height cards, same as before the rewrap.
   -------------------------------------------------------------------------- */
.story-card-cell {
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
}

.story-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: var(--tew-ink);
  transition: color .18s;
}

.story-card:hover {
  color: var(--tew-ink);
}

.story-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background-color: var(--tew-rule);
  margin-bottom: 1rem;
}

.story-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .42s var(--tew-ease);
}

.story-card:hover .story-card__media img {
  transform: scale(1.03);
}

.story-card__body {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  flex: 1;
}

/* Eyebrow inside card — uses the .eyebrow class from template-tags */
.story-card .eyebrow,
.story-card__body .eyebrow {
  font-family: var(--tew-sans);
  font-size: var(--tew-eyebrow);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tew-accent-ink);
  margin: 0;
  max-width: 100%;
}

.story-card__title {
  font-family: var(--tew-serif);
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
  max-width: 100%;
}

.story-card__excerpt {
  font-family: var(--tew-sans);
  font-size: .9rem;
  line-height: 1.55;
  color: var(--tew-muted);
  margin: 0;
  max-width: 100%;
  /* Clamp to 3 lines */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* Score badges inside card */
.story-card .scores {
  display: flex;
  gap: .5rem;
  margin-top: auto;
  padding-top: .5rem;
}

.story-card .score {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-family: var(--tew-sans);
  font-size: .7rem;
  font-variant: small-caps;
  letter-spacing: .06em;
  color: var(--tew-muted);
}

.story-card .score .score__label {
  font-style: normal;
  text-transform: uppercase;
  font-size: .65rem;
  letter-spacing: .1em;
}

.story-card .score b {
  font-weight: 600;
  color: var(--tew-ink);
  font-variant-numeric: tabular-nums; /* align score digits */
}

.story-card .score--design b {
  color: var(--tew-rust);
}

.story-card .score--family b {
  color: var(--tew-green);
}

/* Booking CTA — sibling of .story-card inside .story-card-cell, shown only
   when the story has booking enabled. Plain <a>, no JS required: it deep
   links to #story-booking on the story page. */
.story-card__book {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: .75rem;
  padding: .6rem 1.25rem;
  border: 1px solid var(--tew-accent);
  border-radius: 999px;
  background-color: var(--tew-bg);
  font-family: var(--tew-sans);
  font-size: var(--tew-eyebrow);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  color: var(--tew-accent-ink);
  transition: background-color .18s, color .18s;
}

.story-card__book:hover {
  background-color: var(--tew-accent);
  color: var(--tew-bg);
}

/* --------------------------------------------------------------------------
   9. Responsive breakpoints
   -------------------------------------------------------------------------- */
@media (min-width: 48rem) {
  .site-header {
    height: 72px;
  }
}

@media (min-width: 64rem) {
  .site-header {
    height: 80px;
  }
}

/* --------------------------------------------------------------------------
   10. Accessibility: visible keyboard focus + reduced motion
   -------------------------------------------------------------------------- */

/* Screen-reader-only utility — visually hidden but accessible to AT */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--tew-accent);
  outline-offset: 2px;
  border-radius: 1px;
}
/* Don't show the ring on mouse click, only keyboard (browsers w/o :focus-visible) */
:focus:not(:focus-visible) {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   11. Mobile global safeguards  (< 48 rem / 768 px)
   -------------------------------------------------------------------------- */
@media (max-width: 47.9375rem) {
  /* Story card: on phone, 4/5 portrait cards can feel tall — keep them but
     add a max-height so a single card never dominates a narrow screen */
  .story-card__media {
    max-height: 70vw; /* ~262px at 375px — roughly square/portrait */
  }

  /* Ensure all images are constrained to their container */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Prevent long words / URLs from causing overflow in prose */
  .tew-prose p,
  .story-block__text p,
  .about__premise p,
  .page-prose p {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Ensure footer columns stack cleanly (already 1fr on mobile) */
  .tew-footer__blurb {
    font-size: clamp(1rem, 4vw, 1.4rem);
  }

  /* Footer bottom: allow text to wrap */
  .tew-footer__bottom {
    font-size: .75rem;
    line-height: 1.55;
  }
}
