/* ==========================================================================
   home.css — Homepage-specific component styles for The Edited Wild.
   Mobile-first. Uses only tokens from :root defined in main.css.
   Imported by main.css (orchestrator adds @import).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Accessibility utilities (standard WP patterns)
   -------------------------------------------------------------------------- */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Honeypot — must never be visible */
.tew-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  tab-size: 0;
}

/* --------------------------------------------------------------------------
   1. HERO
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  /* Mobile: cap at 90dvh so the hero doesn't consume the entire screen,
     leaving a hint of content below to invite scrolling */
  min-height: 90dvh;
  overflow: hidden;
  color: #fff;
}

@media (min-width: 48rem) {
  .hero {
    /* Tablet+: restore full viewport height for editorial impact */
    min-height: 100svh;
    min-height: 100dvh;
  }
}

/* Fallback for browsers that support neither svh nor dvh */
@supports not (min-height: 100svh) {
  .hero {
    min-height: 90vh;
  }

  @media (min-width: 48rem) {
    .hero {
      min-height: 100vh;
    }
  }
}

.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  /* Gradient from dark bottom to transparent top — legibility without mudding the image */
  background: linear-gradient(
    to top,
    rgba(22, 14, 9, .78) 0%,
    rgba(22, 14, 9, .42) 45%,
    rgba(22, 14, 9, .16) 100%
  );
  z-index: 1;
}

@media (max-width: 47.9375rem) {
  /* On mobile the text sits lower/centred — boost mid-gradient for legibility */
  .hero__overlay {
    background: linear-gradient(
      to top,
      rgba(22, 14, 9, .82) 0%,
      rgba(22, 14, 9, .52) 40%,
      rgba(22, 14, 9, .22) 100%
    );
  }
}

.hero__content {
  position: relative;
  z-index: 2;
  padding-block: calc( var(--tew-header-h, 64px) + 3rem ) 5rem;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
  max-width: 58rem;
  margin-inline: auto;
  text-align: center;
  width: 100%;
}

.hero__eyebrow {
  font-family: var(--tew-sans);
  font-size: var(--tew-eyebrow);
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .82);
  margin-bottom: 1.75rem;
}

.hero__headline {
  font-family: var(--tew-serif);
  font-size: var(--tew-h1);
  font-weight: 400;
  line-height: 1.06;
  color: #fff;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

.hero__sub {
  font-family: var(--tew-sans);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, .9);
  max-width: 34rem;
  margin-inline: auto;
  margin-bottom: 2rem;
  text-wrap: balance;
}

/* Scroll cue */
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 1.75rem;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: rgba(255, 255, 255, .85);
  text-decoration: none;
  animation: tew-bob 2.4s var(--tew-ease) infinite;
}
.hero__scroll:hover { color: #fff; }
@keyframes tew-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 6px); }
}

.hero__cta {
  display: inline-block;
  padding: .75rem 2rem;
  background-color: var(--tew-accent-ink);
  color: #fff;
  font-family: var(--tew-sans);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color .22s var(--tew-ease), border-color .22s var(--tew-ease), color .22s var(--tew-ease);
}

.hero__cta:hover {
  background-color: transparent;
  border-color: #fff;
  color: #fff;
}

/* --------------------------------------------------------------------------
   2. MANIFESTO
   -------------------------------------------------------------------------- */
.manifesto {
  padding-block: clamp(4rem, 9vw, 7rem);
  background-color: var(--tew-bg);
  text-align: center;
  border-bottom: 1px solid var(--tew-rule);
}

.manifesto__eyebrow {
  font-family: var(--tew-sans);
  font-size: var(--tew-eyebrow);
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--tew-sage);
  margin-bottom: 1.75rem;
}

.manifesto__line {
  font-family: var(--tew-serif);
  font-size: clamp(1.7rem, 4.4vw, 3rem);
  font-weight: 400;
  font-style: normal;
  line-height: 1.18;
  color: var(--tew-ink);
  max-width: 52rem;
  margin-inline: auto;
  /* Remove default blockquote indentation */
  quotes: none;
  margin-block: 0;
  padding-inline: 0;
  text-wrap: balance;
}

.manifesto__body {
  font-family: var(--tew-sans);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.7;
  color: var(--tew-muted);
  max-width: 40rem;
  margin: 2rem auto 0;
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   3–5. CATEGORY ROWS
   -------------------------------------------------------------------------- */
.section-row {
  padding-block: clamp(2.5rem, 5vw, 4.5rem);
  border-bottom: 1px solid var(--tew-rule);
}

.section-row__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin-bottom: 2rem;
}

.section-row__title {
  font-family: var(--tew-serif);
  font-size: var(--tew-h2);
  font-weight: 400;
  color: var(--tew-ink);
  margin: 0;
}

