/* Page styles: /station/live-log/ (live-log). Owned by this page's agent. Shared styles live in /assets/css/site.css. */

/* Hero ------------------------------------------------------------------- */

.live-log-note { margin-top: 14px; max-width: 34em; color: var(--muted); }

/* Hero widget: the hour as a ring of blocks that reflows when something changes */
.live-log-clock { max-width: 600px; margin-inline: auto; }
.live-log-clock__stage { position: relative; aspect-ratio: 1; width: 100%; container-type: inline-size; }
.live-log-clock__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.live-log-clock__read {
  position: absolute; left: 50%; top: 50%; width: 46%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; pointer-events: none;
}
.live-log-clock__time {
  font-family: var(--font-display); font-size: 2rem; font-size: clamp(1.25rem, 8cqw, 2.75rem); line-height: 1;
  color: var(--text); white-space: nowrap;
}
.live-log-clock__time i { display: inline-block; width: 0.68em; font-style: normal; text-align: center; }
.live-log-clock__time i.is-sep { width: 0.46em; }
.live-log-clock__left { font-size: 0.75rem; font-size: clamp(0.625rem, 2.5cqw, 0.8125rem); color: var(--muted); }
.live-log-clock__left b { font-weight: 500; color: var(--accent); font-variant-numeric: tabular-nums; }
.live-log-clock__msg {
  min-height: 2.7em; font-size: 0.8125rem; font-size: clamp(0.6875rem, 2.6cqw, 0.875rem); font-weight: 500; line-height: 1.35;
  color: var(--muted); text-wrap: balance;
}
.live-log-clock__msg[data-state='bad'] { color: var(--error); }
.live-log-clock__msg[data-state='fix'],
.live-log-clock__msg[data-state='ok'] { color: var(--accent); }

.live-log-key { display: inline-flex; align-items: center; gap: 7px; font-size: 0.625rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; color: var(--muted); }
.live-log-key::before { content: ''; width: 14px; height: 8px; flex: none; background: var(--subtle); }
.live-log-key--talk::before { height: 4px; background: var(--text); }
.live-log-key--ads::before { background: transparent; border: 1px solid var(--muted); }
.live-log-key--fix::before { background: var(--accent); }
.live-log-key--bad::before { background: var(--error); }

/* The old way: status word at the end of each struck row ---------------- */

.live-log-gone li::after {
  content: attr(data-done); margin-left: auto; padding-left: 12px; flex: none;
  font-family: var(--font-display); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); opacity: 0; transition: opacity 0.3s steps(3);
}
.live-log-gone li.is-struck::after, html:not(.js) .live-log-gone li::after { opacity: 1; }
/* The shared strike line sits at 50% of the row, which falls between the lines when a row wraps on a phone.
   Here the line is drawn through each line of text instead. */
.live-log-gone li > span { min-width: 0; }
.live-log-gone li > span::after { display: none; }
.live-log-gone li > span > span {
  margin: 0 -4px; padding: 0 4px;
  background: linear-gradient(var(--muted), var(--muted)) no-repeat 0 55% / 0 2px;
  transition: background-size 0.35s steps(8);
}
.live-log-gone li.is-struck > span > span, html:not(.js) .live-log-gone li > span > span { background-size: 100% 2px; }
@media (prefers-reduced-motion: reduce) { .live-log-gone li > span > span { transition: none; } }

/* Log assembly: sources drop their items into the hour ------------------- */

.live-log-asm { --live-log-song: color-mix(in srgb, var(--subtle) 62%, var(--panel-black)); margin-bottom: var(--gap); }
.live-log-asm__body { position: relative; display: grid; grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr); gap: clamp(32px, 7vw, 110px); align-items: center; overflow: hidden; }
.live-log-asm__src { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.live-log-src {
  display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px;
  background: var(--panel-raised); border: 1px solid var(--panel-line-strong); border-radius: var(--radius);
  transition: border-color 0.15s steps(2), background 0.15s steps(2);
}
.live-log-src .ico { flex: none; color: var(--muted); }
.live-log-src b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 0.875rem; letter-spacing: 0.02em; color: var(--text); white-space: nowrap; }
.live-log-src small { display: block; font-size: 0.75rem; color: var(--subtle); white-space: nowrap; }
.live-log-src.is-lit { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel-raised)); }
.live-log-src.is-lit .ico { color: var(--accent); }
/* swatch: ties each source to the look of its blocks in the log, also where the blocks are too narrow for a label */
.live-log-src::after { content: ''; flex: none; margin-left: auto; width: 18px; height: 10px; border-radius: 1px; background: var(--live-log-song); }
.live-log-src[data-src='talk']::after { height: 5px; background: var(--text); }
.live-log-src[data-src='news']::after { background: var(--accent-dim); }
.live-log-src[data-src='ads']::after { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--line) 3px 4px); border: 1px solid var(--muted); }

