/* ==========================================================================
   story.css — Single Story template styles
   Part of The Edited Wild theme. Imported by main.css via @import.
   Mobile-first; all colours and type via design tokens only.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Story header — centred narrow column
   -------------------------------------------------------------------------- */
.story__header {
  text-align: center;
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2rem, 4vw, 3rem);
  max-width: 50rem;
  margin-inline: auto;
}

/* When a booking trigger immediately follows, the header's own bottom
   padding (meant for header→hero spacing) is too much space before the
   button — tighten it specifically for this adjacency only. */
.story__header:has( + .tew-book-trigger ) {
  padding-bottom: clamp(0.5rem, 1vw, 1rem);
}

/* Eyebrow: uppercase accent label */
.story__header .eyebrow {
  display: inline-block;
  font-family: var(--tew-sans);
  font-size: var(--tew-eyebrow);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--tew-accent-ink);
  margin-bottom: 1.25rem;
}

/* Serif fluid H1 */
.story__title {
  font-family: var(--tew-serif);
  font-size: var(--tew-h1);
  font-weight: 400;
  line-height: 1.1;
  color: var(--tew-ink);
  margin-bottom: clamp(1rem, 2.5vw, 1.5rem);
}

/* Dek — larger serif italic summary under the title */
.story__dek {
  font-family: var(--tew-serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  line-height: 1.55;
  color: var(--tew-muted);
  max-width: 34rem;
  margin-inline: auto;
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

/* Byline rule — hairline borders above and below */
.story__byline-rule {
  position: relative;
  padding-block: 1.1rem;
  border-top: 1px solid var(--tew-rule);
  border-bottom: 1px solid var(--tew-rule);
  display: flex;
  justify-content: center;
}

.story__byline-rule .byline {
  font-family: var(--tew-sans);
  font-size: var(--tew-eyebrow);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--tew-muted);
  margin: 0;
  max-width: none; /* override global p max-width */
}

/* --------------------------------------------------------------------------
   2. Hero image — full-bleed-ish with optional rounding on large screens
   -------------------------------------------------------------------------- */
.story__hero-wrap {
  margin: 0;
  width: 100%;
  overflow: hidden;
}

.story__hero {
  width: 100%;
  /* Mobile: aspect-ratio drives height — prevents overly tall portrait images.
     56vw at 375px ≈ 210px → clamped to 260px is fine; aspect-ratio gives a
     more predictable result than vw-based height alone. */
  aspect-ratio: 4 / 3;
  height: auto;
  max-height: 55dvh;
  object-fit: cover;
  object-position: center;
  display: block;
}

@media (min-width: 48rem) {
  .story__hero-wrap {
    border-radius: 4px;
    max-width: var(--tew-maxw);
    margin-inline: auto;
  }
}

/* --------------------------------------------------------------------------
   3. Prose body — editorial reading column
   -------------------------------------------------------------------------- */
.story__body.tew-prose {
  max-width: var(--tew-read);
  margin-inline: auto;
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

/* Remove global p max-width inside prose — prose container handles it */
.tew-prose p {
  max-width: none;
  font-size: 1.125rem;
  line-height: 1.78;
  color: var(--tew-ink);
  margin-bottom: 1.6em;
}

/* Section headings inside block editor content */
.tew-prose h2 {
  font-family: var(--tew-serif);
  font-size: var(--tew-h2);
  font-weight: 400;
  line-height: 1.2;
  color: var(--tew-ink);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
}

.tew-prose h3 {
  font-family: var(--tew-serif);
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-weight: 400;
  line-height: 1.25;
  color: var(--tew-ink);
  margin-top: 2rem;
  margin-bottom: .75rem;
}

/* Images inside block content */
.tew-prose figure {
  margin-block: clamp(2rem, 4vw, 3rem);
  margin-inline: 0;
}

.tew-prose figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

.tew-prose figcaption {
  font-family: var(--tew-sans);
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--tew-muted);
  margin-top: .6rem;
  text-align: center;
}

/* Pull quote — large terracotta serif, set off from the body */
.tew-prose blockquote {
  font-family: var(--tew-serif);
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  line-height: 1.32;
  color: var(--tew-accent);
  font-style: normal;
  max-width: none;
  margin-block: clamp(2.5rem, 5vw, 3.75rem);
  padding-inline: 0;
  border: none;
  text-wrap: balance;
}

.tew-prose blockquote p {
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  max-width: none;
  margin: 0;
}

/* Drop-cap on the very first paragraph — classic prose or Gutenberg block */
.tew-prose > p:first-of-type::first-letter,
.tew-prose > .wp-block-paragraph:first-of-type::first-letter {
  font-family: var(--tew-serif);
  font-size: 4.2em;
  font-weight: 400;
  line-height: .82;
  float: left;
  margin-right: .08em;
  margin-top: .06em;
  color: var(--tew-ink);
}

/* Inline links */
.tew-prose a {
  color: var(--tew-accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.tew-prose a:hover {
  color: var(--tew-ink);
}

/* Lists */
.tew-prose ul,
.tew-prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1.6em;
}

.tew-prose ul {
  list-style: disc;
}

.tew-prose ol {
  list-style: decimal;
}

.tew-prose li {
  font-size: 1.125rem;
  line-height: 1.7;
  margin-bottom: .4em;
}

/* Horizontal rules in content */
.tew-prose hr {
  border: none;
  border-top: 1px solid var(--tew-rule);
  margin-block: clamp(2rem, 4vw, 3rem);
}

/* Blockquote */
.tew-prose blockquote {
  border-left: 3px solid var(--tew-accent);
  margin-inline: 0;
  padding: .75rem 0 .75rem 1.5rem;
  margin-block: 2rem;
}

.tew-prose blockquote p {
  font-family: var(--tew-serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: var(--tew-ink);
  margin: 0;
}

/* --------------------------------------------------------------------------
   4. Scores panel — large centred display
   -------------------------------------------------------------------------- */
.story__scores {
  text-align: center;
  padding-block: clamp(4rem, 8vw, 6rem);
  border-top: 1px solid var(--tew-rule);
  border-bottom: 1px solid var(--tew-rule);
  margin-block: clamp(3rem, 6vw, 4.5rem);
}

.story__scores-heading {
  font-family: var(--tew-serif);
  font-size: clamp(.95rem, 2vw, 1.1rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  color: var(--tew-muted);
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
  max-width: 30rem;
  margin-inline: auto;
  line-height: 1.5;
}

/* Override card-level badge sizes — much larger on the article page */
.story__scores-badges .scores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(3rem, 8vw, 6rem);
}

.story__scores-badges .score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
}

.story__scores-badges .score__label {
  font-family: var(--tew-sans);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--tew-muted);
  font-style: normal;
  margin-bottom: .25rem;
}

.story__scores-badges .score b {
  font-family: var(--tew-serif);
  font-size: clamp(4.5rem, 11vw, 7.5rem);
  font-weight: 400;
  line-height: 1;
  color: var(--tew-ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.story__scores-badges .score--design b {
  color: var(--tew-rust);
}

.story__scores-badges .score--family b {
  color: var(--tew-green);
}

.story__scores-badges .score__blurb {
  font-family: var(--tew-serif);
  font-style: italic;
  font-size: .875rem;
  color: var(--tew-muted);
  text-align: center;
  max-width: 16rem;
  margin-top: .75rem;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   6. Related stories — reuses .card-grid defined in main.css
   -------------------------------------------------------------------------- */
.story__related {
  padding-block: clamp(3rem, 7vw, 5rem);
  border-top: 1px solid var(--tew-rule);
  margin-top: clamp(2rem, 5vw, 4rem);
}

.story__related-heading {
  font-family: var(--tew-serif);
  font-size: var(--tew-h2);
  font-weight: 400;
  color: var(--tew-ink);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  text-align: center;
}

/* --------------------------------------------------------------------------
   7. Responsive overrides
   -------------------------------------------------------------------------- */

/* ≥ 48 rem (768 px) -------------------------------------------------------- */
@media (min-width: 48rem) {
  .story__body.tew-prose {
    padding-inline: 0; /* container handles horizontal padding */
  }
}

/* ≥ 48 rem (768 px) — restore full-cinematic hero height on tablet+ ---------- */
@media (min-width: 48rem) {
  .story__hero {
    aspect-ratio: 16 / 7;
    max-height: none;
    height: clamp(320px, 48vw, 680px);
  }
}

/* ≥ 64 rem (1024 px) ------------------------------------------------------- */
@media (min-width: 64rem) {
  .story__header {
    padding-block: clamp(4rem, 8vw, 7rem) clamp(2.5rem, 4vw, 3.5rem);
  }

  .story__header:has( + .tew-book-trigger ) {
    padding-bottom: clamp(0.5rem, 1vw, 1rem);
  }

  .story__hero {
    aspect-ratio: unset;
    height: clamp(480px, 55vw, 680px);
  }

  .tew-prose p {
    font-size: 1.175rem;
    line-height: 1.82;
  }
}

/* Mobile-specific story tweaks (< 48 rem) ---------------------------------- */
@media (max-width: 47.9375rem) {
  /* Story header: tighter padding on phone */
  .story__header {
    padding-block: clamp(2rem, 6vw, 3.5rem) clamp(1.5rem, 3vw, 2rem);
  }

  /* Story title: allow slightly larger on phone without overflowing */
  .story__title {
    font-size: clamp(2rem, 8.5vw, 4.5rem);
    word-break: break-word;
  }

  /* Scores panel: stack badges vertically on very narrow phones (360px)
     Two large numerals side by side need ~180px at min-size. On 360px this
     works but add flex-wrap as safety */
  .story__scores-badges .scores {
    gap: clamp(2rem, 6vw, 6rem);
  }

  .story__scores-badges .score b {
    /* Scale down slightly more on 360–375px */
    font-size: clamp(3.75rem, 10vw, 7.5rem);
  }

  /* Scores panel padding */
  .story__scores {
    padding-block: clamp(2.5rem, 6vw, 4rem);
  }

  /* Need-to-know: tighter padding */
  .story__needtoknow {
    margin-block: clamp(1.5rem, 4vw, 3rem);
  }

  /* Prose body: ensure comfortable reading on 375px */
  .story__body.tew-prose {
    padding-block: clamp(1.5rem, 4vw, 2.5rem);
  }
}
