/* ==========================================================================
   Wildeshausen-App — „Alle Termine“ in der Ansicht „Erleben“
   Gehört zu assets/termine.js. Optik wie die großen Termine in style.css:
   Rot #ba092f als Akzent, Text #4d4e53, Grau #686971, var(--ui),
   border-radius 0, keine Schatten, Klickflächen >= 44 px.
   Die Kopfzeile nutzt die globale h2-Form (kleine Kapitälchen mit Linie).
   ========================================================================== */

.ta {
  margin-top: 22px;
  color: var(--ink-2);
}

/* Kopf: „Alle Termine“ + Zähler */
.ta-kopf { margin-top: 0; }
.ta-kopf em {
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);        /* Zähler lesbar, nicht in der hellen Linienfarbe */
  font-variant-numeric: tabular-nums;
}

/* Liste */
.ta-liste {
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.ta-zeile {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: start;
  min-height: var(--tap);                  /* Zeile bleibt antippbar hoch */
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.ta-zeile:last-child { border-bottom: 0; }

/* Einzelner Termin in den Kalender: eigener Knopf je Zeile (44 px Fläche) */
.ta-kal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: var(--tap);
  min-height: var(--tap);
  margin-left: 4px;
  padding: 0 8px;
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  /* Kalender-Knopf ist ein Bedienelement: 1.4.11 verlangt 3:1 gegen die
     Umgebung. #686971 liegt auf Weiß bei 5,46:1 (var(--line-strong): 1,48:1). */
  border: 1px solid var(--line-ui, #686971);
  border-radius: 0;
  cursor: pointer;
}
.ta-kal-text { display: none; }                 /* mobil nur das Symbol */
.ta-kal-icon { display: block; flex: none; }
.ta-kal:hover { color: var(--accent); border-color: var(--accent); }
.ta-kal:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ta-kal.ist-geladen { color: #fff; background: var(--accent); border-color: var(--accent); }
.ta-kal.ist-geladen .ta-kal-text { color: #fff; }

@media (min-width: 900px) {
  .ta-kal { padding: 0 12px; }
  .ta-kal-text { display: inline; }
}

/* Datum/Zeit links */
.ta-wann { font-variant-numeric: tabular-nums; }
.ta-wann b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--accent);
}
.ta-wann span {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--muted);
}

/* Titel/Untertitel rechts */
.ta-text { min-width: 0; }
.ta-titel {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.ta-ort {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.ta-leer {
  padding: 14px 0;
  font-size: 13px;
  color: var(--muted);
}

/* Fuß: Hinweis und Kalender-Knopf */
.ta-fuss {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
}
.ta-hinweis {
  max-width: 48ch;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.ta-dl {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: var(--tap);
  padding: 0 16px;
  font-family: var(--ui);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  color: #ffffff;
  text-decoration: none;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0;
  -webkit-tap-highlight-color: transparent;
}
.ta-dl:hover,
.ta-dl:active { background: var(--accent-ink); border-color: var(--accent-ink); }
.ta-dl:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.ta-dl-pfeil { font-size: 14px; line-height: 1; }

/* Ab 900 px steht mehr Breite zur Verfügung – Datumsspalte wie bei den großen Terminen */
@media (min-width: 900px) {
  .ta-zeile { grid-template-columns: 96px minmax(0, 1fr) auto; }
  .ta-titel { font-size: 14px; }
  .ta-ort { font-size: 12.5px; }
}

/* Sehr schmale Geräte: Datumsspalte schrumpfen, nichts darf überlaufen */
@media (max-width: 380px) {
  .ta-zeile { grid-template-columns: 68px minmax(0, 1fr) auto; gap: 4px 10px; }
  .ta-dl { width: 100%; }
}

/* Kopfzeile: „Alle Termine“ und der Kalender-Knopf nebeneinander.
   Der Knopf sitzt oben, weil ihn am Ende einer 17-Zeilen-Liste niemand sucht. */
.ta-kopfzeile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 22px;
}
.ta-kopfzeile .ta-kopf { margin: 0; margin-right: auto; }
@media (max-width: 419px) {
  .ta-kopfzeile .ta-dl { width: 100%; justify-content: center; }
}

/* ---------- Kontrastmodus (forced-colors) -------------------------------
   Der „geladen“-Zustand war eine rote Fläche; im Systemmodus bleibt davon
   nichts übrig. Ein Umriss in Highlight hält die Rückmeldung sichtbar. */
@media (forced-colors: active) {
  .ta-kal.ist-geladen {
    outline: 2px solid Highlight;
    outline-offset: -2px;
    border-color: CanvasText;
  }
  .ta-dl { border: 2px solid CanvasText; }
  .ta-kal:focus-visible,
  .ta-dl:focus-visible { outline-color: Highlight; }
}
