/* Sendeplan Radio Santec (alle Sprachen)
   Die CSS-Dateien von DNZ, SNJ und Santec sind bis auf diesen Farbblock identisch. */

/* ===== Farben dieses Senders ===== */
:root {
  --scheme: dark;
  --page-bg: #005bb2;           /* etwas dunkler als früher (#0072dd), damit alles gut lesbar ist */
  --page-text: #d6e8fb;         /* Überschriften/Hinweise direkt auf dem Hintergrund */
  --header-bg: #005bb2;
  --header-line: #004e99;
  --tab-text: #d6e8fb;
  --tab-text-hover: #fff;
  --tab-text-active: #fff;
  --tab-underline: #fff;
  --daypart-underline: #fff;
  --tab-text-dim: #8fb4dd;      /* Tageszeiten während der Suche */
  --card: #0072dd;              /* früheres Hintergrundblau */
  --card-hover: #0066c6;
  --card-text: #fff;
  --card-muted: #fff;
  --card-soft: #fff;            /* Beschreibung in Suchtreffern */
  --accent: #fff;               /* „Jetzt“-Markierung, Fortschrittsbalken */
  --accent-text: #005bb2;
  --progress-track: rgba(255, 255, 255, .25);
  --mark-bg: #ffe066;           /* Suchtreffer */
  --mark-text: #0b2a4a;
  --selected: #ffcc33;          /* Rahmen der ausgewählten Sendung (Rot wäre auf Blau kaum sichtbar) */
  --search-bg: #eaf3fe;
  --search-border: #8fb4dd;
  --search-text: #0b2a4a;
  --search-placeholder: #4d6b8c;
  --focus: #ffcc33;
  --focus-header: #fff;
}

/* ===== ab hier für alle Sender gleich ===== */
:root {
  --radius: 16px;
  --header-h: 105px;      /* wird per JS an die tatsächliche Höhe angepasst */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: var(--scheme);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--page-bg); }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--page-text);
  font-family: var(--font);
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Kopfbereich (bleibt oben stehen) ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-line);
}
.topbar :focus-visible { outline-color: var(--focus-header); }

.days {
  position: relative;
  display: flex;
  height: 60px;
  overflow-x: auto;
  scrollbar-width: none;
}
.days::-webkit-scrollbar { display: none; }

.day-tab {
  flex: 0 0 auto;
  margin-left: 4px;
  padding: 8px 16px;
  background: none;
  border: 0;
  color: var(--tab-text);
  font-weight: bold;
  line-height: 1.25;
  cursor: pointer;
  transition: color .3s;
}
.day-tab:hover { color: var(--tab-text-hover); }
.day-tab[aria-selected="true"] { color: var(--tab-text-active); box-shadow: inset 0 -3px 0 var(--tab-underline); }
.day-tab:focus-visible { outline-offset: -2px; }
.is-searching .day-tab[aria-selected="true"] { color: var(--tab-text); box-shadow: none; }
.tab-date { display: block; font-size: .8em; font-weight: normal; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-right: 10px;
}
.dayparts {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.dayparts::-webkit-scrollbar { display: none; }
.dayparts button {
  flex: 0 0 auto;
  padding: 12px 20px;
  background: none;
  border: 0;
  color: var(--tab-text);
  font-size: .875rem;
  font-weight: bold;
  cursor: pointer;
  transition: color .3s;
}
.dayparts button:hover { color: var(--tab-text-hover); }
.dayparts button.is-active { color: var(--tab-text-active); box-shadow: inset 0 -2px 0 var(--daypart-underline); }
.dayparts button:focus-visible { outline-offset: -2px; }
.is-searching .dayparts button { color: var(--tab-text-dim); box-shadow: none; }

.search { flex: 0 1 280px; }
.search input {
  width: 100%;
  padding: 7px 14px;
  border: 1px solid var(--search-border);
  border-radius: 999px;
  background: var(--search-bg);
  color: var(--search-text);
  font: inherit;
  font-size: .9375rem;
}
.search input::placeholder { color: var(--search-placeholder); opacity: 1; }
.search input:focus-visible { outline-offset: 0; border-color: var(--focus-header); }

/* ---------- Inhalt ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 10px;
  align-items: start;
  padding-right: 10px;
}
.list { min-width: 0; padding: 6px 12px 24px; }

.tz-note, .status { margin: 10px 4px 0; color: var(--page-text); font-size: .875rem; }
.status:empty { display: none; }

.part-title, .results-day {
  margin: 18px 4px 6px;
  color: var(--page-text);
  font-size: .75rem;
  font-weight: bold;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.part:first-child .part-title { margin-top: 10px; }
.part-title span { margin-left: 6px; font-weight: normal; letter-spacing: normal; text-transform: none; }
.part-empty { margin: 4px; color: var(--page-text); font-size: .875rem; }

/* ---------- Sendungen ---------- */

.shows { list-style: none; margin: 0; padding: 0; }
.show {
  position: relative;
  margin-top: 5px;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--card-text);
  overflow: hidden;
}
/* Rahmen als Overlay: verschiebt nichts und wird nicht vom Button verdeckt */
.show.is-selected::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--selected);
  border-radius: inherit;
  pointer-events: none;
}

