/* ==========================================================================
   De Facto IAS — homepage-only blocks
   hero (copy + CSE result creative + batches), results strip of year creatives.
   Requires tokens.css + base.css.
   ========================================================================== */

/* Hero ----------------------------------------------------------------- */
.hero { padding-block: var(--s-4) var(--section-pad); }

/* Mobile order: pitch (H1, lead, CTAs) → proof (2025 creative) → batches.
   Desktop: copy + batches stack in the left column; creative fills the right column. */
.hero__inner {
  display: grid;
  gap: var(--s-4);
  grid-template-areas:
    "copy"
    "media"
    "batches";
}
.hero__copy { grid-area: copy; display: grid; gap: var(--s-3); align-content: start; }
.hero__media { grid-area: media; }
.batches { grid-area: batches; }

.hero__kicker {
  font-family: var(--ff-display);
  font-size: var(--fs-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--c-red-text);
}
.hero__title { color: var(--c-slate); }
.hero__lead { color: var(--c-text-muted); max-width: 48ch; }

/* Result creative: caption → clickable image → CTA, all centred in the column */
.hero__media {
  --hero-img-max: 480px;
  display: grid;
  gap: var(--s-2);
  justify-items: center;
  text-align: center;
}
.hero__congrats {
  display: grid;
  gap: 2px;
  justify-items: center;
  color: var(--c-maroon);
}
.hero__congrats-word {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 1.75rem;
  line-height: 1.1;
}
.hero__congrats-sub {
  font-family: var(--ff-display);
  font-size: var(--fs-sm);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hero__congrats::after {
  content: "";
  width: 72px;
  height: 2px;
  margin-top: var(--s-1);
  background: linear-gradient(90deg, transparent, var(--c-gold), transparent);
}
.hero__creative {
  display: block;
  width: fit-content;
  max-width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--c-line);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--ease), transform var(--ease);
}
.hero__creative:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.hero__creative img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: var(--hero-img-max); /* ratio is preserved: both limits apply together */
}

@media (min-width: 640px) {
  .hero__media { --hero-img-max: 520px; }
}
@media (min-width: 960px) {
  .hero { padding-block: var(--s-6) var(--section-pad); }
  .hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr; /* spare height goes below the batches box, not between copy and batches */
    grid-template-areas:
      "copy media"
      "batches media";
    column-gap: var(--s-8);
    row-gap: var(--s-3);
    align-items: start;
  }
  .hero__media { --hero-img-max: 520px; align-self: center; }
}

/* Upcoming batches panel (dates come from data/site.json) ---------------- */
.batches {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--c-surface);
  border-left: 4px solid var(--c-red-text);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.batches__title {
  font-family: var(--ff-display);
  font-size: 1rem;
  color: var(--c-charcoal);
}
.batches__list {
  display: grid;
  gap: var(--s-1);
  margin: 0;
}
.batches__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s-2);
  align-items: baseline;
  font-size: var(--fs-base);
}
.batches__row dt { color: var(--c-text); }
.batches__row dd { margin: 0; font-weight: 700; color: var(--c-red-text); white-space: nowrap; }
.batches__note { color: var(--c-text-muted); font-size: var(--fs-sm); }

/* Results strip: year creatives at one fixed row height, natural widths ----- */
.strip-wrap {
  /* bleed to the viewport edge by exactly one gutter so a card can peek */
  margin-inline: calc(-1 * var(--gutter));
}
.strip {
  --strip-h: 300px;
  display: flex;
  align-items: stretch;
  gap: var(--s-2);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-inline: var(--gutter);
  padding-block: var(--s-1) var(--s-2);
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* the peeking card signals scrollability */
}
.strip::-webkit-scrollbar { display: none; }

/* Card width = row height × the image's own ratio (--w/--h set from data),
   capped at the visible width so a landscape creative never exceeds a phone screen. */
