/* Digitale Barrierefreiheit – Frontend */

:root {
    --dba11y-primary: #111827;
    --dba11y-secondary: #4b5563;
    --dba11y-bg: #ffffff;
    --dba11y-text: #111827;
    --dba11y-radius: 14px;
    --dba11y-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
    --dba11y-focus: #facc15;
}

/* Screenreader only */
.dba11y-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Skip link */
.dba11y-skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 999999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    background: var(--dba11y-primary);
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    transform: translateY(-220%);
    transition: transform 0.15s ease;
}

.dba11y-skip-link:focus,
.dba11y-skip-link:focus-visible {
    transform: translateY(0);
    outline: 3px solid var(--dba11y-focus);
    outline-offset: 2px;
}

/* Widget container */
.dba11y-widget {
    position: fixed;
    bottom: 1.25rem;
    z-index: 999999;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    font-size: 16px;
    line-height: 1.4;
    color: var(--dba11y-text);
}

.dba11y-pos-right { right: 1.25rem; }
.dba11y-pos-left { left: 1.25rem; }

/* Normalize box-sizing inside widget */
.dba11y-widget,
.dba11y-widget * {
    box-sizing: border-box;
}

/* Toggle button */
.dba11y-widget-toggle {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 999px;
    border: 0;
    cursor: pointer;
    background: linear-gradient(135deg, var(--dba11y-primary), var(--dba11y-secondary));
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dba11y-widget-toggle:hover { filter: brightness(1.06); }

.dba11y-widget-toggle:focus-visible {
    outline: 3px solid var(--dba11y-focus);
    outline-offset: 3px;
}

.dba11y-widget-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
}

/* Panel */
.dba11y-widget-panel {
    margin-top: 0.55rem;
    width: 20rem;
    max-width: 90vw;
    background: var(--dba11y-bg);
    color: var(--dba11y-text);
    border-radius: var(--dba11y-radius);
    border: 1px solid rgba(17, 24, 39, 0.14);
    box-shadow: var(--dba11y-shadow);
    overflow: hidden;
}

.dba11y-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(17, 24, 39, 0.10);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(6px);
}

.dba11y-widget-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.dba11y-widget-close {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    border: 1px solid rgba(17, 24, 39, 0.14);
    background: transparent;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
}

.dba11y-widget-close:hover { background: rgba(17, 24, 39, 0.06); }

.dba11y-widget-close:focus-visible {
    outline: 3px solid var(--dba11y-focus);
    outline-offset: 2px;
}

.dba11y-widget-content { padding: 0.95rem 1rem 1rem; }

/* Groups */
.dba11y-group + .dba11y-group {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(17, 24, 39, 0.10);
}

.dba11y-group-title {
    margin: 0 0 0.5rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: rgba(17, 24, 39, 0.85);
}

/* Buttons */
.dba11y-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 999px;
    border: 1px solid rgba(17, 24, 39, 0.16);
    background: rgba(17, 24, 39, 0.04);
    color: inherit;
    cursor: pointer;
    padding: 0.55rem 0.9rem;
    font-weight: 650;
    font-size: 0.9rem;
    text-decoration: none;
    user-select: none;
}

.dba11y-btn:hover { background: rgba(17, 24, 39, 0.08); }

.dba11y-btn:focus-visible {
    outline: 3px solid var(--dba11y-focus);
    outline-offset: 2px;
}

.dba11y-btn[aria-pressed="true"] {
    background: linear-gradient(135deg, var(--dba11y-primary), var(--dba11y-secondary));
    border-color: rgba(17, 24, 39, 0.08);
    color: #ffffff;
}

.dba11y-btn-secondary {
    width: auto;
    padding: 0.5rem 0.95rem;
    background: rgba(17, 24, 39, 0.06);
}

.dba11y-btn-tertiary {
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border-radius: 12px;
    font-weight: 800;
}

.dba11y-adjust {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0;
}

.dba11y-adjust-label {
    font-size: 0.9rem;
    font-weight: 650;
}

.dba11y-adjust-controls {
    display: inline-flex;
    gap: 0.35rem;
}

