/* Streckenampel – Public Widget CSS (WCAG 2.1 AA, heller Hintergrund) */

/* ── Wrapper ──────────────────────────────────────────────── */
.sa-widget-wrap {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #f9f9f9;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    font-family: inherit;
    max-width: 340px;
}

/* ── Ampelgehäuse ─────────────────────────────────────────── */
.sa-tl-housing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 18px;
    padding: 11px 10px;
    flex-shrink: 0;
}

/* ── Lichter ──────────────────────────────────────────────── */
.sa-tl-light {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #3a3a3a;
    border: 2px solid #111;
    transition: background .35s, box-shadow .35s;
}

/* Aktive Lichter: Farbe + Formunterschied (WCAG 1.4.1) */
.sa-tl-red.on {
    background: #c0392b;
    box-shadow: 0 0 14px 4px rgba(192,57,43,.7);
    border-radius: 50% 50% 38% 38%;   /* leicht abgeflacht */
}
.sa-tl-yellow.on {
    background: #d4a017;
    box-shadow: 0 0 14px 4px rgba(212,160,23,.7);
    border-radius: 28%;                /* Raute */
}
.sa-tl-green.on {
    background: #27ae60;
    box-shadow: 0 0 14px 4px rgba(39,174,96,.7);
    border-radius: 50%;
}

/* ── Info-Text (WCAG 1.4.3 – auf #f9f9f9) ────────────────── */
/* Grün:  #14532d → 10.5:1 ✓  */
/* Gelb:  #713f12 →  8.6:1 ✓  */
/* Rot:   #7f1d1d → 10.1:1 ✓  */
.sa-tl-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.sa-tl-status-text {
    font-size: 1.05em;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
    /* Farbe wird per PHP inline gesetzt */
}
/* Hinweistext: #595959 auf #f9f9f9 → 7.0:1 ✓ */
.sa-tl-message {
    font-size: .85em;
    color: #595959;
    line-height: 1.4;
    word-break: break-word;
}

/* ── Fokus (WCAG 2.4.7) ───────────────────────────────────── */
.sa-widget-wrap a:focus,
.sa-widget-wrap button:focus {
    outline: 3px solid #2271b1;
    outline-offset: 2px;
    border-radius: 3px;
}

/* ── Reduced Motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .sa-tl-light { transition: none; }
}

/* ── Windows High Contrast ────────────────────────────────── */
@media (forced-colors: active) {
    .sa-tl-light.on    { forced-color-adjust: none; border: 3px solid ButtonText; }
    .sa-widget-wrap    { border: 2px solid ButtonText; }
    .sa-tl-housing     { border-color: ButtonText; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 360px) {
    .sa-tl-light         { width: 28px; height: 28px; }
    .sa-tl-status-text   { font-size: .95em; }
    .sa-widget-wrap      { gap: 10px; padding: 10px 12px; }
}
