/*
 * ICEFAM.FM live radio hero. Glassy ICE/neon treatment that matches the
 * launchpad / player design language. Two honest states toggled by app.js via
 * [data-radio-state="on|off|loading"]. The ON AIR badge and its neon pulse only
 * render in the "on" state — the endpoint has to confirm a real broadcast.
 */

.live-radio {
  position: relative;
  margin: clamp(1rem, 3vw, 2rem) auto 0;
  max-width: 1200px;
  padding: clamp(1rem, 3vw, 1.75rem);
  border-radius: 22px;
  overflow: hidden;
  color: #f1eee6;
  background:
    radial-gradient(120% 140% at 12% 0%, rgba(205, 202, 195, 0.14), transparent 60%),
    radial-gradient(120% 140% at 100% 0%, rgba(175, 173, 167, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(28, 27, 24, 0.94), rgba(20, 18, 16, 0.97));
  border: 1px solid rgba(214, 211, 204, 0.22);
  box-shadow: 0 30px 80px -40px rgba(205, 202, 195, 0.55), inset 0 0 0 1px rgba(245, 242, 234, 0.03);
}

.live-radio[data-radio-state="on"] {
  border-color: rgba(170, 168, 162, 0.55);
  box-shadow: 0 30px 90px -36px rgba(170, 168, 162, 0.6), inset 0 0 0 1px rgba(245, 242, 234, 0.04);
}

.live-radio-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: clamp(0.75rem, 2vw, 1.1rem);
}

.live-radio .section-label {
  margin: 0;
  font: 600 0.72rem/1.4 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d6d3cc;
}

/* Badge: neutral OFF AIR by default; only lights red + pulses when live. */
.live-radio-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font: 700 0.78rem/1 "Space Grotesk", system-ui, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #acaaa4;
  background: rgba(245, 242, 234, 0.05);
  border: 1px solid rgba(245, 242, 234, 0.14);
}

.live-radio-badge i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #8b8983;
}

.live-radio[data-radio-state="on"] .live-radio-badge {
  color: #f5f2ea;
  background: rgba(169, 167, 161, 0.18);
  border-color: rgba(170, 168, 162, 0.6);
}

.live-radio[data-radio-state="on"] .live-radio-badge i {
  background: #aaa7a1;
  box-shadow: 0 0 0 0 rgba(170, 167, 161, 0.7);
  animation: live-radio-pulse 1.6s ease-out infinite;
}

@keyframes live-radio-pulse {
  0% { box-shadow: 0 0 0 0 rgba(170, 167, 161, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(170, 167, 161, 0); }
  100% { box-shadow: 0 0 0 0 rgba(170, 167, 161, 0); }
}

/* Stage layout. Use minmax so the video column never blows out mobile. */
.live-radio-stage {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  align-items: stretch;
}

@media (min-width: 860px) {
  .live-radio-stage {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  }
}

.live-radio-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #141311;
  border: 1px solid rgba(214, 211, 204, 0.2);
}

.live-radio-screen iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.live-radio-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #ceccc5;
  font: 500 0.85rem/1.4 "Space Grotesk", system-ui, sans-serif;
}

.live-radio-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(206, 204, 197, 0.25);
  border-top-color: #cdcbc4;
  animation: live-radio-spin 0.9s linear infinite;
}

@keyframes live-radio-spin {
  to { transform: rotate(360deg); }
}

.live-radio-copy {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.live-radio-copy h2 {
  margin: 0;
  font: 600 clamp(1.5rem, 3.5vw, 2.2rem)/1.05 "Instrument Serif", Georgia, serif;
  color: #f2efe7;
}

.live-radio-artist {
  margin: 0;
  font: 600 0.8rem/1.4 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.08em;
  color: #d3d0c9;
}

.live-radio-state-line {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #dfddd5;
}

/* Only show the state line that matches the active state. */
.live-radio-state-line[data-when="on"] { display: none; }
.live-radio-state-line[data-when="off"] { display: block; }
.live-radio[data-radio-state="on"] .live-radio-state-line[data-when="on"] { display: block; }
.live-radio[data-radio-state="on"] .live-radio-state-line[data-when="off"] { display: none; }
.live-radio[data-radio-state="loading"] .live-radio-state-line { display: none; }

.live-radio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.live-radio-actions .button {
  min-height: 44px;
}

/* .button's display:inline-flex (launchpad.css) would defeat the [hidden]
   attribute the app toggles — the unmute CTA must never render OFF AIR. */
.live-radio-unmute[hidden] {
  display: none !important;
}

.live-radio-pledge {
  margin: 0.6rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(245, 242, 234, 0.08);
  font: 500 0.78rem/1.5 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.03em;
  color: #c5c2bc;
}

.live-radio-pledge code {
  color: #f1eee6;
  background: rgba(205, 203, 196, 0.12);
  padding: 0.05em 0.35em;
  border-radius: 5px;
}

/* Scrolling ticker. */
.live-radio-ticker {
  margin-top: clamp(1rem, 2.5vw, 1.5rem);
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(214, 211, 204, 0.2);
  background: rgba(25, 23, 21, 0.8);
  -webkit-mask-image: linear-gradient(90deg, transparent, #0b0a08 6%, #0b0a08 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #0b0a08 6%, #0b0a08 94%, transparent);
}

.live-radio-ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 2.5rem;
  padding: 0.55rem 1.25rem;
  white-space: nowrap;
  will-change: transform;
  animation: live-radio-marquee 32s linear infinite;
}

.live-radio-ticker-track span {
  font: 600 0.74rem/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ceccc5;
}

.live-radio[data-radio-state="on"] .live-radio-ticker-track span {
  color: #dbd8d1;
}

@keyframes live-radio-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Slim ON AIR strip (shared; used on /player). Rendered ONLY when
   /api/radio/live confirms a real broadcast — [hidden] by default, fail-closed.
   There is deliberately no OFF AIR variant: off air, the strip does not exist. */
.live-radio-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.55rem max(16px, 4vw);
  text-decoration: none;
  font: 700 0.78rem/1.3 "Space Grotesk", system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f5f2ea;
  background: linear-gradient(180deg, rgba(169, 167, 161, 0.22), rgba(169, 167, 161, 0.08));
  border-bottom: 1px solid rgba(170, 168, 162, 0.55);
}
.live-radio-strip i {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #aaa7a1;
  box-shadow: 0 0 0 0 rgba(170, 167, 161, 0.7);
  animation: live-radio-pulse 1.6s ease-out infinite;
}
.live-radio-strip[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .live-radio-ticker-track { animation: none; }
  .live-radio[data-radio-state="on"] .live-radio-badge i { animation: none; }
  .live-radio-strip i { animation: none; }
  .live-radio-spinner { animation-duration: 2s; }
}
