/* =================================================================
   The calendar banner.

   Its own file rather than more of news.css: the banner is the one
   part of the page that carries a colour of its own — every other
   surface here is indigo or nothing — and keeping that exception in
   one place makes it obvious it is an exception.

   That colour arrives as --ev-hue, set inline per event from the
   calendar data. Every accent below is derived from it, so an
   institution added to js/fx-calendar.js needs no CSS at all.
   ================================================================= */

.ev {
  position: relative;
  margin: 46px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
  transition: border-color 0.3s var(--ease);
}
.ev:hover { border-color: var(--border-hover); }

.ev__card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 33%) minmax(0, 1fr);
}
/* The hairline that tells you which institution you are looking at. */
.ev__card::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 1px; z-index: 2;
  background: linear-gradient(90deg,
    transparent,
    hsl(var(--ev-hue) 82% 70% / 0.55) 30%,
    hsl(calc(var(--ev-hue) + 40) 82% 70% / 0.55) 70%,
    transparent);
}

/* ── the poster ─────────────────────────────────────────── */
.ev__poster {
  position: relative;
  margin: 0;
  min-height: 232px;
  background: radial-gradient(120% 100% at 50% 40%,
    hsl(var(--ev-hue) 55% 16%) 0%, #060608 70%);
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.ev__canvas {
  display: block;
  width: 100%; height: 100%;
  position: absolute; inset: 0;
  cursor: crosshair;
}
img.ev__canvas { object-fit: cover; cursor: default; }

/* Fades the poster into the card so the two do not read as separate blocks. */
.ev__poster::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 55%, rgba(15, 15, 15, 0.55) 100%);
}

.ev__stamp {
  position: absolute; left: 16px; bottom: 14px; z-index: 2;
  display: flex; flex-direction: column; gap: 3px;
  font-family: 'JetBrains Mono', monospace;
  pointer-events: none;
}
.ev__stamp-org {
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: hsl(var(--ev-hue) 90% 84%);
}
.ev__stamp-place {
  font-size: 0.6rem; letter-spacing: 0.1em; color: var(--text-3);
}

/* ── the copy ───────────────────────────────────────────── */
.ev__main { padding: 24px 26px 24px; min-width: 0; }

.ev__eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 0 0 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-3);
}
.ev__pip {
  width: 6px; height: 6px; border-radius: 50%;
  background: hsl(var(--ev-hue) 85% 68%);
  box-shadow: 0 0 10px hsl(var(--ev-hue) 85% 60% / 0.7);
  animation: evPip 2.6s ease-in-out infinite;
}
.ev__pip--idle { animation: none; background: var(--text-3); box-shadow: none; }
@keyframes evPip { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.ev__title {
  margin: 0;
  font-size: clamp(1.3rem, 2.4vw, 1.62rem);
  font-weight: 600; letter-spacing: -0.025em; line-height: 1.16;
  color: var(--text);
}
.ev__sub {
  margin: 9px 0 0;
  font-size: 0.9rem; line-height: 1.6; color: var(--text-2); max-width: 58ch;
}
.ev__sub em { font-style: normal; color: var(--text-3); }

.ev__when {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px;
  margin: 16px 0 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem; color: var(--text-2);
}
.ev__zone, .ev__native { color: var(--text-3); }
.ev__native:not(:empty)::before { content: '· '; }

/* ── countdown ──────────────────────────────────────────── */
.ev__count { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.ev__unit {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 66px; padding: 9px 8px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(hsl(var(--ev-hue) 40% 10% / 0.6), rgba(255, 255, 255, 0.014));
}
.ev__num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem; font-weight: 600; line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--ev-hue) 88% 86%);
}
.ev__num.is-flip { animation: evFlip 0.42s var(--ease); }
@keyframes evFlip {
  from { transform: translateY(-42%); opacity: 0; filter: blur(2px); }
  to { transform: none; opacity: 1; filter: none; }
}
.ev__lbl {
  font-family: 'JetBrains Mono', monospace; font-style: normal;
  font-size: 0.55rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-3);
}

/* Inside the hour, the whole block warms up — the one moment the banner is
   allowed to be louder than the feed underneath it. */