.view-all {
  font-family: var(--tew-sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--tew-muted);
  white-space: nowrap;
  transition: color .18s;
}

.view-all:hover {
  color: var(--tew-accent-ink);
}

/* .card-grid — canonical definition lives in main.css (shared across all templates). */

/* .story-card-cell / .story-card / .story-card__book / .scores / .score —
   canonical styles live in main.css (cards render on home, archives, and
   single-related, so they must be global). */

/* --------------------------------------------------------------------------
   6. SCORES EXPLAINER
   -------------------------------------------------------------------------- */
.scores-explainer {
  padding-block: clamp(3rem, 6vw, 5rem);
  background-color: var(--tew-bg);
  color: var(--tew-ink);
}

.scores-explainer__eyebrow {
  font-family: var(--tew-sans);
  font-size: var(--tew-eyebrow, .72rem);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--tew-accent-ink);
  text-align: center;
  margin: 0 0 1rem;
}

.scores-explainer__heading {
  font-family: var(--tew-serif);
  font-size: var(--tew-h2);
  font-weight: 400;
  color: var(--tew-ink);
  text-align: center;
  margin: 0 0 1.25rem;
  max-width: 100%;
}

.scores-explainer__intro {
  font-family: var(--tew-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--tew-muted);
  text-align: center;
  max-width: 36rem;
  margin: 0 auto clamp(2rem, 4vw, 3.5rem);
  text-wrap: pretty;
}

.scores-explainer__cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 48rem) {
  .scores-explainer__cols {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem 4rem;
    /* Optional hairline divider between columns */
    column-rule: 1px solid var(--tew-rule);
  }
}

.scores-explainer__col {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.scores-explainer__letter {
  font-family: var(--tew-serif);
  font-size: clamp(3rem, 6vw, 4.5rem);
  line-height: 1;
  display: block;
  margin-bottom: .5rem;
}

.scores-explainer__letter--design {
  color: var(--tew-accent);
}

.scores-explainer__letter--family {
  color: var(--tew-ink);
}

.scores-explainer__col-heading {
  font-family: var(--tew-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--tew-ink);
  margin: 0 0 1rem;
}

.scores-explainer__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.scores-explainer__list li {
  font-family: var(--tew-sans);
  font-size: .95rem;
  line-height: 1.55;
  color: var(--tew-ink);
  padding-block: .75rem;
  border-bottom: 1px solid var(--tew-rule, rgba(252, 246, 238, .14));
}

.scores-explainer__list li:first-child {
  border-top: 1px solid var(--tew-rule, rgba(252, 246, 238, .14));
}

.scores-explainer__warning {
  font-family: var(--tew-serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.55;
  color: var(--tew-ink);
  text-align: center;
  max-width: 34rem;
  margin: clamp(2.5rem, 4vw, 3rem) auto 0;
  padding: 0;
  border: none;
}

/* --------------------------------------------------------------------------
   7. ABOUT TEASER
   -------------------------------------------------------------------------- */
.about-teaser {
  padding-block: clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--tew-rule);
}

.about-teaser__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

/* Mobile: image stacks above text (natural source order: figure first, text second). */
/* Desktop: image left, text right — preserve source order, no order overrides needed. */
@media (min-width: 48rem) {
  .about-teaser__inner--has-image {
    grid-template-columns: 1fr 1fr;
    gap: 3rem 4rem;
  }
}

@media (min-width: 64rem) {
  .about-teaser__inner--has-image {
    grid-template-columns: 1fr .85fr;
    gap: 3rem 5rem;
  }
}

.about-teaser__label {
  font-family: var(--tew-sans);
  font-size: var(--tew-eyebrow, .72rem);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--tew-accent-ink);
  margin: 0;
}

