/**
 * Frontend-Styles für [db_barrierefrei_check].
 * Nur auf Seiten geladen, die den Shortcode tatsächlich enthalten.
 */

.db-barrierefrei-check-widget {
    max-width: 1100px;
    margin: 0 auto;
}

/* Nur für Screenreader sichtbar (z.B. das <legend> der Suchkriterien) */
.db-check-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Formular ---- */

.db-check-form fieldset {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    border: 0;
    padding: 0;
    margin: 0 0 0.5rem;
}

.db-check-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.db-check-field label {
    font-weight: 600;
    font-size: 0.9rem;
}

.db-check-field input[type="text"],
.db-check-field select {
    padding: 0.5rem 0.65rem;
    border: 1px solid #767676; /* erfüllt 3:1 Kontrast für UI-Komponenten */
    border-radius: 4px;
    font-size: 1rem;
    min-width: 220px;
}

.db-check-submit {
    padding: 0.6rem 1.25rem;
    border: 1px solid #14532d;
    border-radius: 4px;
    background: #16a34a;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}

.db-check-submit:hover {
    background: #15803d;
}

.db-check-error {
    color: #991b1b;
    font-weight: 600;
    margin: 0.5rem 0 0;
}

/* Sichtbarer Fokus-Indikator auf allen interaktiven Elementen –
 * kein outline: none ohne gleichwertigen Ersatz. */
.db-check-field input[type="text"]:focus-visible,
.db-check-field select:focus-visible,
.db-check-submit:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
}

/* ---- Status / Trefferzahl ---- */

.db-check-status {
    margin: 1rem 0;
    font-weight: 600;
}

.db-check-load-more {
    display: block;
    margin: 1rem auto 0;
    padding: 0.55rem 1.5rem;
    border: 1px solid #16a34a;
    border-radius: 4px;
    background: #fff;
    color: #16a34a;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.db-check-load-more:hover:not(:disabled) {
    background: #f0fdf4;
}

.db-check-load-more:disabled {
    opacity: 0.6;
    cursor: default;
}

.db-check-load-more:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
}

/* ---- Ergebnisliste ---- */

.db-check-results {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.db-check-card {
    border: 1px solid #d1d5db;
    border-left: 3px solid #9ca3af;
    border-radius: 0 8px 8px 0;
    background: #fff;
    padding: 1rem 1.25rem;
}

.db-check-card--positive {
    border-left-color: #16a34a;
}

.db-check-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.db-check-card-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.db-check-card-state {
    font-size: 0.85rem;
    color: #4b5563;
    white-space: nowrap;
}

/* ---- Feld-Kacheln (Mini-Grid) ----
 * Jedes Feld ist eine eigene, klar begrenzte Box (Hintergrund + Radius)
 * statt einer Label-links/Wert-rechts-Zeile – verhindert, dass Werte
 * optisch mit dem Label des nächsten Feldes verschwimmen. */

.db-check-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
}

.db-check-tile {
    background: #f8fafc;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

.db-check-tile-label {
    font-size: 0.78rem;
    color: #4b5563;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.db-check-tile-note {
    font-size: 0.8rem;
    color: #4b5563;
    margin-top: 0.3rem;
}

/* ---- Aufklapper für Kontext-/Luxus-Felder ---- */

.db-check-details {
    margin-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 0.6rem;
}

.db-check-details summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: #1d4ed8;
    font-weight: 600;
    list-style: none;
}

.db-check-details summary::-webkit-details-marker {
    display: none;
}

.db-check-details summary::before {
    content: '▸ ';
}

.db-check-details[open] summary::before {
    content: '▾ ';
}

.db-check-details .db-check-field-grid {
    margin-top: 0.6rem;
}

.db-check-details summary:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- Badges ----
 * Farbe + Text + Icon: drei unabhängige Kennzeichen desselben Status,
 * wichtig u.a. bei Rot-Grün-Sehschwäche, wo Farbe allein den
 * Schnellscan-Vorteil verliert. Kontrastwerte gegen den jeweiligen
 * Badge-Hintergrund auf mind. 4.5:1 geprüft. */

.db-check-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.db-check-badge-icon {
    flex-shrink: 0;
}

.db-check-badge--green {
    background: #dcfce7;
    color: #166534;
}

.db-check-badge--amber {
    background: #fef3c7;
    color: #92400e;
}

.db-check-badge--red {
    background: #fee2e2;
    color: #991b1b;
}

.db-check-badge--gray {
    background: #f1f5f9;
    color: #475569;
}

/* ---- Responsive ---- */

@media (max-width: 480px) {
    .db-check-form fieldset {
        flex-direction: column;
        align-items: stretch;
    }

    .db-check-field input[type="text"],
    .db-check-field select {
        min-width: 0;
        width: 100%;
    }
}