/* ───── Barrierefreiheits-Leiste ───── */

/* Skip-to-Content Link */
.a11y-skip {
    position: absolute;
    top: -100px;
    left: 0;
    z-index: 9999;
    padding: 8px 16px;
    background: var(--petrol-dark, #2a5568);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 6px 0;
    transition: top 0.15s;
}
.a11y-skip:focus {
    top: 0;
    outline: 3px solid var(--ocker, #c89a54);
    outline-offset: 2px;
}

/* Wrapper */
.a11y-wrapper {
    position: relative;
}

/* Buttons in der Brand-Bar */
.brand-bar-a11y {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.a11y-toggle-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.75);
    padding: 4px 9px;
    border-radius: 4px;
    line-height: 1.3;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.a11y-toggle-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.6);
}
.a11y-toggle-btn:focus-visible {
    outline: 3px solid var(--ocker, #c89a54);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .a11y-toggle-btn { font-size: 0.68rem; padding: 3px 7px; }
}

/* Aufklappbares Panel */
.a11y-panel {
    padding: 16px 20px 20px;
    background: #f2f0eb;
    border-top: 1px solid #e0ddd6;
}

/* Panel-Footer mit Reset-Button */
.a11y-panel-footer {
    display: flex;
    justify-content: flex-end;
    padding: 10px 0 0;
    max-width: 1240px;
    margin: 0 auto;
}

.a11y-panel-reset-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    color: #888;
    padding: 4px 2px;
    line-height: 1.3;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}
