/* ===========================================================================
   SURVEILLANCE PAGE — per [[Surveillance Page Plan]] and D-019.
   Two sections: Broadcast Footage (surveillance stills) + Field Cables
   (intercepted communications / telegram rows).
   Depends on tokens.css + page.css (shared interior hero variant + section-label).
   =========================================================================== */

/* --- BROADCAST FOOTAGE ---------------------------------------------------- */

.broadcast-section {
  position: relative;
  z-index: 4;
  padding: 120px 56px 60px calc(var(--nav-strip-width) + 56px);
  max-width: var(--content-max);
  margin: 0 auto;
}

.broadcast-section__head { margin-bottom: 56px; }

.broadcast-stack {
  display: flex;
  flex-direction: column;
  gap: 96px;
}

.broadcast-file {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* The 4:3 still container ---------------------------------------------- */
.broadcast-file__still {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--bomb-iron);
  background: var(--bomb-charcoal);
  overflow: hidden;
  cursor: pointer;
}

.broadcast-file__still:focus-visible {
  outline: 2px solid var(--bomb-visor);
  outline-offset: 4px;
}

/* Top-left "// FILE NN" corner marker, breaking the still border line */
.broadcast-file__marker {
  position: absolute;
  top: -7px;
  left: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--bomb-bone);
  background: var(--bomb-black);
  padding: 2px 8px;
  text-transform: uppercase;
  z-index: 3;
}

/* 2x2 surveillance grid: four hand-selected stills per broadcast file.
   Hairline gaps reveal the iron-colored background as dividers. */
.broadcast-file__grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  background: var(--bomb-iron);
}

.broadcast-file__cell {
  position: relative;
  overflow: hidden;
  background: var(--bomb-charcoal);
}

.broadcast-file__cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.72) brightness(0.78) contrast(1.12) saturate(0.6);
  transition: filter 0.4s ease;
}

.broadcast-file__still:hover .broadcast-file__cell img {
  filter: grayscale(0.5) brightness(0.92) contrast(1.1) saturate(0.78);
}

/* Per-cell timestamp burn-in, lower-left of each cell */
.broadcast-file__cell-timestamp {
  position: absolute;
  bottom: 8px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--bomb-led-glow);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  z-index: 2;
  pointer-events: none;
}

/* Active state: iframe replaces the entire grid in place */
.broadcast-file__still.is-active { cursor: default; }
.broadcast-file__still.is-active .broadcast-file__grid {
  display: none;
}

.broadcast-file__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Metadata column ----------------------------------------------------- */
.broadcast-file__metadata {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 6px;
}

.broadcast-file__meta-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bomb-iron);
  align-items: baseline;
}

.broadcast-file__meta-row:last-of-type { border-bottom: none; }

.broadcast-file__meta-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--bomb-ash);
  text-transform: uppercase;
}

.broadcast-file__meta-value {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  color: var(--bomb-fog);
  letter-spacing: 0.01em;
}

.broadcast-file__meta-value--mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.broadcast-file__meta-value--amber {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--bomb-amber);
  text-transform: uppercase;
}

/* The bracketed [ INITIATE PLAYBACK ] affordance ---------------------- */
.broadcast-file__initiate {
  margin-top: 14px;
  font-family: var(--font-accent);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--bomb-bone);
  text-transform: uppercase;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  transition: color 0.25s ease;
}

.broadcast-file__initiate:hover { color: var(--bomb-visor); }
.broadcast-file__initiate:focus-visible {
  outline: 1px solid var(--bomb-visor);
  outline-offset: 4px;
}

.broadcast-file__still.is-active ~ .broadcast-file__metadata .broadcast-file__initiate {
  color: var(--bomb-amber);
}

/* --- FIELD CABLES --------------------------------------------------------- */

.field-cables-section {
  position: relative;
  z-index: 4;
  padding: 60px 56px 120px calc(var(--nav-strip-width) + 56px);
  max-width: var(--content-max);
  margin: 0 auto;
}

