/*
 * Retreat landing — story expander module (item I6, build-tracker.md)
 *
 * Section 6, "11:47pm story" (patterns/retreat-story.php). Flat navy panel
 * (90:217 verified flat, NOT the grain band — decision-log #12/#15, LESSONS
 * note in the build brief) holding two mutually-exclusive content states:
 * collapsed (intro + CONTINUE READING) and expanded (frame 4:843's full
 * long-read + COLLAPSE SECTION). JS toggles `.is-hidden`/`.is-active`/
 * `.is-shown` (assets/js/expander.js) — no `hidden` attribute baked
 * into the static block markup (would fail editor validation the same way
 * hero.css's fetchpriority attempt did; see that file's note). Section
 * wrapper mirrors leave-with.css's container recipe exactly (max-width
 * 1216, padding-block var(--space-100), gutter steps at 1240/768).
 *
 * Review round 1 fixes: the expanded panel takes `tabindex="-1"` (set at
 * runtime by expander.js, not baked into block markup — same
 * editor-validation caution as above) so keyboard/AT focus lands inside it
 * on expand instead of dropping to <body> (display:none on the clicked
 * CONTINUE READING button resets activeElement); the focus ring is
 * suppressed for that programmatic focus below. Collapsed state's heading
 * is a styled `<p class="retreat-story__heading-p">`, not an `<h2>` (finding
 * #6, RULED — see pattern file docblock); it shares the H2's full type
 * recipe via a combined selector so it stays pixel-identical.
 *
 * White-on-navy treatment: since this panel IS genuinely flat navy (not the
 * grain-band exception), the token spec's "white text on navy at 82% for
 * body" rule applies — same `opacity: 0.82` recipe already used in
 * dev/style-proof.css. Headings/eyebrow stay full white (not dimmed).
 *
 * Belief-list bars (16:558, 4:1028): `::before`, not `wp:html` (S9 ruling,
 * LESSONS) — same recipe as who-for.css's note bar (absolute 4px pill,
 * var(--color-accent), var(--radius-pill)). Yellow-on-navy is the allowed
 * exception per the token spec's color-usage rules.
 *
 * h3 defensive counter (LESSONS): theme.json's h3 element style compiles to
 * `:root :where(h3)` and TIES (not loses to) a same-specificity class per
 * the S3/S10 finding — `.retreat-story__subheading` reasserts
 * lowercase/normal-tracking defensively, same fix applied there.
 */

.retreat-story {
  max-width: 1216px;
  margin: 0 auto;
  /* R2-4 fix (2026-08-16): standard inter-section rhythm — see
     sections/retreat/token-overrides.css's --retreat-section-pad header
     comment. `.retreat-story__panel` below is BAND-internal padding (the
     navy panel's own inset), untouched — not section rhythm. */
  padding-block: var(--retreat-section-pad);
  padding-inline: 0;
}

.retreat-story__panel {
  background: var(--color-retreat-navy);
  border-radius: var(--radius-story-panel, 35px); /* R1-2 fix (2026-08-15):
    was wrongly --radius-md (20px) — 90:217 is an exported SVG asset, not a
    native Figma rect, so it doesn't surface a Tailwind radius class; its raw
    SVG path (`M0 35C0 15.67...`) is an exact 35px rounded-rect. See
    token-overrides.css's --radius-story-panel header comment for the full
    evidence trail. Fallback covers the editor canvas (no .retreat-page
    ancestor there, S3 precedent) — R1 kickback round 1 nit #10: fallback
    was still 20px, disagreeing with the token's real 35px value; bands.css's
    --radius-band follows the fallback==token convention (`var(--radius-band,
    100px)`), this now matches it exactly instead of silently reverting to
    the pre-fix radius whenever the token is unavailable. */
  padding-block: var(--space-64);
  padding-inline: var(--space-80);
  color: var(--color-white);
}

/* ── Collapsed / expanded state containers ──
 * Default (no JS yet, first paint): collapsed visible, expanded hidden via
 * display:none — matches the comp's default state and avoids a flash of
 * both states stacked before expander.js runs.
 */