/* Footer */
.dba11y-widget-footer {
    margin-top: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dba11y-link {
    font-size: 0.88rem;
    color: var(--dba11y-primary);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.dba11y-link:focus-visible {
    outline: 3px solid var(--dba11y-focus);
    outline-offset: 2px;
}

/* High contrast mode */
html.dba11y-contrast,
body.dba11y-contrast {
    background-color: #000000 !important;
    color: #ffffff !important;
}

html.dba11y-contrast a,
body.dba11y-contrast a {
    color: #38bdf8 !important;
    text-decoration: underline !important;
    text-underline-offset: 0.15em;
}

html.dba11y-contrast input,
html.dba11y-contrast select,
html.dba11y-contrast textarea,
html.dba11y-contrast button,
body.dba11y-contrast input,
body.dba11y-contrast select,
body.dba11y-contrast textarea,
body.dba11y-contrast button {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

/* Link highlight */
html.dba11y-highlight-links a,
body.dba11y-highlight-links a {
    text-decoration: underline !important;
    text-decoration-thickness: max(2px, 0.12em);
    text-underline-offset: 0.15em;
}

html.dba11y-highlight-links a:focus-visible,
body.dba11y-highlight-links a:focus-visible {
    outline: 3px solid var(--dba11y-focus);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .dba11y-widget-panel,
    .dba11y-skip-link {
        transition: none;
    }
}

html.dba11y-reduce-motion *,
body.dba11y-reduce-motion * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
}

/* Line height */
html.dba11y-lineheight-150 body,
body.dba11y-lineheight-150 {
    line-height: 1.5 !important;
}

html.dba11y-lineheight-175 body,
body.dba11y-lineheight-175 {
    line-height: 1.75 !important;
}

/* Reading focus mask */
.dba11y-reading-mask {
    position: fixed;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 999998;
    pointer-events: none;
}

.dba11y-reading-mask-top { top: 0; height: 0; }
.dba11y-reading-mask-bottom { top: 0; bottom: 0; }

/* Ensure widget stays above mask */
.dba11y-widget { z-index: 999999; }


/* Widget offsets */
.dba11y-widget {
    bottom: var(--dba11y-widget-bottom, 1.25rem);
}
.dba11y-pos-right { right: var(--dba11y-widget-side, 1.25rem); }
.dba11y-pos-left  { left:  var(--dba11y-widget-side, 1.25rem); }

/* Focus ring enhancement */
html.dba11y-focus-ring :focus-visible,
body.dba11y-focus-ring :focus-visible {
    outline: 3px solid var(--dba11y-focus) !important;
    outline-offset: 2px !important;
}

/* Dyslexia / reading mode */
html.dba11y-dyslexia,
body.dba11y-dyslexia {
    font-family: Verdana, Tahoma, Arial, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial !important;
}

/* Reading column */
html.dba11y-reading-column main,
html.dba11y-reading-column [role="main"],
html.dba11y-reading-column #content,
html.dba11y-reading-column #main,
body.dba11y-reading-column main,
body.dba11y-reading-column [role="main"],
body.dba11y-reading-column #content,
body.dba11y-reading-column #main {
    max-width: 72ch !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Text spacing (WCAG 1.4.12 oriented) */
html.dba11y-textspace-1 body,
body.dba11y-textspace-1 {
    letter-spacing: 0.06em !important;
    word-spacing: 0.08em !important;
}
html.dba11y-textspace-1 p,
body.dba11y-textspace-1 p {
    margin-bottom: 1.5em !important;
}

html.dba11y-textspace-2 body,
body.dba11y-textspace-2 {
    letter-spacing: 0.12em !important;
    word-spacing: 0.16em !important;
}
html.dba11y-textspace-2 p,
body.dba11y-textspace-2 p {
    margin-bottom: 2em !important;
}

/* Media hint banner */
.dba11y-media-hint {
    margin: 0.75rem 0;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(17,24,39,0.14);
    background: rgba(17,24,39,0.04);
    color: inherit;
    font-size: 0.95rem;
}
.dba11y-media-hint p { margin: 0 0 0.35rem; }
.dba11y-media-hint-link { color: var(--dba11y-primary); text-decoration: underline; text-underline-offset: 0.15em; }

/* Footer badge */
.dba11y-footer-badge {
    position: fixed;
    left: 0.75rem;
    bottom: 0.75rem;
    z-index: 999997;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}
.dba11y-footer-badge-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.06);
    border: 1px solid rgba(17,24,39,0.14);
    color: var(--dba11y-text);
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}
.dba11y-footer-badge-link:focus-visible { outline: 3px solid var(--dba11y-focus); outline-offset: 2px; }

/* Report form */
.dba11y-report-form { max-width: 820px; }
.dba11y-report-grid { display: grid; grid-template-columns: 1fr; gap: 0.85rem; }
@media (min-width: 720px) {
    .dba11y-report-grid { grid-template-columns: 1fr 1fr; }
    .dba11y-field-full { grid-column: 1 / -1; }
}
.dba11y-field label { display: block; font-weight: 650; margin-bottom: 0.25rem; }
.dba11y-field input,
.dba11y-field textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(17,24,39,0.18);
    padding: 0.6rem 0.75rem;
    font: inherit;
}
.dba11y-report-submit {
    border: 0;
    border-radius: 999px;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, var(--dba11y-primary), var(--dba11y-secondary));
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.dba11y-report-submit:focus-visible { outline: 3px solid var(--dba11y-focus); outline-offset: 2px; }
.dba11y-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }


/* Info page table */
.dba11y-info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0 1rem;
    border: 1px solid rgba(17,24,39,0.14);
    border-radius: 12px;
    overflow: hidden;
    font-size: 0.95rem;
}
.dba11y-info-table th,
.dba11y-info-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(17,24,39,0.10);
    vertical-align: top;
}
.dba11y-info-table thead th {
    background: rgba(17,24,39,0.04);
    text-align: left;
}
@media (max-width: 720px) {
    .dba11y-info-table thead {
        display: none;
    }
    .dba11y-info-table, .dba11y-info-table tbody, .dba11y-info-table tr, .dba11y-info-table td {
        display: block;
        width: 100%;
    }
    .dba11y-info-table tr {
        border-bottom: 1px solid rgba(17,24,39,0.10);
        padding: 0.25rem 0;
    }
    .dba11y-info-table td {
        border: 0;
        padding: 0.35rem 0.75rem;
    }
}
