/* Ist heute Streik? – mobile first */

:root {
  --bg: #1f2937;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.8);
  --card: rgba(255, 255, 255, 0.14);
  --card-border: rgba(255, 255, 255, 0.28);
  --shadow: rgba(0, 0, 0, 0.25);
}

.status-ja        { --bg: #c81e1e; }
.status-nein      { --bg: #1a7f37; }
.status-unbekannt { --bg: #b45309; }
.status-laden     { --bg: #1f2937; }
.status-archiv    { --bg: #1f2937; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--bg);
  color: var(--fg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  font-size: 1rem;
  transition: background-color 0.4s ease;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

a { color: inherit; }

.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Kopf */
.header { text-align: center; }
.kicker {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.question {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 0.25rem;
}
/* Datum unter der Frage: deutlich größer als der frühere Platz in .kicker,
   aber unter .answer-word – es datiert die Antwort, ersetzt sie nicht. */
.heute-datum {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 0.5rem;
  color: var(--muted);
  text-wrap: balance;
}

/* Antwort */
.answer {
  text-align: center;
  padding: 1.25rem 0 1rem;
}
.answer-word {
  font-size: clamp(5rem, 32vw, 13rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-shadow: 0 0.08em 0.3em var(--shadow);
}
.answer-word--pending {
  font-size: clamp(4rem, 22vw, 8rem);
  opacity: 0.85;
}
.answer-sub {
  font-size: 1.15rem;
  margin-top: 0.75rem;
  color: var(--muted);
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

/* Archiv: Datumsauswahl (reines GET-Formular, kein JS) */
.datum-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.datum-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}
.datum-zeile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  max-width: 18rem;
}
.datum-input {
  appearance: none;
  font: inherit;
  color: var(--fg);
  background: rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 0.7rem;
  padding: 0.7rem 0.8rem;
  min-height: 3rem;
  text-align: center;
  /* Safari/iOS zieht Datumsfelder sonst auf eine eigene, breitere Größe. */
  width: 100%;
  box-sizing: border-box;
}
.datum-input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
/* Das Kalender-Symbol ist von Haus aus dunkel und auf farbigem Grund kaum zu sehen. */
.datum-input::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }
.btn--datum { min-width: 0; }
.datum-bereich { font-size: 0.85rem; color: var(--muted); }

/* Archiv: Rückmeldung zu ?datum= – gefundener Tag bzw. fehlender Tag */
.datum-hinweis {
  font-size: 1rem;
  margin-top: 0.6rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0.5rem 0.8rem;
  border-radius: 0.7rem;
  background: rgba(0, 0, 0, 0.2);
}

.spinner {
  width: 3rem;
  height: 3rem;
  border: 0.35rem solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Abschnitte */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  color: var(--muted);
}
.plain { color: var(--muted); }

.cards {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 0.9rem;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 0.6rem;
  font-size: 0.95rem;
}
.card-meta div { display: flex; gap: 0.35rem; }
.card-meta dt { color: var(--muted); }
.card-meta dt::after { content: ":"; }
.card-meta dd { font-weight: 600; }
.card-text { margin-top: 0.6rem; }
.card-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  word-break: break-word;
}

/* Hinweise */
.note-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.note-list li {
  background: rgba(0, 0, 0, 0.18);
  border-left: 0.3rem solid rgba(255, 255, 255, 0.6);
  border-radius: 0.4rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
}

/* Provider */
.providers {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
.provider {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
}
.provider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}
.provider-name { font-weight: 700; }
.provider-verdict {
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}
.provider--fail .provider-verdict { background: rgba(0, 0, 0, 0.3); }
.provider-detail {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.2rem;
  word-break: break-word;
}
.provider-summary { margin-top: 0.5rem; font-size: 0.95rem; }
.provider-error {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-word;
  opacity: 0.9;
}

.sources { margin-top: 1rem; }
.sources summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.4rem 0;
}
.source-list {
  list-style: none;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.95rem;
}
.source-list a { word-break: break-all; text-underline-offset: 0.15em; }
.source-path { opacity: 0.7; }

/* Historie – je Tag eine aufklappbare Box, rot bei Streik, grün ohne */
.days {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.day {
  /* --bg kommt aus .status-ja / .status-nein / .status-unbekannt auf diesem Element */
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 0.9rem;
  box-shadow: 0 0.15rem 0.5rem var(--shadow);
  overflow: hidden;
  /* Jeder Tag ist über #tag-JJJJ-MM-TT anspringbar – nicht am Rand kleben. */
  scroll-margin-top: 1rem;
}
/* Der über ?datum= gesuchte Tag: hervorgehoben, damit er in der Liste auffällt. */
.day--treffer {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 0.15rem 0.5rem var(--shadow);
}
.day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.98rem;
}
.day-head::-webkit-details-marker { display: none; }
.day-head::after {
  content: "▸";
  margin-left: auto;
  font-size: 0.9rem;
  opacity: 0.8;
  transition: transform 0.2s ease;
}
.day-details[open] > .day-head::after { transform: rotate(90deg); }
.day-details[open] > .day-head { border-bottom: 1px solid var(--card-border); }
.day-head:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
.day-date { font-weight: 600; }
.day-verdict {
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 0.05rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
}
.day-note { font-size: 0.9rem; color: var(--muted); }

.day-body {
  padding: 0.9rem 1rem 1rem;
  background: rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.day-body > * { margin: 0; }
.day-providers { font-size: 0.9rem; color: var(--muted); }
.day-provider { white-space: nowrap; }
.day-notes { font-size: 0.9rem; }
.day-stand { font-size: 0.85rem; color: var(--muted); }

/* Archiv: Link zur Archivseite und Blätterleiste */
.days-more { margin-top: 1rem; text-align: center; }
.link-more, .link-back {
  display: inline-block;
  font-weight: 600;
  text-underline-offset: 0.2em;
  padding: 0.35rem 0.2rem;
  min-height: 2.75rem;
}
.link-back { text-transform: none; letter-spacing: 0; }
.link-more:focus-visible, .link-back:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.pager {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--card-border);
}
.pager-info { font-size: 0.95rem; color: var(--muted); }
/* Als <a> bzw. <span> gerendert – daher Display und Zentrierung hier selbst. */
.btn--pager {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9rem;
  padding: 0.6rem 1.2rem;
  text-decoration: none;
}
/* pointer-events aus, damit der Hover-Effekt von .btn hier nicht greift. */
.btn--pager[aria-disabled="true"] { opacity: 0.4; cursor: default; pointer-events: none; }

/* Statusleiste */
.status-bar {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--card-border);
}
.stand { font-size: 0.95rem; color: var(--muted); }
.stand-rel { opacity: 0.85; }
.stand-updating { font-style: italic; }

.btn {
  appearance: none;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.12);
  color: var(--fg);
  font: inherit;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  cursor: pointer;
  min-width: 12rem;
  min-height: 3rem;
  transition: background-color 0.2s, transform 0.1s;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.24); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.refresh-status {
  min-height: 1.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.refresh-status.error {
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 0.5rem;
  padding: 0.5rem 0.8rem;
}
.noscript { font-size: 0.95rem; }

.footer {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  padding-top: 0.5rem;
}

/* Größere Bildschirme */
@media (min-width: 640px) {
  .page { padding: 2.5rem 1.5rem 3rem; gap: 2rem; }
  .question { font-size: 2rem; }
  .heute-datum { font-size: 1.5rem; }
  .cards, .providers { grid-template-columns: 1fr 1fr; }
  .status-bar { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 1rem 1.5rem; }
  .refresh-status { flex-basis: 100%; }
  .pager { flex-direction: row; justify-content: space-between; gap: 1rem; }
  .datum-zeile { flex-direction: row; align-items: center; max-width: 26rem; }
  .datum-input { flex: 1 1 auto; }
  .btn--datum { flex: 0 0 auto; }
}
@media (min-width: 1024px) {
  .page { max-width: 60rem; }
  .answer-word { font-size: clamp(10rem, 18vw, 16rem); }
}

@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
  .spinner { animation-duration: 2.5s; }
  html { scroll-behavior: auto; }
}

@media print {
  body { background: #fff; color: #000; }
  /* --muted ist fast weiß und wäre auf Papier unsichtbar; das trifft Datum,
     Kicker, Untertitel und „Stand:" gleichermaßen. */
  html { --muted: #333333; }
  .btn, .refresh-status, .noscript, .pager, .datum-form { display: none; }
  .card, .provider { border-color: #999; background: none; }
  .day { border-color: #999; background: none; box-shadow: none; }
  .day-body { background: none; }
  .day-verdict { background: none; border: 1px solid #999; }
}
