/* ============================================================
   Sängerfest — mobile Programmseite
   Vanilla CSS, mobile-first, kein Framework, keine externen Dateien.
   ============================================================ */

/* ---------- Design-Tokens ---------- */
:root {
  color-scheme: light;

  --bg: #faf4e8;
  --surface: #fffdf7;
  --surface-2: #f3e9d6;
  --text: #241a10;
  --text-soft: #5d5040;
  --accent: #7a4314;
  --accent-ink: #fffdf7;
  --accent-soft: #efdfc2;
  --border: #e2d4bb;
  --focus: #0b4a8b;
  --slash: #b3261e;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(36, 26, 16, 0.08), 0 4px 14px rgba(36, 26, 16, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #1c1610;
    --surface: #262019;
    --surface-2: #32291f;
    --text: #f3e9d9;
    --text-soft: #c3b39c;
    --accent: #dda15e;
    --accent-ink: #20150a;
    --accent-soft: #44351f;
    --border: #463925;
    --focus: #6db0ff;
    --slash: #ef7b70;
  }
}

/* ---------- Basis ---------- */
* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
}

a, button { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* programmatisch fokussierte Überschriften ohne Rahmen */
h1[tabindex="-1"], h2[tabindex="-1"] { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.app {
  max-width: 44rem;
  margin: 0 auto;
  min-height: 100dvh;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 56px;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

.btn--block { width: 100%; }

.btn--back {
  background: transparent;
  border-color: transparent;
  padding-left: 0.25rem;
  padding-right: 0.75rem;
}

.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.btn__icon { display: inline-flex; width: 1.25em; height: 1.25em; }
.btn__icon svg { width: 100%; height: 100%; }

/* ---------- Stumm-Gate ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 1.5rem) 1.25rem calc(env(safe-area-inset-bottom) + 1.5rem);
  background: var(--bg);
  overflow-y: auto;
}

.gate__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 30rem;
}

.gate__icon {
  width: 35vmin;
  height: 35vmin;
  color: var(--text);
}
.gate__icon .bell-slash {
  stroke: var(--slash);
  stroke-width: 2.4;
}

.gate__titel {
  margin: 0;
  font-size: clamp(1.9rem, 8.5vw, 3rem);
  line-height: 1.15;
  font-weight: 800;
}

.gate__text {
  margin: 0;
  font-size: 1.15rem;
  color: var(--text-soft);
}

.gate__button {
  margin-top: 0.75rem;
  width: 100%;
  min-height: 64px;
  padding: 0.9rem 1.25rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- Ablauf (Startansicht) ---------- */
.ablauf__kopf {
  padding: calc(env(safe-area-inset-top) + 1.75rem) 1.25rem 1.5rem;
}

.ablauf__titel {
  margin: 0 0 0.35rem;
  font-size: 1.7rem;
  line-height: 1.2;
  font-weight: 800;
  overflow-wrap: break-word;
}

.ablauf__untertitel {
  margin: 0 0 0.3rem;
  font-size: 1.2rem;
  color: var(--text-soft);
}

.ablauf__meta {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-soft);
}

.ablauf__liste {
  list-style: none;
  margin: 0;
  padding: 0 1.25rem calc(env(safe-area-inset-bottom) + 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* ---------- Programmpunkte ---------- */
.punkt {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.punkt--info {
  background: transparent;
  border: 0;
  border-left: 3px solid var(--border);
  border-radius: 0;
}

/* <li> um einen Link ist nur Hülle; die Karte ist der Link selbst */
li.punkt--lied,
li.punkt--predigt {
  display: block;
  padding: 0;
  border: 0;
  background: none;
}

a.punkt__link {
  width: 100%;
  box-sizing: border-box;
  min-height: 56px;
  text-decoration: none;
  color: var(--text);
}

.punkt__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.punkt__zeit {
  flex: 0 0 auto;
  min-width: 3rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text-soft);
}

.punkt__titel {
  font-weight: 700;
  font-size: 1.15rem;
  overflow-wrap: break-word;
}

.punkt__untertitel {
  color: var(--text-soft);
  font-size: 1rem;
  overflow-wrap: break-word;
}

.punkt__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}
.punkt__icon svg { width: 1.5rem; height: 1.5rem; }

.punkt__chevron {
  flex: 0 0 auto;
  display: inline-flex;
  width: 1.4rem;
  height: 1.4rem;
  color: var(--text-soft);
}
.punkt__chevron svg { width: 100%; height: 100%; }

.punkt__check {
  flex: 0 0 auto;
  display: inline-flex;
  width: 1.4rem;
  height: 1.4rem;
  color: var(--accent);
}
.punkt__check svg { width: 100%; height: 100%; }

.punkt--opened { border-left: 4px solid var(--accent); }

@media (hover: hover) {
  a.punkt__link:hover { background: var(--surface-2); }
  .btn:hover { filter: brightness(1.05); }
  .fontctl__btn:hover { background: var(--surface-2); }
  .btn--back:hover { background: var(--surface-2); }
}

a.punkt__link:active { background: var(--surface-2); }

/* ---------- Liedansicht ---------- */
.view--lied {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.lied__kopf {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.6rem;
  row-gap: 0.35rem;
  padding: calc(env(safe-area-inset-top) + 0.5rem) 0.75rem 0.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.lied__kopf .btn--back { flex: 0 0 auto; }

.lied__kopf-titel {
  flex: 1 1 auto;
  min-width: 8rem;
}

.lied__titel {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.25;
  font-weight: 700;
  overflow-wrap: break-word;
}

.fontctl {
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-flex;
  gap: 0.25rem;
}

.fontctl__btn {
  min-width: 48px;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}
.fontctl__btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.lied__strophen {
  flex: 1;
  padding: 1.25rem 1.25rem 1.5rem;
}

.strophe {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1.4rem;
}
.strophe:last-child { margin-bottom: 0; }

.strophe__nummer {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--text-soft);
  font-size: 1rem;
  padding-top: 0.25rem;
}

.strophe__label {
  flex: 0 0 auto;
  font-style: italic;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding-top: 0.5rem;
}

.strophe__text {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Liberation Serif", serif;
  font-size: var(--lied-schrift, 22px);
  line-height: 1.5;
  white-space: pre-line;
}

.strophe--refrain {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
}
.strophe--refrain .strophe__text { font-style: italic; }

.lied__fuss {
  position: sticky;
  bottom: 0;
  padding: 0.75rem 1.25rem calc(env(safe-area-inset-bottom) + 0.75rem);
  background: var(--bg);
  border-top: 1px solid var(--border);
}

/* ---------- Predigt ---------- */
.view--predigt {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.predigt__kopf {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: calc(env(safe-area-inset-top) + 0.5rem) 0.75rem 0.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.predigt__kopf-titel { flex: 1; min-width: 0; }

.predigt__titel {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.25;
  font-weight: 700;
  overflow-wrap: break-word;
}

.predigt__prediger {
  margin: 0.1rem 0 0;
  font-size: 0.95rem;
  color: var(--text-soft);
}

.predigt__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
  touch-action: pan-y;
}

.folie { margin: 0; width: 100%; }

.folie--text { text-align: left; }

.folie__titel {
  margin: 0 0 1rem;
  font-size: 1.6rem;
  line-height: 1.2;
  font-weight: 800;
  overflow-wrap: break-word;
}

.folie__text {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  line-height: 1.55;
}

.folie__punkte {
  margin: 0;
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 1.2rem;
  line-height: 1.4;
}

.folie__bibelstelle {
  margin: 1rem 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
}

.folie__leer { color: var(--text-soft); }

.folie--bild {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-height: 100%;
}

.folie__bild {
  max-width: 100%;
  max-height: 62dvh;
  object-fit: contain;
  border-radius: 10px;
  background: #000;
}

.folie__unterschrift {
  color: var(--text-soft);
  font-size: 0.95rem;
}

.predigt__steuerung {
  position: sticky;
  bottom: 0;
  padding: 0.6rem 1.25rem calc(env(safe-area-inset-bottom) + 0.75rem);
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.predigt__zaehler {
  display: block;
  text-align: center;
  margin-bottom: 0.6rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-soft);
}

.predigt__fortschritt {
  height: 8px;
  margin-bottom: 0.7rem;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.predigt__fortschritt-balken {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.predigt__buttons {
  display: flex;
  gap: 0.75rem;
}
.predigt__buttons .btn { flex: 1; }

.btn--next {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