.show-btn {
  position: relative;
  display: block;
  width: 100%;
  min-height: 60px;
  padding: 8px 16px 8px 20px;
  background: var(--card);
  border: 0;
  text-align: left;
  cursor: pointer;
  transition: background-color .2s;
}
.show-btn:hover { background: var(--card-hover); }
.show-btn:focus-visible { outline-offset: -4px; border-radius: var(--radius); }

.show-time { font-size: 1.125rem; }
.show-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}
.show-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 2px;
  color: var(--card-soft);
  font-size: .875rem;
}

.live-badge {
  display: none;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: .75rem;
  font-weight: bold;
  vertical-align: 2px;
}
.is-live .live-badge { display: inline-block; }

.show-progress {
  display: none;
  position: absolute;
  left: 20px;
  right: 16px;
  bottom: 6px;
  height: 3px;
  border-radius: 2px;
  background: var(--progress-track);
}
.show-progress > span { display: block; width: var(--p, 0%); height: 100%; border-radius: inherit; background: var(--accent); }
.is-live .show-btn { padding-bottom: 14px; }
.is-live .show-progress { display: block; }

mark { padding: 0 1px; border-radius: 3px; background: var(--mark-bg); color: var(--mark-text); }

/* ---------- Details rechts (Desktop) ---------- */

.detail {
  position: sticky;
  top: calc(var(--header-h) + 8px);
  max-height: calc(100vh - var(--header-h) - 16px);
  margin-top: 8px;
  overflow-y: auto;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--card-text);
}
.detail-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 45vh;
  object-fit: cover;
  border-radius: 10px;
  -webkit-mask-image: linear-gradient(to bottom, #000 85%, transparent);
  mask-image: linear-gradient(to bottom, #000 85%, transparent);
}
.detail-body { padding: 4px 20px 20px; }
.detail-time { margin: 0; font-size: 2rem; }
.detail-title { margin: 4px 0 8px; font-size: 1.5rem; font-weight: 600; line-height: 1.25; }
.detail-meta { margin: 0 0 12px; color: var(--card-muted); font-size: .9375rem; }
.detail-meta .live-badge { margin: 0 8px 0 0; }
.detail-desc { margin: 0; font-size: 1.125rem; }

/* ---------- Details unter der Sendung (mobil) ---------- */

.show-inline { padding: 0 16px 16px; text-align: center; }
.inline-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
}
.inline-meta { margin: 10px 0 4px; color: var(--card-muted); font-size: .875rem; }
.inline-desc { margin: 0; font-size: .9375rem; }

/* ---------- Schmale Ansicht ---------- */
/* Breakpoint muss zu CONFIG.mobileQuery im Skript passen */
@media (max-width: 738px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-right: 0; }
  .detail { display: none; }

  .toolbar { flex-wrap: wrap; gap: 0; padding: 0 10px 8px 0; }
  .dayparts { flex-basis: 100%; justify-content: space-between; }
  .dayparts button { padding: 12px 8px; font-size: .8125rem; }
  .search { flex: 1 1 100%; padding-left: 10px; }
  .search input { font-size: 1rem; } /* verhindert Auto-Zoom auf iOS */

  .show-btn { padding: 10px 16px 12px; text-align: center; }
  .show-time { display: block; font-size: 1.5rem; }
  .live-badge { vertical-align: 4px; }
  .show-title { -webkit-line-clamp: 2; font-size: 1.125rem; }
  .show.is-selected .show-title { -webkit-line-clamp: unset; }
  .show-progress { left: 16px; }
  .is-live .show-btn { padding-bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
