/* ==========================================================================
   news-hero-carousel — iteration block
   --------------------------------------------------------------------------
   Dark editorial hero for the News & Media page. Four featured stories
   cross-fade automatically every 6 s; a segmented hairline rule at the
   bottom fills across the active slide so the timing is visible and each
   segment is clickable to jump.

   Port of teako-home/src/components/sections/NewsHeroCarousel.tsx, retuned
   into the Teako playground voice — diagonal topo texture, Geologica
   headline, Milano-Red tag + pill CTA, JetBrains-Mono kickers.
   PLAYGROUND MODE: raw values, no token snap.
   ========================================================================== */

.nhc {
  --nhc-bg:         #0b1018;
  --nhc-ink:        #f4f5f7;
  --nhc-dim:        rgba(244, 245, 247, 0.62);
  --nhc-faint:      rgba(244, 245, 247, 0.42);
  --nhc-rule:       rgba(244, 245, 247, 0.18);
  --nhc-rule-dim:   rgba(244, 245, 247, 0.10);
  --nhc-accent:     #C42800;

  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: 82vh;
  min-height: 560px;
  overflow: hidden;
  background: var(--nhc-bg);
  color: var(--nhc-ink);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Hero clip (2026-08-20) ---------- */
/* The default library clip runs continuously under the whole carousel, so the
   masthead is moving footage rather than a still. A featured release that
   carries its own clip renders one on its slide, layered over the base; a
   release without one simply lets the base clip show through. */

.nhc__base,
.nhc__slide-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.nhc__base {
  z-index: 0;
  /* Matches the ken-burns scale the stills sit at, so the two layers agree. */
  transform: scale(1.02);
}

/* ---------- Cross-fading slides (own clip / still) ---------- */

.nhc__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 800ms ease;
  /* Transparent by default — a slide with no clip of its own lets the base
     clip below carry the frame. Only a slide that renders media is opaque. */
  background-color: transparent;
  background-size: cover;
  background-position: center;
  /* Gentle ken-burns on the active slide — subtle, 8 s loop. */
  transform: scale(1);
  will-change: opacity, transform;
}
.nhc__slide--media { background-color: #0b141c; }
.nhc__slide.is-active {
  opacity: 1;
  animation: nhc-kenburns 8s ease-out forwards;
}
@keyframes nhc-kenburns {
  from { transform: scale(1.02); }
  to   { transform: scale(1.06); }
}

/* Scrim — darkens the bottom of the frame so the headline reads. */
.nhc__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(11, 16, 24, 0.30) 0%,
    rgba(11, 16, 24, 0.12) 38%,
    rgba(11, 16, 24, 0.92) 100%
  );
  z-index: 2;
}

/* Diagonal topo — ported from hero-scrollytelling, anchored top-left. */
.nhc__topo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: repeating-linear-gradient(
    45deg,
    #ffffff 0,
    #ffffff 1px,
    transparent 1px,
    transparent 16px
  );
  -webkit-mask-image: linear-gradient(135deg, #000 0%, transparent 60%);
  mask-image: linear-gradient(135deg, #000 0%, transparent 60%);
  z-index: 3;
}

/* ---------- Inner content stack ---------- */

.nhc__inner {
  position: relative;
  z-index: 4;
  height: 100%;
  width: 100%;
  max-width: var(--teako-page-max);
  margin: 0 auto;
}

/* (The "Featured" micro-label that used to sit at top-left is gone — client,
   2026-08-20. Its rule is retired with it; nothing else uses .nhc__kicker.) */

/* Foot — title block + progress, pinned to the bottom so the whole group
   (date, CTA and the progress bars) always stays in view and grows upward. */
.nhc__foot {
  position: absolute;
  left: var(--teako-page-gutter);
  right: var(--teako-page-gutter);
  bottom: 36px;
  max-width: 760px;
}

.nhc__body {
  max-width: 760px;
  /* JS removes + re-adds the .is-anim class on slide change so this fires
     once per slide. */
}
.nhc__body.is-anim {
  animation: nhc-body-in 540ms ease;
}
@keyframes nhc-body-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Release type — a real tag, not a line of coloured body text (client,
   2026-08-20: "make it feel like a bit of a tag because it's not visible
   enough"). Solid Milano red on the footage, white mono, sharp corners: it
   reads as a stamped label at hero distance, and pairs with the red CTA
   below so the accent appears twice on purpose rather than drifting. */
.nhc__tag {
  display: inline-block;
  padding: 7px 12px 6px;
  border-radius: 0;
  background: var(--nhc-accent);
  font-family: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  color: #fff;
}
/* A release with no type would otherwise paint an empty red block. */
.nhc__tag:empty,
.nhc__tag[hidden] { display: none; }
/* Long filed titles step down toward the article-page scale (single-news
   uses clamp(30,4vw,46)) so a 3-4 line headline never climbs into the nav.
   Class toggled by the carousel per slide (title > 72 chars). */
.nhc__title.is-long {
  font-size: clamp(26px, 3.1vw, 46px);
  line-height: 1.08;
}
.nhc__title {
  margin: 18px 0 18px;
  font-family: 'Geologica', 'IBM Plex Sans', system-ui, sans-serif;
  font-weight: 300;
  font-size: clamp(32px, 4.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.022em;
  color: var(--nhc-ink);
}
.nhc__date {
  display: inline-block;
  font-family: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--nhc-dim);
}

.nhc__cta-row {
  margin-top: 26px;
}
.nhc__cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  /* D2: one rectangular button system — radius 0 everywhere. */
  border-radius: 0;
  background: var(--nhc-accent);
  font-family: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  transition: background 200ms ease, transform 240ms cubic-bezier(0.33, 1, 0.68, 1);
}
/* D2: hover = one step darker on the Milano red, no lift. */
.nhc__cta:hover {
  background: #A62200;
}
.nhc__cta svg {
  width: 16px;
  height: 16px;
  transition: transform 240ms cubic-bezier(0.33, 1, 0.68, 1);
}
.nhc__cta:hover svg { transform: translateX(3px); }

/* ---------- Segmented progress ---------- */

.nhc__progress {
  display: flex;
  gap: 12px;
  margin-top: 38px;
}
.nhc__progress-seg {
  position: relative;
  flex: 1;
  height: 2px;
  padding: 0;
  border: 0;
  background: var(--nhc-rule-dim);
  overflow: hidden;
  cursor: pointer;
  appearance: none;
  transition: background 200ms ease;
}
.nhc__progress-seg:hover { background: var(--nhc-rule); }
.nhc__progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--nhc-ink);
}
.nhc__progress-fill.is-past { width: 100%; }
.nhc__progress-fill.is-active {
  animation: nhc-progress-grow linear forwards;
}
@keyframes nhc-progress-grow {
  from { width: 0; }
  to   { width: 100%; }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .nhc { height: 78vh; min-height: 520px; }
  .nhc__foot { left: 24px; right: 24px; bottom: 28px; }
  .nhc__tag { font-size: 10.5px; letter-spacing: 0.14em; padding: 6px 10px 5px; }
  .nhc__title { font-size: clamp(28px, 7vw, 44px); }
  .nhc__title.is-long { font-size: clamp(22px, 5.6vw, 32px); }
}
