/* Lived experience stories: the video player, the card placed in section
   pages ({% story %}) and the story page (layouts/story.njk).
   Rules are two classes deep so they win over `.simple-article p` and friends
   on section pages. Colours follow the section on section pages
   (--section-color-dark) and the brand purple elsewhere. */

.story-player, .story-card { --story-accent: var(--section-color-dark, var(--color-primary)); }

/* ── Player: our own still + Play button until someone presses play ───── */
.story-player .story-play { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 0.75rem; overflow: hidden; cursor: pointer; background: #1f1424; }
.story-player .story-play:focus-visible { outline: 3px solid var(--story-accent); outline-offset: 3px; }
.story-player .story-still { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border-radius: 0; object-fit: cover; transition: transform 0.3s ease; }
.story-player .story-play:hover .story-still { transform: scale(1.02); }
.story-player .story-play-btn { position: absolute; left: 0.75rem; bottom: 0.75rem; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.5rem 0.9rem 0.5rem 0.75rem; border-radius: 999px; background: var(--story-accent); color: white; font-size: 0.95rem; font-weight: 700; line-height: 1.2; box-shadow: 0 6px 18px rgba(30, 20, 30, 0.3); transition: transform 0.15s ease; }
.story-player .story-play:hover .story-play-btn { transform: scale(1.04); }
.story-player .story-play-time { padding-left: 0.45rem; border-left: 1px solid rgba(255, 255, 255, 0.45); font-weight: 500; font-variant-numeric: tabular-nums; }
.story-player .story-iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 0.75rem; background: #000; }
.story-player.story-player .story-privacy { margin: 0.4rem 0 0; font-size: 0.8rem; line-height: 1.4; color: var(--color-text-tertiary, #6b7280); }
.story-player.is-playing .story-privacy { display: none; }

/* ── Card in a section page ─────────────────────────────────────────── */
.story-card { display: grid; gap: 1.25rem; margin: 2.5rem 0; padding: 1.25rem; border: 1px solid color-mix(in srgb, var(--story-accent) 18%, white); border-radius: 1rem; background: linear-gradient(135deg, #fefbff, #faf5ff); scroll-margin-top: 6rem; }
.story-card .story-card-body { display: flex; flex-direction: column; gap: 0.6rem; }
/* Doubled class: beats .simple-article p, which comes later in the page. */
.story-card.story-card p { margin: 0; }
.story-card .story-note strong { color: inherit; font-weight: 700; }
.story-card .story-eyebrow { display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; line-height: 1.4; text-transform: uppercase; color: var(--story-accent); }
.story-card .story-title { font-size: 1.25rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; color: var(--color-text-primary, #1f2937); }
.story-card .story-quote { margin: 0; padding: 0; border: 0; background: none; }
.story-card .story-quote p { font-size: 1.05rem; line-height: 1.55; font-style: italic; font-weight: 400; color: #374151; }
.story-card .story-person { font-size: 0.9rem; font-weight: 600; line-height: 1.4; color: var(--color-text-secondary, #4b5563); }
.story-card .story-summary { font-size: 0.95rem; line-height: 1.55; color: var(--color-text-secondary, #4b5563); }
.story-card .story-note { padding: 0.5rem 0.75rem; border-radius: 0.5rem; background: #fdf8ec; color: #5a4214; font-size: 0.875rem; line-height: 1.5; }
.story-card .story-card-foot { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem 1.5rem; padding-top: 0.75rem; border-top: 1px solid var(--color-border-light, #e5e7eb); }
.story-card .story-transcript { flex: 1 1 100%; order: 2; }
.story-card .story-transcript summary { width: fit-content; cursor: pointer; border-radius: 0.25rem; font-size: 0.95rem; font-weight: 600; color: var(--story-accent); }
.story-card .story-transcript summary:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.story-card .story-transcript-body { margin-top: 0.75rem; max-height: 18rem; overflow-y: auto; padding-right: 0.5rem; font-size: 0.95rem; line-height: 1.65; color: #374151; }
.story-card .story-transcript-body p + p { margin-top: 0.75rem; }
.story-card .story-more { order: 1; font-size: 0.95rem; font-weight: 600; color: var(--story-accent); text-decoration: underline; text-underline-offset: 3px; }
.story-card .story-more:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 0.25rem; }
@media (min-width: 640px) {
  .story-card { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 1.5rem; padding: 1.5rem; }
  .story-card .story-card-foot { grid-column: 1 / -1; }
  /* Playing: the video takes the card's full width, details move below */
  .story-card.is-playing .story-card-media,
  .story-card.is-playing .story-card-body { grid-column: 1 / -1; }
}

/* "On this page" index: a story listed under the heading it sits in */
.snav-story-item { list-style: none; }
.snav-story-item::before { display: none !important; }
.snav-story { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0.15rem 0 0.15rem 0.75rem; padding: 0.2rem 0.6rem 0.2rem 0.45rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; line-height: 1.3; text-decoration: none; color: color-mix(in srgb, var(--section-color-dark, var(--color-primary)) 75%, black); background: color-mix(in srgb, var(--section-color-dark, var(--color-primary)) 7%, white); }
.snav-story:hover { background: color-mix(in srgb, var(--section-color-dark, var(--color-primary)) 18%, white); }
.snav-story:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.snav-story-time { font-weight: 500; }

/* ── Story page ─────────────────────────────────────────────────────── */
.sp-hero { padding: 2rem 1rem 7rem; background: linear-gradient(160deg, #EAE0F6 0%, var(--color-primary-light) 55%, #F3ECFA 100%); border-bottom: 1px solid var(--color-border-light); }
.sp-hero-inner { max-width: 48rem; margin: 0 auto; }
.sp-crumbs ol { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 2rem; padding: 0; list-style: none; font-size: 0.9rem; color: var(--color-primary-dark); }
.sp-crumbs li + li::before { content: "›"; margin-right: 0.35rem; opacity: 0.6; }
.sp-crumbs a { color: var(--color-primary-dark); text-decoration: underline; text-underline-offset: 3px; }
.sp-accent-rule { width: 64px; height: 5px; margin-bottom: 1.1rem; border-radius: 3px; background: var(--color-primary); }
.sp-eyebrow { margin: 0 0 0.6rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--color-primary); }
.sp-title { margin: 0 0 0.5rem; font-size: clamp(2rem, 4.5vw, 2.75rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; color: var(--color-primary-dark); }
.sp-person { margin: 0 0 1rem; font-size: 1.05rem; font-weight: 600; color: var(--color-primary-dark); }
.sp-lead { max-width: 52ch; margin: 0 0 1.25rem; font-size: 1.15rem; line-height: 1.55; color: var(--color-primary-dark); }
.sp-note { display: flex; align-items: flex-start; gap: 0.6rem; max-width: 52ch; margin: 0; padding: 0.75rem 1rem; border-radius: 0.75rem; background: rgba(255, 255, 255, 0.75); color: #5a4214; font-size: 0.95rem; line-height: 1.5; }
.sp-note svg { flex-shrink: 0; margin-top: 0.1rem; color: #a16207; }

/* The video overlaps the bottom of the hero band */
.sp-video-wrap { position: relative; max-width: 56rem; margin: -5.5rem auto 0; padding: 0 1rem; }
.sp-video-wrap .story-player { --story-accent: var(--color-primary); }
.sp-video-wrap .story-play, .sp-video-wrap .story-iframe { border-radius: 1rem; box-shadow: 0 18px 40px rgba(60, 30, 90, 0.18); }
@media (min-width: 640px) {
  .sp-video-wrap .story-play-btn { left: 1rem; bottom: 1rem; padding: 0.65rem 1.1rem 0.65rem 0.9rem; font-size: 1.05rem; }
}

.sp-main { max-width: 48rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; color: #374151; font-size: 1.125rem; line-height: 1.75; }
.sp-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin: 0; font-size: 0.9rem; color: var(--color-text-secondary); }
.sp-meta span + span::before { content: "·"; margin-right: 1.25rem; opacity: 0.6; }
.sp-quote { margin: 2.5rem 0; padding: 1.5rem 1.75rem; border-left: 4px solid var(--color-primary); border-radius: 0 0.75rem 0.75rem 0; background: #faf5ff; }
.sp-quote p { margin: 0; font-size: 1.35rem; font-style: italic; font-weight: 500; line-height: 1.45; color: var(--color-primary-dark); }
.sp-quote footer { margin-top: 0.75rem; font-size: 0.95rem; font-weight: 600; color: var(--color-text-secondary); }
.sp-quote footer::before { content: "— "; }

.sp-share { margin: 0 0 1rem; padding: 1rem 1.25rem; border: 1px solid var(--color-border-light); border-radius: 0.75rem; }
.sp-share-title { margin: 0 0 0.5rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; line-height: 1.4; text-transform: uppercase; color: var(--color-text-secondary); }
.sp-share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.sp-share-link { font-size: 1.05rem; font-weight: 600; color: var(--color-primary-dark); background: none; }
.sp-btn { padding: 0.45rem 0.9rem; border: 1px solid var(--color-primary); border-radius: 0.5rem; background: white; color: var(--color-primary-dark); font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.sp-btn:hover { background: #faf5ff; }
.sp-copy-status { font-size: 0.9rem; color: var(--color-text-secondary); }
.sp-btn:focus-visible, .sp-next-card:focus-visible, .sp-crumbs a:focus-visible, .sp-talk a:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }

/* Same chapter-break look as the H2s on section pages */
.sp-h2 { margin: 3rem 0 1.5rem; padding-top: 2rem; border-top: 1.5px solid color-mix(in srgb, var(--color-primary) 25%, transparent); font-size: 2rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.03em; color: var(--color-primary); }
.sp-transcript p { margin: 0 0 1.25rem; }

.sp-next { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .sp-next { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sp-next-card { display: flex; flex-direction: column; gap: 0.4rem; height: 100%; padding: 1.25rem; border: 1px solid var(--color-border-light); border-radius: 0.75rem; background: white; text-decoration: none; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.sp-next-card:hover { border-color: color-mix(in srgb, var(--color-primary) 40%, white); box-shadow: 0 4px 12px rgba(60, 30, 90, 0.08); }
.sp-next-title { font-size: 1.05rem; font-weight: 700; line-height: 1.3; color: var(--color-primary-dark); }
.sp-next-text { font-size: 0.95rem; line-height: 1.5; color: var(--color-text-secondary); }
.sp-next-where { margin-top: auto; padding-top: 0.5rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-primary); }
.sp-talk { margin: 2rem 0 0; padding: 1rem 1.25rem; border-radius: 0.75rem; background: #faf5ff; font-size: 1rem; line-height: 1.6; }
.sp-talk a { font-weight: 700; color: var(--color-primary-dark); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .story-player .story-still, .story-player .story-play-btn, .sp-next-card { transition: none; }
  .story-player .story-play:hover .story-still, .story-player .story-play:hover .story-play-btn { transform: none; }
}

@media print {
  .story-player, .sp-share { display: none; }
  .sp-hero { padding-bottom: 2rem; }
  .sp-video-wrap { margin-top: 0; }
  .story-card .story-transcript-body { max-height: none; overflow: visible; }
}
