/* =========================================================
   VIDEOS: Journal IA Haïti.
   videos.html: navy STAGE (square episode on a gold mount), the
   editorial READING SPREAD (rail labels), the closing-question band
   and the coming-episodes card. index.html: the feature TEASER.
   Loaded after site.css / home.css. Tokens from design-system.css.
   The video file is 576x576: the screen is 1:1 and never wider.
   ========================================================= */

/* Shared tracked-caps label (Montserrat 600). */
.vid-episode,
.vid-meta dt,
.vid-rail,
.vid-question-label,
.vid-teaser-chip {
  font: 600 var(--fs-label)/1.4 var(--font-sans);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

/* ---- Series mark: JOURNAL (tracked caps) + IA Haïti (serif italic) ---- */
.vid-masthead { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0 0 var(--s-4); }

.vid-mark { display: inline-flex; align-items: baseline; gap: 0.5em; white-space: nowrap; }

.vid-mark-word {
  font: 700 0.75rem/1 var(--font-sans);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}

.vid-mark-name { font: italic 400 1.5rem/1 var(--font-serif); color: var(--white); }

.vid-episode { color: rgba(255, 255, 255, 0.72); padding-left: 1rem; border-left: 1px solid var(--hairline-gold); }

/* On light surfaces (homepage teaser). */
.vid-masthead--light .vid-mark-word { color: var(--gold-ink); }
.vid-masthead--light .vid-mark-name { color: var(--navy-deep); }
.vid-masthead--light .vid-episode { color: var(--text-secondary); border-left-color: var(--gold-rule); }

/* ---- STAGE (videos.html): full-bleed navy band ---- */
.vid-stage {
  position: relative;
  isolation: isolate;
  color: rgba(255, 255, 255, 0.94);
  background:
    radial-gradient(55% 65% at 26% 50%, rgba(42, 82, 160, 0.3) 0%, transparent 70%),
    linear-gradient(180deg, var(--navy-900) 0%, var(--navy-deep) 100%);
  background:
    radial-gradient(55% 65% at 26% 50%, color-mix(in srgb, var(--navy-light) 30%, transparent) 0%, transparent 70%),
    linear-gradient(180deg, var(--navy-900) 0%, var(--navy-deep) 100%);
  padding: clamp(2.5rem, 6vw, 5.5rem) 0;
  border-bottom: 1px solid var(--hairline-gold);
}

/* Broadcast glass: hairline scanlines, barely there. */
.vid-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px);
}

.vid-stage :focus-visible { outline-color: var(--gold); }
/* Mobile first: title, then the square, then the metadata. */
.vid-stage-grid { display: grid; grid-template-areas: "head" "screen" "meta"; row-gap: var(--s-6); }

.vid-stage-head { grid-area: head; }
.vid-stage-meta { grid-area: meta; }
.vid-title {
  font: 600 clamp(2rem, 3.6vw, 3.25rem)/1.1 var(--font-serif);
  letter-spacing: -0.01em;
  color: var(--white);
  max-width: 17ch;
  margin: 0 0 var(--s-5);
}

.vid-standfirst {
  font: 400 var(--fs-lede)/1.6 var(--font-body);
  color: rgba(255, 255, 255, 0.78);
  max-width: 40ch;
  margin: 0;
}

/* The screen sits on a gold mount (8px out on phones, 12px from 600px);
   the container gutter keeps the frame and the focus ring on screen. */