.live-log-asm__log { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.live-log-asm__ruler { display: flex; justify-content: space-between; font-size: 0.625rem; font-weight: 500; letter-spacing: 0.1em; color: var(--subtle); }
.live-log-asm__lane {
  position: relative; height: 74px; background: var(--panel-black);
  border: 1px dashed var(--panel-line-strong); border-radius: var(--radius);
  transition: border-color 0.3s steps(3);
}
.live-log-asm.is-done .live-log-asm__lane { border-style: solid; border-color: var(--accent); }
.live-log-slot { position: absolute; top: 7px; bottom: 7px; border: 1px dashed var(--panel-line-strong); border-radius: 1px; }
.live-log-asm__head { position: absolute; top: -6px; bottom: -6px; left: 0; width: 2px; background: var(--text); opacity: 0; }
.live-log-asm__head::before { content: ''; position: absolute; top: -4px; left: -3px; width: 8px; height: 4px; background: var(--text); }
.live-log-asm.is-run .live-log-asm__head { opacity: 1; transform: translateX(var(--run, 0px)); transition: transform 4.2s steps(56, end); }
.live-log-asm__badges { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; min-height: 22px; }
.live-log-asm__badges .tag { opacity: 0; transform: translateY(6px); transition: opacity 0.3s steps(3), transform 0.3s steps(3); }
.live-log-asm.is-done [data-badge='a'], .live-log-asm.is-run [data-badge='b'] { opacity: 1; transform: none; }

.live-log-tile {
  position: absolute; z-index: 2; height: 58px; overflow: hidden; border-radius: 1px;
  display: flex; align-items: flex-end; padding: 0 0 5px 6px;
  font-size: 0.625rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
  color: var(--text); background: var(--panel-line-strong); opacity: 0; transform-origin: 0 50%;
}
.live-log-tile.is-in { opacity: 1; transform: none !important; transition: transform 0.95s steps(12, end), opacity 0.2s steps(2); }
.live-log-tile--music { background: var(--live-log-song); }
.live-log-tile--talk { background: var(--text); color: var(--bg); }
.live-log-tile--news { background: var(--accent-dim); color: var(--bg); }
.live-log-tile--ads {
  background: repeating-linear-gradient(135deg, transparent 0 5px, var(--line) 5px 6px);
  border: 1px solid var(--muted); color: var(--muted);
}

@media (max-width: 900px) {
  .live-log-asm__body { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .live-log-asm__src { flex-direction: row; flex-wrap: wrap; }
  .live-log-src { flex: 1 1 150px; }
}

/* Station field: one small clock per station ----------------------------- */

.live-log-field { position: relative; height: clamp(420px, 60vh, 560px); }
.live-log-field canvas { display: block; width: 100%; height: 100%; }
.live-log-field__note { margin-top: 26px; text-align: center; }
@media (max-width: 640px) { .live-log-field { height: 680px; } }

/* Signals: four inputs feed one block ------------------------------------ */

.live-log-sig { --gapw: clamp(40px, 8vw, 120px); display: grid; grid-template-columns: minmax(0, 1fr) var(--gapw) minmax(0, 0.62fr); align-items: stretch; }
.live-log-sig__in { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.live-log-in { position: relative; padding: 14px 18px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius); }
.live-log-in h3 { font-size: 1rem; padding-right: 28px; }
.live-log-in__n { position: absolute; top: 12px; right: 14px; font-family: var(--font-display); font-weight: 400; font-size: 0.75rem; line-height: 1; color: var(--subtle); }
.live-log-sig__gap span { display: none; }
.live-log-in p { margin: 4px 0 0; font-size: 0.8125rem; color: var(--muted); }
.live-log-in::after { content: ''; position: absolute; left: 100%; top: 50%; width: var(--gapw); height: 2px; margin: -1px 0 0 1px; background: var(--panel-line-strong); }
.live-log-in > i { position: absolute; z-index: 1; left: 100%; top: 50%; width: 10px; height: 6px; margin: -3px 0 0 1px; background: var(--accent); opacity: 0; }
.live-log-core { position: relative; min-width: 0; min-height: 240px; background: var(--panel-black); border: 1px solid var(--panel-line-strong); border-top: 2px solid var(--accent); border-radius: var(--radius); overflow: hidden; }
.live-log-core canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.live-log-core__plate {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 18px; text-align: center; white-space: nowrap;
  background: var(--panel-black); border: 1px solid var(--panel-line-strong); border-radius: var(--radius);
}
.live-log-core__plate b { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.25rem, 2vw, 1.75rem); line-height: 1; color: var(--text); }
.live-log-core__plate span { font-size: 0.75rem; color: var(--accent); }
@media (max-width: 900px) {
  /* stacked: the four inputs run down four numbered feed lines into the top of the block */
  .live-log-sig { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .live-log-in::after, .live-log-in > i { display: none; }
  .live-log-sig__gap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); height: 52px; }
  .live-log-sig__gap span { display: block; position: relative; }
  .live-log-sig__gap span::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--panel-line-strong); }
  .live-log-sig__gap b { position: absolute; right: calc(50% + 10px); top: 50%; transform: translateY(-50%); font-family: var(--font-display); font-weight: 400; font-size: 0.75rem; line-height: 1; color: var(--subtle); }
  .live-log-sig__gap i { position: absolute; z-index: 1; left: 50%; top: 0; width: 6px; height: 10px; margin-left: -3px; background: var(--accent); opacity: 0; }
  .live-log-core { height: 240px; }
}