.a11y-panel-reset-btn:hover {
    color: #444;
}
.a11y-panel-reset-btn:focus-visible {
    outline: 3px solid var(--ocker, #c89a54);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Karten-Container */
.a11y-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    max-width: 1240px;
    margin: 0 auto;
}

/* Einzelne Karte */
.a11y-card {
    background: #fff;
    border: 1px solid #e5e1d8;
    border-radius: 8px;
    padding: 20px;
    flex: 1 1 220px;
    max-width: 300px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

@media (max-width: 640px) {
    .a11y-panel {
        overflow-x: auto;
        overflow-y: hidden;
        padding: 12px 12px 16px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .a11y-cards {
        flex-wrap: nowrap;
        min-width: max-content;
        justify-content: flex-start;
    }
    .a11y-card {
        flex: none;
        width: 210px;
        max-width: none;
    }
}

.a11y-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #2a2a2a;
    line-height: 1.3;
}

.a11y-card-icon {
    font-size: 1rem;
    line-height: 1;
    color: #555;
}
.a11y-icon-italic {
    font-style: italic;
    font-family: Georgia, serif;
}

.a11y-card-rule {
    border: none;
    border-top: 1px solid #e5e1d8;
    margin: 0 0 10px;
}

.a11y-card-desc {
    font-size: 0.78rem;
    color: #6b6b6b;
    margin: 0 0 12px;
    line-height: 1.4;
}

/* ── Stepper (Zeilenabstand) ── */
.a11y-stepper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.a11y-step-btn {
    min-width: 44px;
    height: 36px;
    background: #f7f5f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: #333;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.a11y-step-btn:hover {
    background: #ede9e0;
}
.a11y-step-btn:focus-visible {
    outline: 3px solid var(--ocker, #c89a54);
    outline-offset: 2px;
}

.a11y-stepper-icons {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    flex: 1;
    justify-content: center;
    padding: 0 4px;
}

.a11y-lh-icon {
    display: block;
    font-size: 0.7rem;
    line-height: 1;
    color: #888;
    transition: font-size 0.2s;
}
.a11y-lh-sm { font-size: 0.65rem; }
.a11y-lh-md { font-size: 0.75rem; }
.a11y-lh-lg { font-size: 0.85rem; }

/* Wachsende Darstellung je Stufe */
.a11y-lh-step-2 .a11y-lh-sm { font-size: 0.7rem; }
.a11y-lh-step-2 .a11y-lh-md { font-size: 0.85rem; }
.a11y-lh-step-2 .a11y-lh-lg { font-size: 1.0rem; }

.a11y-lh-step-3 .a11y-lh-sm { font-size: 0.75rem; }
.a11y-lh-step-3 .a11y-lh-md { font-size: 0.95rem; }
.a11y-lh-step-3 .a11y-lh-lg { font-size: 1.15rem; }

.a11y-lh-step-4 .a11y-lh-sm { font-size: 0.8rem; }
.a11y-lh-step-4 .a11y-lh-md { font-size: 1.05rem; }
.a11y-lh-step-4 .a11y-lh-lg { font-size: 1.3rem; }

.a11y-stepper-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    min-width: 20px;
    text-align: center;
}

/* ── Schriftgröße-Icons ── */
.a11y-fs-icons {
    display: flex;
    align-items: baseline;
    gap: 3px;
    flex: 1;
    padding: 0 4px;
}
.a11y-fs-icon {
    font-weight: 700;
    color: #888;
    line-height: 1;
    transition: font-size 0.2s;
}
.a11y-fs-sm { font-size: 0.75rem; }
.a11y-fs-lg { font-size: 1.1rem; }

.a11y-fs-step-2 .a11y-fs-sm { font-size: 0.85rem; }
.a11y-fs-step-2 .a11y-fs-lg { font-size: 1.25rem; }

.a11y-fs-step-3 .a11y-fs-sm { font-size: 0.95rem; }
.a11y-fs-step-3 .a11y-fs-lg { font-size: 1.45rem; }

.a11y-fs-step-4 .a11y-fs-sm { font-size: 1.05rem; }
.a11y-fs-step-4 .a11y-fs-lg { font-size: 1.65rem; }

/* ── Schriftart-Select ── */
.a11y-select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f7f5f0;
    font-size: 0.85rem;
    color: #333;
    cursor: pointer;
}
.a11y-select:focus-visible {
    outline: 3px solid var(--ocker, #c89a54);
    outline-offset: 2px;
}

/* ── Kontrast-Swatches ── */
.a11y-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.a11y-swatch {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: 2px solid transparent;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: outline 0.1s;
    line-height: 1;
}
.a11y-swatch:focus-visible {
    outline: 3px solid var(--ocker, #c89a54);
    outline-offset: 2px;
}
.a11y-swatch[aria-pressed="true"] {
    outline: 3px solid var(--ocker, #c89a54);
    outline-offset: 2px;
}

/* Swatch-Farben (angelehnt an IDRC-Vorlagen) */
.swatch-default { background: #fff; color: #333; border-color: #ccc; }
.swatch-default::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        #ccc 0px, #ccc 1px,
        transparent 1px, transparent 6px
    );
    border-radius: 3px;
    pointer-events: none;
}
.swatch-default { position: relative; overflow: hidden; }
.swatch-bw    { background: #000; color: #fff; border-color: #000; }
.swatch-yb    { background: #000; color: #ffff00; border-color: #000; }
.swatch-by    { background: #ffff00; color: #000; border-color: #888; }
.swatch-dark1 { background: #2a2a2a; color: #e8e8e8; border-color: #555; }
.swatch-dark2 { background: #1a1a1a; color: #aaaaaa; border-color: #444; }
.swatch-light { background: #888888; color: #ffffff; border-color: #666; }
.swatch-tan   { background: #2a1a0a; color: #f5e6d0; border-color: #5a3a1a; }

/* ───── Zeilenabstand via CSS-Variable ───── */
body {
    line-height: var(--a11y-lh, 1.65);
}
.site-content p,
.gh-content p {
    line-height: var(--a11y-lh, var(--typo-body-lh, 1.65));
}

/* ───── Schriftgröße via CSS-Variable ───── */
body {
    font-size: calc(var(--typo-body-size, 16px) * var(--a11y-fs, 1));
}

/* Termin-Elemente mit festen px-Größen explizit skalieren */
.termin-row .t-when         { font-size: calc(12px * var(--a11y-fs, 1)); }
.termin-row .t-when .t-time { font-size: calc(11px * var(--a11y-fs, 1)); }
.termin-row .t-title        { font-size: calc(14px * var(--a11y-fs, 1)); }
.termin-row .t-ort          { font-size: calc(12px * var(--a11y-fs, 1)); }

.termin-compact-day         { font-size: calc(13px * var(--a11y-fs, 1)); }
.termin-compact-date        { font-size: calc(16px * var(--a11y-fs, 1)); }
.termin-compact-time        { font-size: calc(14px * var(--a11y-fs, 1)); }
.termin-compact-title       { font-size: calc(17px * var(--a11y-fs, 1)); }
.termin-compact-place       { font-size: calc(14px * var(--a11y-fs, 1)); }

.termin-meta                { font-size: calc(20px * var(--a11y-fs, 1)); }
.termin-date-day            { font-size: calc(16px * var(--a11y-fs, 1)); }
.termin-date-num            { font-size: calc(20px * var(--a11y-fs, 1)); }
.termin-date-time           { font-size: calc(18px * var(--a11y-fs, 1)); }
h2.termin-title             { font-size: calc(23px * var(--a11y-fs, 1)); }
.termin-liturg              { font-size: calc(18px * var(--a11y-fs, 1)); }
.termin-place               { font-size: calc(18px * var(--a11y-fs, 1)); }
.termin-desc-short          { font-size: calc(20px * var(--a11y-fs, 1)); }
.termin-desc-long           { font-size: calc(20px * var(--a11y-fs, 1)); }
.termin-desc-long > summary { font-size: calc(18px * var(--a11y-fs, 1)); }
.termin-source              { font-size: calc(18px * var(--a11y-fs, 1)); }

/* ───── Kontrastmodi ───── */
html.a11y-bw {
    --bg: #000000;
    --bg-muted: #111111;
    --bg-card: #111111;
    --text: #ffffff;
    --text-muted: #dddddd;
    --text-faded: #aaaaaa;
    --border: #444444;
    --border-muted: #333333;
}
html.a11y-bw body { background: #000 !important; color: #fff !important; }

html.a11y-yb {
    --bg: #000000;
    --bg-muted: #0a0a00;
    --bg-card: #111100;
    --text: #ffff00;
    --text-muted: #eeee00;
    --text-faded: #cccc00;
    --border: #444400;
    --border-muted: #333300;
}
html.a11y-yb body { background: #000 !important; color: #ffff00 !important; }

html.a11y-by {
    --bg: #ffff00;
    --bg-muted: #eeee00;
    --bg-card: #ffff00;
    --text: #000000;
    --text-muted: #111111;
    --text-faded: #333333;
    --border: #999900;
    --border-muted: #bbbb00;
}
html.a11y-by body { background: #ffff00 !important; color: #000 !important; }

html.a11y-dark1 {
    --bg: #2a2a2a;
    --bg-muted: #333333;
    --bg-card: #383838;
    --text: #e8e8e8;
    --text-muted: #bbbbbb;
    --text-faded: #888888;
    --border: #555555;
    --border-muted: #444444;
}
html.a11y-dark1 body { background: #2a2a2a !important; color: #e8e8e8 !important; }

html.a11y-dark2 {
    --bg: #1a1a1a;
    --bg-muted: #222222;
    --bg-card: #272727;
    --text: #cccccc;
    --text-muted: #999999;
    --text-faded: #666666;
    --border: #444444;
    --border-muted: #333333;
}
html.a11y-dark2 body { background: #1a1a1a !important; color: #ccc !important; }

html.a11y-light {
    --bg: #888888;
    --bg-muted: #999999;
    --bg-card: #9a9a9a;
    --text: #ffffff;
    --text-muted: #eeeeee;
    --text-faded: #dddddd;
    --border: #666666;
    --border-muted: #777777;
}
html.a11y-light body { background: #888 !important; color: #fff !important; }

html.a11y-tan {
    --bg: #2a1a0a;
    --bg-muted: #3a2a1a;
    --bg-card: #3f2f1f;
    --text: #f5e6d0;
    --text-muted: #ddc8a8;
    --text-faded: #b89870;
    --border: #5a3a1a;
    --border-muted: #4a2a0a;
}
html.a11y-tan body { background: #2a1a0a !important; color: #f5e6d0 !important; }

/* Kontrastmodi: allgemeine Überschreibungen */
html[class*="a11y-bw"] a,
html[class*="a11y-yb"] a,
html[class*="a11y-dark1"] a,
html[class*="a11y-dark2"] a,
html[class*="a11y-light"] a,
html[class*="a11y-tan"] a {
    color: var(--text-muted) !important;
}
html.a11y-by a { color: #0000cc !important; }

html[class*="a11y-"] h1,
html[class*="a11y-"] .page-title {
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* Kontrastmodi: alle Karten, Boxen und Listencontainer mit hartem #fff */
html[class*="a11y-"] .gh-card,
html[class*="a11y-"] .article,
html[class*="a11y-"] .panel,
html[class*="a11y-"] .a11y-card,
html[class*="a11y-"] .box,
html[class*="a11y-"] .losung-card,
html[class*="a11y-"] .termin-list,
html[class*="a11y-"] .termin-compact-list,
html[class*="a11y-"] .termin-compact-more,
html[class*="a11y-"] .home-col > h1 {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

/* Kontrastmodi: Formularelemente */
html[class*="a11y-"] .termin-filter input,
html[class*="a11y-"] .termin-filter select,
html[class*="a11y-"] .termin-filter-reset,
html[class*="a11y-"] .termin-more-btn,
html[class*="a11y-"] .a11y-select {
    background: var(--bg-muted) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* Kontrastmodi: Navigation und Brand-Bar bleiben lesbar */
html[class*="a11y-"] .kgnav {
    background: var(--nav-dark, #3a3f4a) !important;
}

/* ───── Font-Modes ───── */
html.a11y-font-sans body,
html.a11y-font-sans p,
html.a11y-font-sans li,
html.a11y-font-sans td { font-family: Arial, Helvetica, sans-serif !important; }

html.a11y-font-serif body,
html.a11y-font-serif p,
html.a11y-font-serif li,
html.a11y-font-serif td { font-family: Georgia, "Times New Roman", serif !important; }

html.a11y-font-mono body,
html.a11y-font-mono p,
html.a11y-font-mono li,
html.a11y-font-mono td { font-family: "Courier New", Courier, monospace !important; }

/* ───── Responsive ───── */
@media (max-width: 480px) {
    .a11y-card { width: 200px; }
    .a11y-topbar { padding: 4px 10px; }
    .a11y-panel { padding: 10px 10px 14px; }
}