.vid-screen {
  --mount: 8px;
  --tick: 12px;
  grid-area: screen;
  position: relative;
  width: 100%;
  max-width: 576px;
  margin: var(--mount) auto;
}
.vid-screen::before,
.vid-screen::after { content: ''; position: absolute; inset: calc(var(--mount) * -1); pointer-events: none; }
.vid-screen::before { border: 1px solid var(--hairline-gold); }
/* Brighter corner ticks on the mount. */
.vid-screen::after {
  --g: linear-gradient(var(--gold), var(--gold));
  --h: var(--tick) 1px no-repeat;
  --v: 1px var(--tick) no-repeat;
  background:
    var(--g) top left / var(--h), var(--g) top left / var(--v),
    var(--g) top right / var(--h), var(--g) top right / var(--v),
    var(--g) bottom left / var(--h), var(--g) bottom left / var(--v),
    var(--g) bottom right / var(--h), var(--g) bottom right / var(--v);
}
.vid-screen .site-video-el:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.vid-screen .site-video { margin: 0; }
.vid-screen .site-video-frame {
  aspect-ratio: 1 / 1;
  background: #000;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 18px 36px -18px rgba(0, 0, 0, 0.5),
    0 44px 90px -30px rgba(0, 0, 0, 0.7);
}

.vid-screen .site-video-el { object-fit: contain; background: #000; }
/* site.css sets display:block on the poster, which beats the UA [hidden]
   rule: keep the admin-slot poster hidden behind a hosted player. */
.vid-screen .site-video-poster[hidden] { display: none; }
/* Empty video_url fallback (poster + "coming soon"), kept presentable. */
.vid-screen .site-video-poster { max-width: none; border: 0; }
.vid-screen .site-video-soon { color: rgba(255, 255, 255, 0.72); padding-inline: var(--gutter); }

/* ---- Stage metadata + neutrality note ---- */
.vid-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4) var(--s-5);
  margin: 0;
  padding-top: var(--s-5);
  border-top: 1px solid var(--hairline-dark);
}

.vid-meta dt { font-size: 0.6875rem; line-height: 1.2; margin: 0 0 0.4rem; }
.vid-meta dd { margin: 0; font: 500 0.9375rem/1.4 var(--font-body); }
/* Colours: white on the stage, ink on light surfaces. Scoped so neither
   overrides the other by source order (the teaser meta is light). */
.vid-stage .vid-meta dt { color: rgba(255, 255, 255, 0.62); }
.vid-stage .vid-meta dd { color: rgba(255, 255, 255, 0.92); }
.vid-meta--light { border-top-color: var(--hairline); margin-top: var(--s-5); }
.vid-meta--light dt { color: var(--text-muted); }
.vid-meta--light dd { color: var(--navy-deep); }

.vid-neutral {
  margin: var(--s-5) 0 0;
  padding-left: var(--s-4);
  border-left: 2px solid var(--gold);
  font: italic 400 1.0625rem/1.6 var(--font-serif);
  color: rgba(255, 255, 255, 0.84);
  max-width: 46ch;
}

@media (min-width: 600px) {
  .vid-screen { --mount: 12px; --tick: 18px; }
  .vid-stage-grid { row-gap: var(--s-7); }
}

@media (min-width: 960px) {
  .vid-stage-grid {
    grid-template-columns: minmax(0, 576px) minmax(0, 1fr);
    grid-template-areas: "screen head" "screen meta";
    column-gap: clamp(3.5rem, 6vw, 6rem);
    row-gap: var(--s-6);
  }

  .vid-screen { align-self: center; margin: var(--mount) 0; }
  .vid-stage-head { align-self: end; }
  .vid-stage-meta { align-self: start; }
  .vid-meta { grid-template-columns: auto minmax(0, 1fr); column-gap: var(--s-7); }
}

/* ---- READING SPREAD: rail label | text column ---- */
.vid-read { background: var(--bg-base); padding: var(--section-y) 0; }

.vid-row { display: grid; gap: var(--s-4); padding: var(--s-7) 0; border-top: 1px solid var(--hairline); }

.vid-row:first-child { padding-top: 0; border-top: 0; }
.vid-row:last-child { padding-bottom: 0; }
.vid-rail {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  color: var(--gold-ink);
}

.vid-rail::before { content: ''; flex: none; width: 1.5rem; height: 1px; background: var(--gold-rule); }
.vid-row-body { max-width: 38rem; }
.vid-row-body .site-video-summary p,
.vid-sources,
.vid-next-desc,
.vid-finding-text {
  font: 400 1.125rem/1.75 var(--font-body);
  color: var(--text-secondary);
  margin: 0;
}