.about-teaser__text {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.about-teaser__heading {
  font-family: var(--tew-serif);
  font-size: var(--tew-h2);
  font-weight: 400;
  color: var(--tew-ink);
  margin: 0;
  max-width: 100%;
}

.about-teaser__body {
  font-family: var(--tew-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--tew-muted);
}

.about-teaser__body p {
  max-width: var(--tew-read);
}

.about-teaser__cta {
  display: inline-block;
  font-family: var(--tew-sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--tew-sage);
  border-bottom: 1px solid var(--tew-sage);
  padding-bottom: .15rem;
  align-self: flex-start;
  transition: color .18s, border-color .18s;
}

.about-teaser__cta:hover {
  color: var(--tew-accent-ink);
  border-color: var(--tew-accent);
}

.about-teaser__media {
  margin: 0;
  overflow: hidden;
}

.about-teaser__img {
  width: 100%;
  height: 100%;
  display: block;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center;
}

/* --------------------------------------------------------------------------
   8. NEWSLETTER
   -------------------------------------------------------------------------- */
.newsletter-section {
  padding-block: clamp(3rem, 6vw, 5rem);
  background-color: var(--tew-bg);
  text-align: center;
}

.newsletter-section__heading {
  font-family: var(--tew-serif);
  font-size: var(--tew-h2);
  font-weight: 400;
  color: var(--tew-ink);
  margin-bottom: .75rem;
  max-width: 100%;
}

.newsletter-section__body {
  font-family: var(--tew-sans);
  font-size: 1rem;
  color: var(--tew-muted);
  margin-bottom: 2rem;
  max-width: 36rem;
  margin-inline: auto;
}

/* Inline form — stacks on mobile, row on ≥ 48rem */
.tew-newsletter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  max-width: 32rem;
  margin-inline: auto;
}

@media (min-width: 48rem) {
  .tew-newsletter {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 0;
  }

  /* flex-basis 0 (not the base width:100%) so input + button share one row */
  .tew-newsletter__input {
    width: auto;
    flex: 1 1 0%;
    min-width: 0;
    border-right: none;
    border-radius: 2px 0 0 2px;
  }

  .tew-newsletter__btn {
    flex: 0 0 auto;
    border-radius: 0 2px 2px 0;
  }

  /* status message always breaks to its own full-width line below the row */
  .tew-newsletter__msg {
    flex-basis: 100%;
  }
}

.tew-newsletter__input {
  width: 100%;
  padding: .75rem 1.1rem;
  font-family: var(--tew-sans);
  font-size: .9rem;
  color: var(--tew-ink);
  background-color: #fff;
  border: 1px solid var(--tew-rule);
  border-radius: 2px;
  transition: border-color .18s;
}

.tew-newsletter__input::placeholder {
  color: var(--tew-muted);
}

.tew-newsletter__input:focus {
  border-color: var(--tew-ink);
}

.tew-newsletter__btn {
  display: inline-block;
  padding: .75rem 1.6rem;
  background-color: var(--tew-accent-ink);
  color: #fff;
  font-family: var(--tew-sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid var(--tew-accent-ink);
  cursor: pointer;
  transition: background-color .18s, color .18s;
  white-space: nowrap;
}

.tew-newsletter__btn:hover {
  background-color: var(--tew-ink);
  border-color: var(--tew-ink);
}

.tew-newsletter__msg {
  width: 100%;
  font-family: var(--tew-sans);
  font-size: .85rem;
  text-align: center;
  color: var(--tew-sage);
  min-height: 1.4em;
  margin: 0;
  max-width: 100%;
}

.tew-newsletter__msg:empty {
  display: none;
}

.tew-newsletter__msg.is-error {
  color: var(--tew-accent-ink);
}

.tew-newsletter__msg.is-success {
  color: var(--tew-sage);
}

/* Server-rendered notice (no-JS fallback) — shown above the form. */
.tew-newsletter__msg--server {
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   9. Mobile-specific overrides  (< 48 rem / 768 px)
   -------------------------------------------------------------------------- */
@media (max-width: 47.9375rem) {
  /* Hero: ensure headline doesn't overflow narrow screens */
  .hero__headline {
    font-size: clamp(2rem, 9vw, 4.5rem);
    word-break: break-word;
  }

  /* Hero sub-text: slightly smaller on phone for readability */
  .hero__sub {
    font-size: clamp(.95rem, 4vw, 1.2rem);
  }

  /* Manifesto: tighter padding and slightly smaller quote on phone */
  .manifesto {
    padding-block: clamp(2.5rem, 7vw, 4rem);
  }

  .manifesto__line {
    font-size: clamp(1.4rem, 6vw, 3rem);
  }

  /* Section row: tighter vertical rhythm on phone */
  .section-row {
    padding-block: clamp(2rem, 5vw, 3rem);
  }

  /* Section row header: wrap title + "view all" cleanly */
  .section-row__head {
    align-items: flex-start;
    margin-bottom: 1.5rem;
  }

  /* Scores explainer: tighter padding */
  .scores-explainer {
    padding-block: clamp(2rem, 5vw, 3.5rem);
  }

  /* About teaser: tighten padding, ensure image doesn't dominate */
  .about-teaser {
    padding-block: clamp(2rem, 5vw, 3.5rem);
  }

  .about-teaser__img {
    /* Cap portrait image height on phone */
    aspect-ratio: 3 / 2;
    max-height: 55dvh;
  }

  /* Newsletter: tighten on phone */
  .newsletter-section {
    padding-block: clamp(2rem, 5vw, 3.5rem);
  }
}