.year-card {
  flex: 0 0 auto;
  width: min(calc(var(--strip-h) * var(--w) / var(--h)), 100%);
  scroll-snap-align: start;
}
/* the last card snaps by its end edge, so the strip's final position is a valid snap point */
.year-card:last-child { scroll-snap-align: end; }
.year-card__link {
  display: grid;
  grid-template-rows: var(--strip-h) auto;
  gap: var(--s-2);
  justify-items: center;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
}
.year-card__media {
  width: 100%;
  height: var(--strip-h);
  display: grid;
  align-items: center; /* a shorter (capped landscape) image sits on the row's centre line */
}
.year-card__media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--ease), transform var(--ease);
}
.year-card__link:hover img,
.year-card__link:focus-visible img { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.year-card__label { font-family: var(--ff-display); font-size: var(--fs-h3); line-height: var(--lh-snug); }

/* Under the strip: arrows (wide screens only) + "See all results" */
.strip-foot {
  display: grid;
  justify-items: center;
  gap: var(--s-2);
  margin-top: var(--s-3);
}
.strip-controls { display: none; gap: var(--s-1); }
.strip-controls[hidden] { display: none; }

@media (min-width: 640px)  { .strip { --strip-h: 380px; } }
@media (min-width: 960px) {
  .strip { --strip-h: 420px; }
  .strip-foot { display: flex; align-items: center; justify-content: space-between; }
  .strip-controls { display: flex; }
  .strip-foot .link-more { margin-left: auto; }
}

/* Topper interviews strip (generated markup: pages/home/build_interviews.py) ------ */
/* Same tint band as "Our past Results": the interviews read as its second row */
.section--joined { padding-top: 0; }

.strip--video { align-items: stretch; }
.vcard {
  flex: 0 0 auto;
  width: min(300px, 84%);
  position: relative; /* contains the absolutely-positioned visually-hidden labels so they cannot widen the page */
  display: flex; /* the card inside fills the row height */
  scroll-snap-align: start;
}
.vcard:last-child { scroll-snap-align: end; }
.vcard__card { flex: 1 1 auto; padding: 0; gap: 0; overflow: hidden; }
.vcard__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--c-charcoal);
}
.vcard__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover; /* crops the black bars YouTube adds to its 4:3 thumbnails */
  transition: transform var(--ease);
}
.vcard__thumb:hover img { transform: scale(1.03); }
.vcard__thumb:focus-visible { outline-offset: -4px; }
.vcard__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--c-white);
  background: rgba(217, 43, 43, 0.92); /* --c-red-text */
  box-shadow: var(--shadow-float);
  transition: transform var(--ease);
}
.vcard__play svg { width: 26px; height: 26px; margin-left: 3px; }
.vcard__thumb:hover .vcard__play { transform: scale(1.08); }
.vcard__time {
  position: absolute;
  right: var(--s-1);
  bottom: var(--s-1);
  padding: 2px 6px;
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.3;
  color: var(--c-white);
  background: rgba(0, 0, 0, 0.78);
  border-radius: var(--radius-sm);
}
.vcard__player { position: relative; aspect-ratio: 16 / 9; background: #000; }
.vcard__player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vcard__body { display: grid; gap: var(--s-1); padding: var(--s-2) var(--s-2) 0; }
.vcard__meta { display: flex; flex-wrap: wrap; gap: var(--s-1); margin: 0; }
.vcard__name { font-size: var(--fs-h3); line-height: var(--lh-snug); color: var(--c-slate); }
.vcard__card .card__foot { justify-content: flex-start; padding: var(--s-2); }
.vcard__card:not(:has(.card__foot)) .vcard__body { padding-bottom: var(--s-2); }

@media (min-width: 640px) { .vcard { width: 320px; } }
@media (min-width: 960px) { .vcard { width: 340px; } }
.vcard .btn--sm { min-height: var(--tap-min); }

/* "Law Optional Topper" label: gold star + maroon text, the same accents as the hero creative.
   A thin gold top edge on the card repeats it without shouting. */
.vcard__card { border-top: 3px solid var(--c-gold); }
.vcard__kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-family: var(--ff-display);
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-maroon);
}
.vcard__kicker svg { flex: 0 0 auto; width: 16px; height: 16px; color: var(--c-gold); }

/* Latest from the blog: one card per subject (scripts/build_latest.py) */
.latest { list-style: none; padding: 0; }
.latest__card { padding: 0; overflow: hidden; gap: var(--s-1); }
.latest__media { display: block; aspect-ratio: 1200 / 630; background: var(--c-tint, #f3f1ec); }
.latest__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.latest__tag, .latest__card .card__title, .latest__card .card__body, .latest__card .card__foot { padding-inline: var(--s-3); }
.latest__tag { margin: var(--s-2) 0 0; font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.latest__tag a { color: var(--c-red, #c0392b); text-decoration: none; }
.latest__card .card__title a { color: inherit; text-decoration: none; }
.latest__card .card__title a:hover { text-decoration: underline; }
.latest__card .card__foot { padding-bottom: var(--s-3); color: var(--c-text-muted); font-size: var(--fs-sm); }
.latest__all { margin-top: var(--s-3); text-align: center; }