.vid-row-body .site-video-summary p + p { margin-top: 1em; } /* CMS paragraphs breathe */
/* Editorial drop cap on the summary. */
.vid-row-body .site-video-summary p:first-child::first-letter {
  float: left;
  font: 600 3.6em/0.85 var(--font-serif);
  padding: 0.08em 0.12em 0 0;
  color: var(--navy-deep);
}

@media (min-width: 960px) {
  /* Rail 12rem + a ~68ch column, the pair centred on the page. */
  .vid-read > .container { max-width: calc(54rem + 2 * var(--gutter)); }
  .vid-row { grid-template-columns: 12rem minmax(0, 38rem); column-gap: 4rem; }

  .vid-rail { align-self: start; padding-top: 0.45rem; }
}

/* Findings: three numbered actors. */
.vid-findings { list-style: none; margin: 0; padding: 0; counter-reset: vid-finding; }

.vid-finding {
  counter-increment: vid-finding;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  column-gap: var(--s-4);
  padding: var(--s-5) 0;
  border-top: 1px solid var(--hairline);
}

.vid-finding:first-child { padding-top: 0; border-top: 0; }
.vid-finding:last-child { padding-bottom: 0; }
.vid-finding::before {
  content: counter(vid-finding);
  grid-row: 1 / span 2;
  font: italic 400 clamp(2rem, 3vw, 2.5rem)/0.9 var(--font-serif);
  color: var(--gold-ink);
}

.vid-finding-name {
  margin: 0 0 var(--s-2);
  font: 600 var(--fs-h3)/var(--lh-h3) var(--font-serif);
  letter-spacing: 0;
  color: var(--navy-deep);
}

/* ---- The closing question (not a quotation: no marks, no byline) ---- */
.vid-question-band {
  background: var(--bg-subtle);
  border-block: 1px solid var(--hairline);
  padding: var(--section-y) 0;
  text-align: center;
}

.vid-question-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0 0 var(--s-5);
  color: var(--gold-ink);
}

.vid-question-label::before,
.vid-question-label::after { content: ''; flex: none; width: 2.5rem; height: 1px; background: var(--gold-rule); }
.vid-question {
  max-width: 26em;
  margin: 0 auto;
  font: italic 400 clamp(1.5rem, 3vw, 2.25rem)/1.35 var(--font-serif);
  color: var(--navy-deep);
  text-wrap: balance;
}

/* ---- Coming episodes: one quiet card, never an empty grid ---- */
.vid-next {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: var(--s-5);
  align-items: start;
  padding: var(--s-5);
  background: var(--bg-subtle);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-ui);
}

.vid-next-tile {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  background:
    radial-gradient(80% 80% at 30% 35%, rgba(42, 82, 160, 0.35) 0%, transparent 70%),
    var(--navy-900);
  background:
    radial-gradient(80% 80% at 30% 35%, color-mix(in srgb, var(--navy-light) 35%, transparent) 0%, transparent 70%),
    var(--navy-900);
  outline: 1px solid var(--hairline-gold);
  outline-offset: -6px;
}

.vid-mark--stacked { flex-direction: column; align-items: center; gap: 0.4rem; }
.vid-mark--stacked .vid-mark-word { font-size: 0.5rem; letter-spacing: 0.28em; margin-right: -0.28em; }
.vid-mark--stacked .vid-mark-name { font-size: 1rem; }
.vid-next-status {
  margin: var(--s-2) 0 0;
  font: italic 400 1.0625rem/1.5 var(--font-serif);
  color: var(--navy-deep);
}

@media (min-width: 600px) {
  .vid-next { grid-template-columns: 7.5rem minmax(0, 1fr); align-items: center; }
  .vid-mark--stacked .vid-mark-name { font-size: 1.25rem; }
}

/* ---- HOMEPAGE TEASER (index.html): framed poster + episode copy.
        One link, stretched over the whole feature. ---- */
.vid-teaser-section { padding: var(--section-y) 0; }
.vid-teaser { position: relative; display: grid; gap: var(--s-6); max-width: 420px; margin-inline: auto; }

