/* ==========================================================================
   RADIO PAGE (radio.html) — loads after css/global.css
   White, two-column live radio section:
     LEFT  — compact Radio.co player card + Call / WhatsApp buttons
     RIGHT — program schedule (on-air + next show highlighted by radio.js)
   Builds on global .container, .card-panel, .view-more-btn, .sr-only.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. SECTION & TWO-COLUMN LAYOUT
   -------------------------------------------------------------------------- */
.dc-radio-widget-section {
  padding: 48px 0 60px;
  background-color: #ffffff;
}

.dcr-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));   /* balanced 50 / 50 */
  gap: 24px;
  align-items: stretch;      /* both columns share the row height */
  max-width: 1024px;
  margin-inline: auto;
}

/* Left column: player card grows so player + buttons = schedule height */
.dcr-left-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* --------------------------------------------------------------------------
   2. COMPACT PLAYER CARD — extends .card-panel
   -------------------------------------------------------------------------- */
.card-panel.dcr-player-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: 22px 24px;
  box-shadow: var(--shadow-md);
}

.dcr-player-top {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

/* Station cover / logo thumbnail */
.dcr-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dcr-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;       /* logos stay whole; artwork fills the square */
  padding: 6px;
}

.dcr-player-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Stream status badge (state set by js/pages/radio.js via data-state) */
.dcr-status-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  line-height: 1.5;
  background: #e2e8f0;
  color: #334155;
}
.dcr-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: currentColor;
  flex-shrink: 0;
}
.dcr-status-badge[data-state="live"] {
  background: #dc2626;       /* white text passes WCAG AA */
  color: #ffffff;
}
.dcr-status-badge[data-state="live"] .dcr-status-dot {
  animation: dcrBlink 1.2s ease-in-out infinite;
}
.dcr-status-badge[data-state="connecting"] {
  background: #fef3c7;
  color: #92400e;
}
.dcr-status-badge[data-state="connecting"] .dcr-status-dot {
  animation: dcrBlink 0.8s ease-in-out infinite;
}
.dcr-status-badge[data-state="error"] {
  background: #f1f5f9;
  color: #475569;
}

@keyframes dcrBlink {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.3; transform: scale(0.7); }
}

.dcr-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-navy);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dcr-now-playing {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  font-size: 0.86rem;
}
.dcr-np-label {
  flex: 0 0 auto;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #b45309;            /* amber on white: AA contrast */
}
.dcr-np-title {
  min-width: 0;
  font-weight: 700;
  color: var(--text-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   3. CONTROLS — play / pause, mute, volume
   -------------------------------------------------------------------------- */
.dcr-controls-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.dcr-btn-play {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background-color: var(--accent-blue);
  color: #ffffff;
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 112, 243, 0.35);
  transition: var(--transition);
}
.dcr-btn-play:hover {
  background-color: #005ce6;
  transform: scale(1.06);
}

.dcr-volume-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
}

.dcr-btn-circle {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  color: var(--primary-navy);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.dcr-btn-circle:hover {
  color: var(--accent-blue);
}

.dcr-slider {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 4px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.dcr-vol-text {
  flex: 0 0 auto;
  width: 36px;
  text-align: right;
  font-size: 0.76rem;
  font-weight: 700;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   4. ACTION BUTTONS — directly under the player (extend .view-more-btn)
   -------------------------------------------------------------------------- */
.dcr-action-buttons-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.dcr-action-buttons-wrap .view-more-btn {
  justify-content: center;
  padding: 10px 14px;
  font-size: 0.88rem;
  white-space: nowrap;
}
.dcr-action-call {
  background-color: var(--primary-navy);
  color: #ffffff;
  border-color: var(--primary-navy);
}
.dcr-action-call:hover {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
}
.dcr-action-wa {
  background-color: #15803d;   /* WhatsApp green, darkened for AA contrast */
  color: #ffffff;
  border-color: #15803d;
}
.dcr-action-wa:hover {
  background-color: #166534;
  border-color: #166534;
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   5. PROGRAM SCHEDULE — extends .card-panel
   -------------------------------------------------------------------------- */
.card-panel.dcr-schedule-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px 22px;
  box-shadow: var(--shadow-md);
}

.dcr-schedule-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.dcr-schedule-heading {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary-navy);
}
.dcr-schedule-note {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
}

.dcr-schedule-list {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* One program row: time | title (+ optional host) | badge */
.dcr-schedule-item {
  flex: 1 1 0;               /* rows share the card height evenly */
  display: grid;
  grid-template-columns: 6.6rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-left: 4px solid #cbd5e1;
  border-radius: var(--radius-md);
}
.dcr-schedule-item.is-live {
  background: #fef2f2;
  border-color: #fecaca;
  border-left-color: var(--accent-red);
}
.dcr-schedule-item.is-next {
  border-left-color: var(--accent-gold);
}

.sch-hours {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dcr-sched-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.sch-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--primary-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dcr-sched-host {
  font-size: 0.74rem;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Row badges: ON AIR (animated) / NEXT */
.dcr-sched-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.5;
}
.dcr-sched-badge[hidden] { display: none; }
.dcr-sched-badge.is-live { background: #dc2626; color: #ffffff; }
.dcr-sched-badge.is-next { background: #fef3c7; color: #92400e; }
.dcr-sched-badge .dcr-status-dot { animation: dcrBlink 1.2s ease-in-out infinite; }

/* --------------------------------------------------------------------------
   6. FOCUS, RESPONSIVE & REDUCED MOTION
   -------------------------------------------------------------------------- */
.dcr-btn-play:focus-visible,
.dcr-btn-circle:focus-visible,
.dcr-slider:focus-visible,
.dcr-action-buttons-wrap .view-more-btn:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 3px;
}

/* Tablets (side by side, narrower columns) */
@media (max-width: 991px) {
  .dc-radio-widget-section { padding: 36px 0 48px; }
  .dcr-layout { gap: 18px; }
  .card-panel.dcr-player-card { padding: 18px; gap: 16px; }
  .card-panel.dcr-schedule-card { padding: 16px 18px; }
  .dcr-thumb { width: 60px; height: 60px; }
}

/* Narrower columns: time moves above the show title so names never get cut */
@media (max-width: 860px) {
  .dcr-schedule-item {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "hours badge"
      "info  badge";
    row-gap: 1px;
  }
  .dcr-schedule-item .sch-hours  { grid-area: hours; font-size: 0.72rem; }
  .dcr-schedule-item .dcr-sched-info { grid-area: info; }
  .dcr-schedule-item .dcr-sched-badge { grid-area: badge; }
}

/* Mobile & portrait tablets: stack — player & buttons on top, schedule below */
@media (max-width: 768px) {
  .dcr-layout {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
  }
  .dcr-schedule-item { flex: 0 0 auto; }   /* natural row height when stacked */
}

/* Small phones: action buttons stack as full-width compact buttons */
@media (max-width: 400px) {
  .dcr-action-buttons-wrap { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .dcr-player-top { gap: 12px; }
  .dcr-thumb { width: 54px; height: 54px; }
  .dcr-controls-row { gap: 10px; }
  .dcr-btn-play { width: 48px; height: 48px; }
  .dcr-title { white-space: normal; font-size: 0.98rem; }   /* wrap instead of cutting the name */
}

@media (prefers-reduced-motion: reduce) {
  .dcr-status-dot,
  .dcr-status-badge[data-state] .dcr-status-dot,
  .dcr-sched-badge .dcr-status-dot { animation: none; }
  .dcr-btn-play:hover { transform: none; }
}
