/* ---------------------------------------------------------------------
   NS-MORNING-REEL-PRD-001 §6.4 — the morning reel.

   Prefix `.nsh-`. It is free: the R22 night rail and Refine own the two
   neighbouring prefixes, and a third reader of either would be a bug
   that only shows up on somebody else's screen.

   Two rules carry weight here:

     · `.nsh-stage` is a CONTAINING BLOCK with a real box — position
       relative, an aspect ratio and a min-height (the `.nsc-stage`
       shape). `.nsf-canvas` inside it is `position:absolute; inset:0`,
       and three.js sizes its drawing buffer from the container: a stage
       with no height mounts a 1×1 canvas that never recovers.
     · progress rides `--p`, a CSS custom property JS writes per frame.
       No keyframe rule is ever injected from JSX (A8.22) — an injected
       rule outlives the component that wrote it.
   --------------------------------------------------------------------- */

.nsh-reel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  flex: 1;
}

/* The stage lives in the still's slot, so it inherits that frame's
   ground and border; it brings only its own box. */
.nsh-stage-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  outline: none;
}
.nsh-stage-wrap:focus-visible { box-shadow: inset 0 0 0 1px rgba(242, 166, 90, 0.55); }

.nsh-stage {
  position: relative;
  flex: 1 1 auto;
  aspect-ratio: 16 / 9;
  min-height: 320px;
  width: 100%;
}
@media (max-height: 820px) { .nsh-stage { min-height: 240px; } }

/* ── caption card ───────────────────────────────────────────────── */

.nsh-caption {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: linear-gradient(to top, rgba(4, 6, 10, 0.92), rgba(4, 6, 10, 0.72));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.nsh-stage-wrap .nsh-caption { position: relative; z-index: 2; }

.nsh-cap-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.nsh-cap-title {
  font-family: var(--nsf-mono, ui-monospace, monospace);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #fff;
}
.nsh-cap-note {
  font-family: var(--nsf-mono, ui-monospace, monospace);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #E0B450;
  border: 1px solid rgba(224, 180, 80, 0.4);
  border-radius: 2px;
  padding: 1px 5px;
}
.nsh-cap-line {
  font-family: var(--nsf-mono, ui-monospace, monospace);
  font-size: 11px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  word-break: break-word;
}
button.nsh-cap-line {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.22);
  text-underline-offset: 3px;
}
button.nsh-cap-line:hover { color: #fff; text-decoration-color: rgba(255, 255, 255, 0.6); }

/* The SUA's own sentence, and the role the lane was handed. It is the
   one row that hides completely when the record has nothing to say —
   an empty "why:" label would imply the reason was withheld. */
.nsh-cap-why {
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.52);
  font-style: italic;
  border-left: 2px solid rgba(242, 166, 90, 0.45);
  padding-left: 8px;
}

.nsh-cap-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.nsh-fact {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--nsf-mono, ui-monospace, monospace);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  padding: 2px 6px;
}
.nsh-fact b { color: #fff; font-size: 11px; font-weight: 700; }
button.nsh-fact-btn { cursor: pointer; text-transform: none; letter-spacing: 0.02em; }
button.nsh-fact-btn:hover { color: #fff; border-color: rgba(255, 255, 255, 0.2); }

/* ── progress bars ──────────────────────────────────────────────── */

.nsh-bars {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  gap: 3px;
  padding: 6px 8px;
}
.nsh-bar {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 1px;
  overflow: hidden;
}
.nsh-bar.done { background: rgba(242, 166, 90, 0.55); }
/* --p is written from JS each frame. No transition: at 60 fps a
   transition fights the value it is chasing, and under a starved rAF
   (headless, --virtual-time-budget) it freezes at its start value and
   makes the bar lie about where the reel is. */
.nsh-bar-fill {
  height: 100%;
  width: calc(var(--p, 0) * 100%);
  background: #F2A65A;
}

/* ── transport ──────────────────────────────────────────────────── */

.nsh-transport {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nsh-spacer { flex: 1 1 auto; }
.nsh-btn {
  font-family: var(--nsf-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  padding: 6px 10px;
  cursor: pointer;
}
.nsh-btn:hover:not(:disabled) { color: #fff; background: rgba(255, 255, 255, 0.12); }
.nsh-btn:disabled { opacity: 0.35; cursor: default; }
.nsh-btn-play { color: #fff; border-color: rgba(242, 166, 90, 0.5); background: rgba(242, 166, 90, 0.16); }
.nsh-btn-x { margin-left: 2px; }
.nsh-count,
.nsh-total {
  font-family: var(--nsf-mono, ui-monospace, monospace);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}
.nsh-rates { display: inline-flex; gap: 2px; }
.nsh-rate {
  font-family: var(--nsf-mono, ui-monospace, monospace);
  font-size: 9px;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  padding: 4px 7px;
  cursor: pointer;
}
.nsh-rate.active { color: #000; background: #F2A65A; border-color: #F2A65A; }

.nsh-note {
  font-family: var(--nsf-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.42);
  padding: 10px 2px;
}

/* ── the poster strip ───────────────────────────────────────────── */

.nsh-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.nsh-poster {
  flex: 0 0 auto;
  width: 116px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.nsh-poster:hover { opacity: 0.9; }
.nsh-poster.active { opacity: 1; border-color: rgba(242, 166, 90, 0.65); }
.nsh-poster-art { display: block; line-height: 0; }
.nsh-poster-art svg { display: block; width: 100%; height: auto; }
.nsh-poster-cap {
  display: block;
  font-family: var(--nsf-mono, ui-monospace, monospace);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  padding: 4px 5px 5px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nsh-poster.active .nsh-poster-cap { color: #fff; }

/* Reduced motion: the strip is the player. Nothing here animates in the
   first place — the transitions above are hover affordances, and the
   global rule collapses them like every other one. */
@media (prefers-reduced-motion: reduce) {
  .nsh-poster { transition: none; }
}

/* ── the Morning slot ───────────────────────────────────────────────
   The reel takes over `.nsf-still-canvas` — the box the immersive still
   already occupies. It inherits that frame's gradient ground and border
   and brings only a column layout, so switching between the still and
   the reel does not move anything around it. */
.nsf-still-frame .nsh-reel { flex: 1; min-height: 0; }
/* The still keeps its own box; the stage takes that box's place, so
   nothing around it moves when the reel starts. */
.nsf-still-frame .nsh-reel > .nsf-still-canvas { margin: 0 0 4px; }
.nsf-still-frame .nsh-stage-wrap { margin-bottom: 4px; }
