/*
Theme Name: TSV Child (TT4)
Theme URI: https://www.tsv-eschollbruecken-eich.de/
Description: Child Theme für Twenty Twenty-Four. Layouts/Design versioniert, ohne Page Builder.
Author: TSV Eschollbrücken-Eich
Template: twentytwentyfour
Version: 1.1.0
Text Domain: tsv-child
*/

/* ------------------------------------------------------------
   Typografie
------------------------------------------------------------ */

h1 { font-size: 2.4rem; }
h2 { font-size: 1.6rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.15rem; }

/* ------------------------------------------------------------
   Accessibility: Skip-Link
   Quelle: W3C, WCAG 2.2, Success Criterion 2.4.1 Bypass Blocks (Level A)
   Nur bei Fokus sichtbar; positioniert über den anderen Inhalten.
------------------------------------------------------------ */

.tsv-skip-link {
  position: absolute;
  top: -9999px;
  left: 1rem;
  z-index: 9999;
  padding: 0.6rem 1.2rem;
  background: #172191;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  white-space: nowrap;
}

.tsv-skip-link:focus,
.tsv-skip-link:focus-visible {
  top: 0;
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   Accessibility: Fokus
   Robusteres Muster: outline nur bei :focus:not(:focus-visible) entfernen,
   damit Nutzer älterer Assistive-Technology-Clients keinen Fokusverlust erleiden.

   Vorher: :focus { outline: none } → Risiko bei fehlendem :focus-visible-Support
   Nachher: :focus:not(:focus-visible) { outline: none } → sicher für alle Clients

   Quelle: W3C, WCAG 2.2, Success Criterion 2.4.7 Focus Visible (Level AA)
   Quelle: W3C, WCAG 2.2, Success Criterion 2.4.11 Focus Appearance (Level AA, WCAG 2.2)
------------------------------------------------------------ */

:where(a, button, input, textarea, select, summary):focus:not(:focus-visible) {
  outline: none;
}

:where(
  a[href],
  button,
  input,
  textarea,
  select,
  summary,
  [role="button"],
  [role="link"]
):focus-visible {
  outline: none; /* box-shadow übernimmt als sichtbarer Fokus-Indikator */
  box-shadow: 0 0 0 3px #172191;
  border-radius: 10px;
}

:where(a[href]):focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #172191;
  border-radius: 6px;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.15em;
}

/* ------------------------------------------------------------
   Header / Navigation
------------------------------------------------------------ */

.tsv-header { border-bottom: 1px solid #e5e7eb; }

.wp-block-navigation a {
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  text-decoration: none;
}

.wp-block-navigation a:hover,
.wp-block-navigation a:focus-visible {
  background: #f3f4f6;
}

.wp-block-navigation__responsive-container-open { padding: 0.5rem; }

/* ------------------------------------------------------------
   Buttons
------------------------------------------------------------ */

.wp-block-button__link:hover,
.wp-block-button__link:focus-visible {
  filter: brightness(0.92);
}

/* ------------------------------------------------------------
   Layout / Abstände
------------------------------------------------------------ */

.wp-block-query { margin-bottom: 2rem; }

/* ------------------------------------------------------------
   Hero
   margin-bottom explizit per CSS – Block-Attribut "margin.bottom" greift
   nicht zuverlässig wenn theme.json appearanceTools deaktiviert ist.
------------------------------------------------------------ */

.tsv-hero {
  background: #f3f4f6;
  border-radius: 16px;
  margin-bottom: 2.5rem !important; /* Abstand zum nachfolgenden Abschnitt */
}

/* ------------------------------------------------------------
   Cards (News/Veranstaltungen)
------------------------------------------------------------ */

.tsv-cards .wp-block-post { margin-bottom: 0; }

.tsv-card {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  margin-bottom: 1.25rem;
  padding: 1rem;
}

.tsv-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.tsv-card.is-layout-flow,
.tsv-card.is-layout-flex {
  gap: 0 !important;
}

.tsv-card > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.tsv-card > * + * {
  margin-top: 0.75rem !important;
}

/* WordPress setzt per Inline-Style aspect-ratio:16/9 auf die <figure>.
   Wenn das <img> per max-height begrenzt wird, entsteht Leerraum INNERHALB der figure:
   figure reserviert ~420px (16:9 bei 750px Breite), img ist auf 260px begrenzt → ~160px Gap.
   Lösung: max-height auf dem Container (figure), overflow:hidden schneidet den Überstand ab.
   Quelle: W3C CSS Overflow Module Level 3, overflow property */
.tsv-card .wp-block-post-featured-image {
  margin: 0 !important;
  overflow: hidden;
  border-radius: 12px;
  max-height: 260px;
  line-height: 0;
}

.tsv-card .wp-block-post-featured-image a {
  display: block;
  line-height: 0;
  margin: 0;
}

.tsv-card .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0; /* Rundung liegt auf dem Container */
}

/* Meta-Text: #6b7280 auf #ffffff → Kontrast ~4,77:1, besteht WCAG AA (min. 4,5:1)
   Quelle: W3C, WCAG 2.2, Success Criterion 1.4.3 Contrast (Minimum, Level AA)
   Hinweis: Schriftgröße 0,95rem (≈17 px) < 18 px-Schwelle → normaler Text, 4,5:1 erforderlich */
.tsv-meta {
  font-size: 0.95rem;
  color: #6b7280;
}

.tsv-card h3 a { color: #172191; }
.tsv-card h3 a:hover { text-decoration: underline; }

.tsv-section-link { margin: 0; font-size: 1rem; }

/* ------------------------------------------------------------
   Abteilungs-Kacheln
   Mindest-Touch-Target: 24 × 24 CSS-Pixel für interaktive Elemente.
   Quelle: W3C, WCAG 2.2, Success Criterion 2.5.8 Target Size (Minimum, Level AA)
------------------------------------------------------------ */

.tsv-tile {
  background: #f3f4f6;
  border-radius: 16px;
  min-height: 110px;
}

.tsv-tile a {
  font-weight: 600;
  /* Mindest-Touch-Target sicherstellen */
  display: inline-flex;
  align-items: center;
  min-height: 44px;   /* Apple HIG / WCAG 2.5.8-kompatibel */
  min-width: 44px;
  padding: 0.5rem 0.75rem;
}

/* ------------------------------------------------------------
   Veranstaltungs-Infobox
   Quelle: Informationsarchitektur.md, Abschnitt 5.2 Veranstaltungs-Template
   <dl> = semantisch korrekt für strukturierte Metadaten
   Quelle: W3C HTML Standard, 4.9.9 The dl element
------------------------------------------------------------ */

.tsv-event-infobox {
  background: #f3f4f6;
  border-left: 4px solid #172191;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
}

.tsv-event-infobox dl { margin: 0; }

.tsv-event-infobox__row {
  display: flex;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.tsv-event-infobox__row:last-child { border-bottom: none; }

.tsv-event-infobox dt {
  font-weight: 600;
  min-width: 8rem;
  color: #374151;
}

.tsv-event-infobox dd {
  margin: 0;
  color: #111827;
}

/* ------------------------------------------------------------
   Footer
   Quelle: Informationsarchitektur.md, Abschnitt 2.2 Footer-Menü
------------------------------------------------------------ */

.tsv-footer {
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.tsv-footer__copy {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
}

/* Kontrast Footer-Navigation: Links erben #172191 über globales element.link */
.tsv-footer__nav a {
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
}

.tsv-footer__nav a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------
   Zurück-Link (single.html / single-veranstaltung.html)
------------------------------------------------------------ */

.tsv-back-link {
  margin-top: 2rem;
  font-size: 0.95rem;
}