/* Where it fits ----------------------------------------------------------- */

.live-log-fits .chain__body a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.live-log-fits .chain__body a:hover { color: var(--text); text-decoration-color: var(--accent); }

/* Tablet and phone: the shared chain drops its thread and pulse below 900px. Here the four steps become one
   column on a rail, with a block travelling down it, so the order still reads as a flow. */
@media (max-width: 900px) {
  .live-log-fits .chain { grid-template-columns: minmax(0, 1fr); row-gap: 0; max-width: 460px; margin-inline: auto; }
  .live-log-fits .chain__step { display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 18px; row-gap: 6px; justify-items: start; align-items: start; padding-bottom: 30px; text-align: left; }
  .live-log-fits .chain__step:nth-child(4) { padding-bottom: 0; }
  .live-log-fits .chain__n { grid-row: 1 / span 3; }
  .live-log-fits .chain__tag, .live-log-fits .chain__title, .live-log-fits .chain__body { grid-column: 2; }
  .live-log-fits .chain__body { max-width: none; }
  .live-log-fits .chain__step:nth-child(-n+3)::before { content: ''; position: absolute; left: 23px; top: 48px; bottom: 0; width: 2px; background: var(--panel-line-strong); }
  .live-log-fits .chain__step:nth-child(-n+3)::after { content: ''; position: absolute; left: 20px; top: 48px; width: 8px; height: 10px; background: var(--accent); opacity: 0; }
}
@media (max-width: 900px) and (prefers-reduced-motion: no-preference) {
  .live-log-fits .chain.is-on .chain__step:nth-child(-n+3)::after { animation: live-log-rail 3.6s steps(14) infinite; }
  .live-log-fits .chain.is-on .chain__step:nth-child(2)::after { animation-delay: 1.2s; }
  .live-log-fits .chain.is-on .chain__step:nth-child(3)::after { animation-delay: 2.4s; }
}
@keyframes live-log-rail {
  0% { top: 48px; opacity: 1; }
  33% { top: calc(100% - 10px); opacity: 1; }
  33.4%, 100% { top: calc(100% - 10px); opacity: 0; }
}