.ev__card[data-phase="soon"] .ev__num { color: #fbbf24; }
.ev__card[data-phase="soon"] .ev__unit { border-color: rgba(251, 191, 36, 0.28); }
.ev__card[data-phase="soon"] .ev__pip { background: #fbbf24; box-shadow: 0 0 10px rgba(251, 191, 36, 0.7); }

.ev__card[data-phase="live"] .ev__pip { background: #22c55e; box-shadow: 0 0 10px rgba(34, 197, 94, 0.7); }
.ev__live {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 16px;
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  background: rgba(34, 197, 94, 0.07);
  font-family: 'JetBrains Mono', monospace; font-size: 0.82rem;
  color: #4ade80;
}

/* ── progress rail ──────────────────────────────────────── */
.ev__rail {
  position: relative; height: 3px; margin: 18px 0 0;
  border-radius: 2px; background: rgba(255, 255, 255, 0.05); overflow: hidden;
}
.ev__rail span {
  display: block; height: 100%; width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg,
    hsl(var(--ev-hue) 70% 45% / 0.5),
    hsl(var(--ev-hue) 90% 72%));
  transition: width 0.9s linear;
}

/* ── actions ────────────────────────────────────────────── */
.ev__acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }
.ev__acts--wrap { margin-top: 12px; }
.ev__act {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  font-family: inherit; font-size: 0.78rem;
  cursor: pointer; white-space: nowrap;
  transition: color 0.22s var(--ease), border-color 0.22s var(--ease), background 0.22s var(--ease);
}
.ev__act:hover { color: var(--text); border-color: var(--border-hover); background: var(--bg-card-hover); }
.ev__act--primary {
  color: hsl(var(--ev-hue) 90% 84%);
  border-color: hsl(var(--ev-hue) 70% 60% / 0.3);
}
.ev__act--primary:hover { border-color: hsl(var(--ev-hue) 80% 65% / 0.55); }
.ev__act svg { transition: transform 0.3s var(--ease); }
.ev.is-open .ev__act--primary svg { transform: rotate(180deg); }

/* ── the detail panel ───────────────────────────────────── */
.ev__detail {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease);
  border-top: 1px solid transparent;
}
.ev.is-open .ev__detail { grid-template-rows: 1fr; border-top-color: var(--border); }
.ev__detail.no-anim { transition: none; }
.ev__detail > div { overflow: hidden; }

.ev__detail-inner {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 30px;
  padding: 24px 26px;
}
.ev__detail h4 {
  margin: 0 0 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.62rem;
  letter-spacing: 0.17em; text-transform: uppercase; color: var(--text-3);
  font-weight: 500;
}
.ev__detail p {
  margin: 0; font-size: 0.9rem; line-height: 1.72; color: var(--text-2); max-width: 68ch;
}

.ev__pairs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.ev__pair {
  padding: 5px 10px 4px;
  border: 1px solid hsl(var(--ev-hue) 60% 60% / 0.22);
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.68rem;
  color: hsl(var(--ev-hue) 85% 82%);
}

/* Last time out — the "previous" half of the banner. */
.ev__prev { display: grid; grid-template-columns: 106px minmax(0, 1fr); gap: 16px; }
.ev__prev-fig { margin: 0; }
.ev__prev-art {
  display: block; width: 106px; height: 76px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #08080a;
  object-fit: cover;
}
.ev__prev-fig figcaption {
  margin-top: 7px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.6rem;
  letter-spacing: 0.08em; color: var(--text-3); text-align: center;
}
.ev__prev-body p { font-size: 0.86rem; }

.ev__link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px;
  font-size: 0.8rem; color: hsl(var(--ev-hue) 88% 80%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.22s var(--ease);
}
.ev__link:hover { border-bottom-color: currentColor; }

/* ── the queue ──────────────────────────────────────────── */
.ev__queue {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 26px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.012);
  overflow-x: auto;
  scrollbar-width: none;
}
.ev__queue::-webkit-scrollbar { display: none; }
.ev__queue-lbl {
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace; font-size: 0.6rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-3);
  margin-right: 4px;
}
.ev__tab {
  display: inline-flex; align-items: baseline; gap: 8px; flex-shrink: 0;
  padding: 7px 13px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  font-family: inherit; font-size: 0.76rem;
  cursor: pointer;
  transition: color 0.22s var(--ease), border-color 0.22s var(--ease), background 0.22s var(--ease);
}
.ev__tab:hover { color: var(--text); border-color: var(--border-hover); background: var(--bg-card); }
.ev__tab.is-on {
  color: var(--text);
  border-color: hsl(var(--ev-hue) 70% 60% / 0.4);
  background: hsl(var(--ev-hue) 60% 50% / 0.1);
}
.ev__tab-org { font-family: 'JetBrains Mono', monospace; font-size: 0.66rem; letter-spacing: 0.08em; }
.ev__tab-day { color: var(--text-3); font-size: 0.72rem; }
.ev__tab.is-on .ev__tab-day { color: var(--text-2); }

/* ── narrow ─────────────────────────────────────────────── */
@media (max-width: 860px) {
  .ev__detail-inner { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 700px) {
  .ev { margin-top: 34px; }
  .ev__card { grid-template-columns: 1fr; }
  .ev__poster { min-height: 148px; border-right: none; border-bottom: 1px solid var(--border); }
  .ev__poster::after {
    background: linear-gradient(180deg, transparent 45%, rgba(15, 15, 15, 0.6) 100%);
  }
  .ev__main { padding: 20px 18px; }
  .ev__unit { min-width: 0; flex: 1 1 62px; }
  .ev__num { font-size: 1.35rem; }
  .ev__detail-inner { padding: 20px 18px; }
  .ev__queue { padding: 11px 18px; }
  .ev__prev { grid-template-columns: 84px minmax(0, 1fr); gap: 13px; }
  .ev__prev-art { width: 84px; height: 62px; }
}

@media (prefers-reduced-motion: reduce) {
  .ev__pip { animation: none; }
  .ev__num.is-flip { animation: none; }
  .ev__detail, .ev__rail span, .ev__act, .ev__tab, .ev__act svg { transition: none; }
}
