/**
 * accessibility-fixes.css
 * ---------------------------------------------------------------------------
 * Sammeldatei für a11y-Overrides, die wir bewusst NICHT im Plugin-/Vendor-CSS
 * patchen. Wird in functions/enqueues.php mit hoher Priorität nach allen
 * anderen Stylesheets registriert.
 *
 * Projekt: AG0198 — Stiftung Haus Lindenhof Barrierefreiheits-Optimierung
 * Referenz: CLAUDE.md, TASKS_THEME_AUDIT.md
 */

/* ===========================================================================
 * Phase 3 — EA-R85 Complianz Cookie-Banner Kontrast (AAA 7:1)
 * ---------------------------------------------------------------------------
 * Eye-Able-Report:
 *   .cmplz-btn.cmplz-view-preferences  → 224 Vorkommen, Kontrast 5.11:1
 *   (AAA-Anforderung wäre ≥ 7:1).
 *
 * Plugin-Default (Custom-Properties auf :root):
 *   --cmplz_button_settings_text_color:       #5a7645   (CI-Grün)
 *   --cmplz_button_settings_background_color: #fff
 *   --cmplz_button_settings_border_color:     #fff      ← unsichtbar auf Weiß
 *
 * Strategie: Die Plugin-Custom-Properties auf `.cmplz-cookiebanner`
 * neu definieren (höhere Spezifität als `:root` → kein !important nötig).
 * Greift auf cmplz-view-preferences UND cmplz-save-preferences (gleiche Var).
 *
 * Gewählter Farbton: #3f5330 — abgedunkeltes Lindenhof-Grün
 *   • Auf #fff: Kontrast ~ 8.7:1   → erfüllt AAA mit Puffer
 *   • Behält Hue/Saturation des CI-Grüns bei (Lightness reduziert)
 *
 * Hinweis: CI-Grün im restlichen Theme bleibt unangetastet — eine globale
 * Farbänderung gehört in Phase 4 mit Kundenfreigabe.
 * =========================================================================== */
.cmplz-cookiebanner {
    --cmplz_button_settings_text_color:       #3f5330;
    --cmplz_button_settings_border_color:     #3f5330;
    /* Hintergrund bleibt weiß — keine optische Umgestaltung */
}

/* Hover/Focus: invertieren, damit der Button als Button erkennbar bleibt
 * und der Fokus-Zustand klar sichtbar ist (zusätzlich zum Browser-Outline). */
.cmplz-cookiebanner .cmplz-btn.cmplz-view-preferences:hover,
.cmplz-cookiebanner .cmplz-btn.cmplz-view-preferences:focus,
.cmplz-cookiebanner .cmplz-btn.cmplz-save-preferences:hover,
.cmplz-cookiebanner .cmplz-btn.cmplz-save-preferences:focus {
    color: #ffffff;
    background-color: #3f5330;
    border-color: #3f5330;
}

/* ===========================================================================
 * Phase 4 — EA-R23 (AA) + EA-R85 (AAA) CI-Farbpalette
 * ---------------------------------------------------------------------------
 * Vier CI-Farben reißen WCAG-AA auf Weiß (BFSG-pflichtig):
 *   #cc5f00 Orange       → 4.04 : 1   (R23 256× + R85 127×)
 *   #ee7f00 Orange-hell  → 2.74 : 1   (R23 60×)
 *   #be9b53 Beige        → 2.62 : 1   (R23 14×)
 *   #e4c769 Hellgelb     → 1.66 : 1   (Lookout — vermutlich auf Weiß seltener)
 *
 * Zwei Quellen-Typen werden hier abgedeckt:
 *   1. Inline-Styles im Output  (style="color:#cc5f00")
 *      → Attribut-Selektor matched alle Varianten.
 *   2. Theme-Templates mit `<style>color:<?= $colorcode ?></style>`
 *      → Output ist ebenfalls Inline → derselbe Selektor greift.
 *
 * Hartcodierte Hex-Werte im Theme-CSS (94+16+15+11 Vorkommen) wurden
 * separat direkt durch die neuen Hex-Werte ersetzt (siehe Commit-Diff
 * von assets/css/style.css und assets/css/page-css/general-template-page-style.css).
 *
 * Die ACF-Field-Choices und DB-Werte bleiben UNVERÄNDERT — eine spätere
 * Rückkehr zur Originalpalette ist eine einzeilige CSS-Änderung pro Farbe.
 *
 * Hinweis Hellgelb: #e4c769 ist auf Weiß strukturell kaum AA-machbar ohne
 * massiven Look-Change. Wir mappen auf Dunkel-Oliv #5c4f1e (8.18 : 1).
 * Falls Hellgelb überwiegend auf dunkleren Hintergründen verwendet wird,
 * lohnt sich eine zweite Klärung mit der Redaktion — siehe phase-4-report.md.
 * =========================================================================== */
:root {
    /* Original-Wert kommentiert, neuer Wert AA/AAA-konform. */
    --shl-orange:        #8b3f00;  /* war #cc5f00 — 4.04 → 7.48 (AAA) */
    --shl-orange-light:  #a64a00;  /* war #ee7f00 — 2.74 → 5.71 (AA)  */
    --shl-beige:         #6d5933;  /* war #be9b53 — 2.62 → 6.46 (AA)  */
    --shl-yellow-dark:   #5c4f1e;  /* war #e4c769 — 1.66 → 8.18 (AAA) */
}