.vid-teaser-cover {
  position: relative;
  padding: 14px;
  background: var(--navy-900);
  box-shadow: 0 10px 24px -14px rgba(10, 24, 48, 0.35),
    0 30px 60px -30px rgba(10, 24, 48, 0.55);
  box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--navy-900) 35%, transparent),
    0 30px 60px -30px color-mix(in srgb, var(--navy-900) 55%, transparent);
}

.vid-teaser-cover::before { content: ''; position: absolute; inset: 6px; border: 1px solid var(--hairline-gold); pointer-events: none; }

.vid-teaser-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.vid-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 50%;
  background: rgba(10, 24, 48, 0.62);
  background: color-mix(in srgb, var(--navy-900) 62%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: transform 0.35s cubic-bezier(.22, .61, .36, 1), background-color 0.35s ease, border-color 0.35s ease;
}

/* The triangle, nudged 2px right for optical centring. */
.vid-play::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -11px 0 0 -7px;
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent var(--white);
  transition: border-color 0.35s ease;
}

.vid-teaser-chip {
  position: absolute;
  left: 26px;
  bottom: 26px;
  padding: 0.35rem 0.6rem;
  background: rgba(10, 24, 48, 0.82);
  background: color-mix(in srgb, var(--navy-900) 82%, transparent);
  color: var(--white);
  font-size: 0.6875rem;
  line-height: 1;
}

.vid-teaser-title {
  margin: 0 0 var(--s-4);
  font: 600 clamp(1.75rem, 3.2vw, 2.75rem)/1.12 var(--font-serif);
  color: var(--navy-deep);
}

.vid-teaser-text {
  margin: 0;
  max-width: 46ch;
  font: 400 1.125rem/1.7 var(--font-body);
  color: var(--text-secondary);
}

.vid-teaser-cta { margin: var(--s-5) 0 0; }
.vid-teaser-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  font: 600 0.8125rem/1.2 var(--font-sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy-deep);
  text-decoration: underline 1px var(--gold-rule);
  text-underline-offset: 0.55em;
}

/* Arrow (decorative, empty alt text) after the label. */
.vid-teaser-link::before {
  content: '\2192' / '';
  order: 2;
  font-size: 1.1em;
  letter-spacing: 0;
  transition: transform 0.35s cubic-bezier(.22, .61, .36, 1);
}

/* Stretched link: poster and copy are one target, one tab stop. */
.vid-teaser-link::after { content: ''; position: absolute; inset: 0; z-index: 2; }
.vid-teaser-link:focus-visible { outline: none; }
.vid-teaser-link:focus-visible::after { outline: 2px solid var(--navy-deep); outline-offset: 8px; }
.vid-teaser:hover .vid-play,
.vid-teaser:focus-within .vid-play {
  transform: scale(1.08);
  background-color: var(--gold);
  border-color: var(--gold);
}

.vid-teaser:hover .vid-play::before,
.vid-teaser:focus-within .vid-play::before { border-left-color: var(--navy-900); }
.vid-teaser:hover .vid-teaser-link::before,
.vid-teaser:focus-within .vid-teaser-link::before { transform: translateX(4px); }
.vid-teaser:hover .vid-teaser-link { text-decoration-color: var(--navy-deep); }

@media (min-width: 800px) {
  .vid-teaser {
    max-width: none;
    grid-template-columns: minmax(0, 460px) minmax(0, 540px);
    justify-content: center;
    column-gap: clamp(3rem, 7vw, 6rem);
    align-items: center;
  }
}

/* ---- Motion safety ---- */
@media (prefers-reduced-motion: reduce) {
  .vid-play,
  .vid-play::before,
  .vid-teaser-link::before { transition: none; }
  .vid-teaser:hover .vid-play,
  .vid-teaser:focus-within .vid-play,
  .vid-teaser:hover .vid-teaser-link::before,
  .vid-teaser:focus-within .vid-teaser-link::before { transform: none; }
}