.field-cables-section__head { margin-bottom: 28px; }

.field-cables-section__lede {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.7;
  color: var(--bomb-bone);
  max-width: 64ch;
  margin-bottom: 36px;
}

.field-cables-section__lede strong {
  color: var(--bomb-fog);
  font-weight: 500;
}

.field-cables-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--bomb-iron);
}

.field-cable {
  border-bottom: 1px solid var(--bomb-iron);
}

.field-cable__btn {
  display: grid;
  grid-template-columns: 88px 140px 200px 130px 1fr;
  align-items: center;
  gap: 28px;
  width: 100%;
  padding: 22px 14px 22px 18px;
  background: transparent;
  border: 0;
  border-left: 1px solid transparent;
  color: var(--bomb-bone);
  text-align: left;
  cursor: pointer;
  font: inherit;
  position: relative;
  transition: background 0.25s ease, color 0.25s ease, border-left-color 0.25s ease, padding-left 0.25s ease;
}

.field-cable__btn:hover {
  background: rgba(132, 181, 192, 0.03);
  color: var(--bomb-fog);
  border-left-color: var(--bomb-amber);
  padding-left: 26px;
}

.field-cable__btn:focus-visible {
  outline: 1px solid var(--bomb-visor);
  outline-offset: -1px;
}

.field-cable__file {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--bomb-amber);
  text-transform: uppercase;
}

.field-cable__btn:hover .field-cable__file { color: var(--bomb-amber-burn); }

.field-cable__location {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--bomb-fog);
  text-transform: uppercase;
}

.field-cable__coord {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--bomb-bone);
}

.field-cable__operator {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--bomb-bone);
  text-transform: uppercase;
}

.field-cable__subject {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--bomb-concrete);
  text-transform: uppercase;
  text-align: right;
}

/* Cable expanded — iframe materializes below the row */
.field-cable__transmission {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bomb-charcoal);
  border-top: 1px solid var(--bomb-iron);
  display: none;
}

.field-cable.is-open .field-cable__transmission {
  display: block;
}

.field-cable__transmission iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.field-cable__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  font-family: var(--font-accent);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--bomb-bone);
  background: rgba(8, 10, 12, 0.7);
  backdrop-filter: blur(6px) saturate(0.7);
  -webkit-backdrop-filter: blur(6px) saturate(0.7);
  border: 1px solid var(--bomb-iron);
  padding: 8px 12px;
  cursor: pointer;
  text-transform: uppercase;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.field-cable__close:hover {
  color: var(--bomb-visor);
  border-color: var(--bomb-visor);
}

/* --- Surveillance page entry animations ---------------------------------- */

.page-surveillance .broadcast-section .section-label,
.page-surveillance .broadcast-file,
.page-surveillance .field-cables-section .section-label,
.page-surveillance .field-cable {
  animation: fade-up 0.7s ease-out both;
}

.page-surveillance .broadcast-section .section-label    { animation-delay: 1.3s; }
.page-surveillance .broadcast-file:nth-of-type(1)       { animation-delay: 1.4s; }
.page-surveillance .broadcast-file:nth-of-type(2)       { animation-delay: 1.5s; }
.page-surveillance .broadcast-file:nth-of-type(3)       { animation-delay: 1.6s; }
.page-surveillance .field-cables-section .section-label { animation-delay: 1.7s; }
.page-surveillance .field-cable:nth-of-type(1)          { animation-delay: 1.8s; }
.page-surveillance .field-cable:nth-of-type(2)          { animation-delay: 1.85s; }
.page-surveillance .field-cable:nth-of-type(3)          { animation-delay: 1.9s; }

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

@media (max-width: 900px) {
  .broadcast-section,
  .field-cables-section {
    padding-left: 32px;
    padding-right: 32px;
  }

  .broadcast-stack { gap: 64px; }

  .broadcast-file {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .field-cable__btn {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 18px 12px;
  }

  .field-cable__btn:hover { padding-left: 18px; }

  .field-cable__subject { text-align: left; }
}