/* === Inline-Style-Mapping: color ===
   Matched sowohl "color:#cc5f00" als auch "color: #cc5f00" (case-insensitive). */

[style*="color:#cc5f00" i],
[style*="color: #cc5f00" i] {
    color: var(--shl-orange) !important;
}

[style*="color:#ee7f00" i],
[style*="color: #ee7f00" i] {
    color: var(--shl-orange-light) !important;
}

[style*="color:#be9b53" i],
[style*="color: #be9b53" i] {
    color: var(--shl-beige) !important;
}

[style*="color:#e4c769" i],
[style*="color: #e4c769" i] {
    color: var(--shl-yellow-dark) !important;
}

/* === Inline-Style-Mapping: background / background-color === */

[style*="background:#cc5f00" i],
[style*="background-color:#cc5f00" i],
[style*="background: #cc5f00" i],
[style*="background-color: #cc5f00" i] {
    background-color: var(--shl-orange) !important;
}

[style*="background:#ee7f00" i],
[style*="background-color:#ee7f00" i],
[style*="background: #ee7f00" i],
[style*="background-color: #ee7f00" i] {
    background-color: var(--shl-orange-light) !important;
}

[style*="background:#be9b53" i],
[style*="background-color:#be9b53" i],
[style*="background: #be9b53" i],
[style*="background-color: #be9b53" i] {
    background-color: var(--shl-beige) !important;
}

[style*="background:#e4c769" i],
[style*="background-color:#e4c769" i],
[style*="background: #e4c769" i],
[style*="background-color: #e4c769" i] {
    background-color: var(--shl-yellow-dark) !important;
}

/* ===========================================================================
 * Phase 4b — Bootstrap-Default-Link-Farbe in Bildungscampus-Tabellen
 * ---------------------------------------------------------------------------
 * Auf /bildungscampus-uebersicht/ und Kategorie-Archiven rendern die
 * Kurs-Titel als blaue Default-Links (Bootstrap `--primary: #007bff`),
 * die auf Weiß nur 3.97:1 (AA fehlt) und auf dem Light-Green-
 * Zebra-Hintergrund #eff1ec nur 3.49:1 erreichen.
 *
 * Override-Selektor zielt direkt auf die zwei Templates der Tabelle:
 *   - templates/event-list.php
 *   - taxonomy-Category-bildungscampus.php
 *
 * Gewählter Farbton: #1a4d99 → 8.33:1 auf Weiß (AAA). Bleibt eindeutig
 * als Link erkennbar (kräftiges Blau, mit Underline aus Theme-Default).
 * =========================================================================== */
.campus-list-table a,
.campus-list-tabel-wrapper a {
    color: #1a4d99;
}
.campus-list-table a:hover,
.campus-list-table a:focus,
.campus-list-tabel-wrapper a:hover,
.campus-list-tabel-wrapper a:focus {
    color: #0d3066; /* noch dunkler im Hover, 11.1:1 auf Weiß */
}

/* ===========================================================================
 * Phase 6 — Skip-Link für Tastatur-Navigation
 * ---------------------------------------------------------------------------
 * Visuell versteckt bis :focus. Springt zu #main-content (Anker direkt
 * nach </header> in header.php).
 *
 * WCAG 2.4.1 (Bypass Blocks, Level A) — BFSG-pflichtig.
 * =========================================================================== */
.shl-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100000;
    padding: 12px 20px;
    background: #1a1a1a;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    border: 2px solid #ffffff;
    border-radius: 0 0 6px 0;
}
.shl-skip-link:focus {
    left: 0;
    outline: 3px solid #1a4d99;
    outline-offset: 2px;
}
/* Anker selbst ist visuell nicht sichtbar */
#main-content {
    display: block;
    height: 0;
    overflow: hidden;
}

/* ===========================================================================
 * Phase 6 — Wasserzeichen-Style auch für umgewandeltes <span> beibehalten
 * ---------------------------------------------------------------------------
 * Der Output-Filter in functions/accessibility-fixes.php ersetzt das
 * dekorative <h2> in .fakten-title durch ein <span class="fakten-title-deko">.
 * Die Original-CSS-Regel `.fakten-title h2` greift dann nicht mehr;
 * wir spiegeln dieselben visuellen Werte hier auf den span-Selektor.
 *
 * Opacity-Anpassung: WCAG 1.4.3 (AA) fordert für Large Text
 * (≥ 24 px regular oder ≥ 18.66 px bold) mindestens 3:1 Kontrast.
 * Bei font-size:80px ist das klar Large; Wert 0.65 erreicht ~3.5:1
 * → konform mit Sicherheits-Puffer, optisch deutlich sichtbarer als
 * vorher (war 0.12 = 1.22:1, blasses Ghost-Pattern).
 *
 * Diese Anpassung ist ein bewusster visueller Eingriff. Falls die
 * Redaktion den extrem blassen Effekt zurück möchte, müssten die
 * `<h2>`-Headings in den Templates inhaltlich ersetzt werden
 * (z. B. durch ein dekoratives Pseudo-Element ohne Text).
 * =========================================================================== */
.fakten-title .fakten-title-deko {
    display: flex;
    flex-direction: column;
    font-size: 80px;
    line-height: 54px;
    font-family: 'FiraSans-Bold';
    position: relative;
    margin-left: -84px;
    color: rgba(84, 55, 138, 0.65);
}