.retreat-story__state--expanded {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.retreat-story__state--expanded.is-active {
  display: block;
}

.retreat-story__state--expanded.is-active.is-shown {
  opacity: 1;
  transform: translateY(0);
}

.retreat-story__state--collapsed.is-hidden {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .retreat-story__state--expanded {
    transition: none;
  }
}

/* ── Eyebrow / headings ── */
.retreat-story__eyebrow {
  color: var(--color-white);
  margin: 0 0 var(--space-sm);
}

.retreat-story__heading,
.retreat-story__heading-p {
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  font-size: var(--font-3xl); /* 40 / 34@1024 / 28@768 via token-overrides.css */
  line-height: 1.15;
  margin: 0 0 var(--space-sm);
}

.retreat-story__subheading {
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  font-size: var(--font-xl); /* 22 / 20@768 via token-overrides.css */
  line-height: 1.2;
  margin: var(--space-2xl) 0 var(--space-sm);
  /* Defensive counter (LESSONS) — see file header. */
  text-transform: lowercase;
  letter-spacing: normal;
}

/* Green punctuation mark uses the shared .retreat-mark utility
   (sections/retreat/marks.css) — no per-section duplicate here. */

/* ── Body copy ── */
.retreat-story__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs); /* 16px, matches the comp's inter-paragraph margin */
  margin: 0 0 var(--space-sm);
}

.retreat-story__body p {
  font-family: var(--font-body);
  font-weight: var(--fw-regular);
  font-size: var(--font-md);
  color: var(--color-white);
  opacity: 0.82; /* comp rule: white body text on navy at 82% */
  margin: 0;
}

/* ── Belief-list pull-quotes (16:557/16:558, 4:1027/4:1028) ── */
.retreat-story__beliefs {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding-left: var(--space-sm);
  margin: 0 0 var(--space-sm);
}

.retreat-story__beliefs::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--space-4xs); /* 4px, exact comp match */
  background: var(--color-accent);
  border-radius: var(--radius-pill);
}

.retreat-story__beliefs p {
  font-family: var(--font-body);
  font-weight: var(--fw-regular);
  font-size: var(--font-md);
  color: var(--color-white);
  opacity: 0.82;
  margin: 0;
}

/* ── Toggle controls (90:221-224 CONTINUE READING / near 4:1019-1021
 * COLLAPSE SECTION) — outlined pill, explicitly NOT the navy CTA family
 * (brief instruction). Raw <button> elements (wp:html — needed for native
 * Enter/Space keyboard activation; core/button always renders an <a>).
 */
.retreat-story__toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  height: 52px;
  padding-inline: var(--space-sm);
  border: 2px solid var(--color-white);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  font-size: var(--font-sm); /* 15px */
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease;
}

.retreat-story__toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.retreat-story__toggle-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Programmatic focus target on expand (expander.js sets tabindex="-1" at
 * runtime, then calls .focus()) — suppress the default focus ring for this
 * script-driven, non-interactive focus move while keeping it for genuine
 * keyboard (:focus-visible) navigation elsewhere in the panel.
 */
[tabindex="-1"]:focus:not(:focus-visible) {
  outline: none;
}

.retreat-story__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.retreat-story__icon--plus {
  font-family: var(--font-heading);
  font-weight: var(--fw-regular);
  font-size: 30px;
}

.retreat-story__icon--collapse svg {
  display: block;
}

/* ── Responsive gutter (matches .retreat-hero__inner / .retreat-how /
 * .retreat-leave-with exactly — same left/right edge across every section).
 * Panel-internal padding needs no media queries here — --space-64/--space-80
 * already step down at 1024/768 in tokens.css.
 */
@media (max-width: 1240px) {
  .retreat-story {
    padding-inline: 24px;
  }
}

@media (max-width: 768px) {
  .retreat-story {
    padding-inline: var(--space-xs);
  }
}
