/*
 * Öffentliche Einsatzliste – wird per iframe auf www.feuerwehr-meerbusch.de eingebunden
 * (350 px fürs Handy, 1500 px für den Desktop). Optik angelehnt an die Homepage
 * (WordPress Twenty Twenty-Four): Signika, Open Sans, Rot #d90f16.
 * Schriften liegen selbst gehostet in public/font/ (SIL Open Font License) – kein Google-Request.
 */

/* ------------------------------------------ SCHRIFTEN ------------------------------------------ */
@font-face { font-family: 'Signika'; font-weight: 300; font-display: swap; src: url(../font/signika-latin-300.woff2) format('woff2'); }
@font-face { font-family: 'Signika'; font-weight: 400; font-display: swap; src: url(../font/signika-latin-400.woff2) format('woff2'); }
@font-face { font-family: 'Signika'; font-weight: 600; font-display: swap; src: url(../font/signika-latin-600.woff2) format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 400; font-display: swap; src: url(../font/open-sans-latin-400.woff2) format('woff2'); }

/* ------------------------------------------- FARBEN -------------------------------------------- */
:root {
    --red: #d90f16;
    --ink: #111111;
    --muted: #636363;
    --soft: #a4a4a4;
    --surface: #f9f9f9;
    --line: #e98185; /* Trennlinien: Rot #d90f16 aufgehellt */
    --white: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 16px;
    background-color: transparent;
    color: var(--ink);
    font-family: 'Signika', sans-serif;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.45;
}

a { color: var(--red); }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.pending { color: var(--soft); font-style: italic; }

/* ---------------------------------- MONAT / JAHR (Zeitraum) ----------------------------------- */
.flex-container {
    display: flex;
    gap: 8px;
    margin: 0 0 20px;
}

.select select {
    font: inherit;
    font-weight: 400;
    color: var(--ink);
    padding: 8px 36px 8px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23d90f16' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    cursor: pointer;
}

.select select:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }

.empty { color: var(--muted); margin: 8px 0; }

/* ------------------------------------------- TABELLE ------------------------------------------- */
table.missions {
    width: 100%;
    border-collapse: collapse;
}

table.missions th {
    text-align: left;
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    padding: 8px 10px;
    border-bottom: 2px solid var(--ink);
}

table.missions td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.mission-row { cursor: pointer; }
.mission-row:hover td,
.mission-row.is-open td { background: var(--surface); }
.mission-row.is-open td { border-bottom-color: transparent; }

.mission-row .nr { color: var(--soft); font-variant-numeric: tabular-nums; }
.mission-row .date { white-space: nowrap; }
.mission-row .time { display: block; color: var(--muted); }
.mission-row td { hyphens: auto; }

.toggle-cell { width: 1%; text-align: right; }

button.toggle {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-weight: 400;
    font-size: 15px;
    color: var(--red);
    white-space: nowrap;
    cursor: pointer;
}

.mission-row:hover button.toggle { text-decoration: underline; }
button.toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 2px; }

/* Beschriftung folgt dem Zustand – kein JS nötig */
button.toggle .label-less,
button.toggle[aria-expanded="true"] .label-more { display: none; }
button.toggle[aria-expanded="true"] .label-less { display: inline; }

/* ----------------------------------------- DETAILZEILE ----------------------------------------- */
table.missions .mission-detail td {
    background: var(--surface);
    padding: 0 10px 18px;
}

dl.details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr));
    gap: 12px 24px;
    margin: 0;
    padding: 6px 0;
}

dl.details dt {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--soft);
}

dl.details dd { margin: 2px 0 0; }
dl.details .wide { grid-column: 1 / -1; }
dl.details .only-narrow { display: none; }

/* --------------------------------------- SCHMALER IFRAME --------------------------------------- */
@media (max-width: 500px) {
    body { padding: 8px; }
    .col-optional { display: none; }
    table.missions th,
    table.missions td { padding-left: 6px; padding-right: 6px; }
    table.missions .mission-detail td { padding: 0 6px 14px; }
    .mission-row .weekday { display: none; }
    dl.details .only-narrow { display: block; }
    /* Zu schmal für eine eigene Spalte: Tabelle als Raster, „mehr anzeigen“ unter die Meldung */
    table.missions, table.missions tbody, table.missions tr, table.missions td { display: block; }
    table.missions thead { display: none; }
    table.missions tr.mission-row {
        display: grid;
        grid-template-columns: 78px 92px 1fr;
        border-bottom: 1px solid var(--line);
    }
    table.missions tr.mission-row:hover,
    table.missions tr.mission-row.is-open { background: var(--surface); }
    table.missions tr.mission-row.is-open { border-bottom-color: transparent; }
    table.missions tr.mission-row td { border-bottom: 0; padding-bottom: 4px; background: none; }
    table.missions tr.mission-row td.col-optional { display: none; }
    table.missions tr.mission-row td.toggle-cell { grid-column: 3; width: auto; text-align: left; padding-top: 4px; padding-bottom: 12px; }
    table.missions tr.mission-detail[hidden] { display: none; }
    table.missions tr.mission-detail { border-bottom: 1px solid var(--line); }
    table.missions tr.mission-detail td { border-bottom: 0; padding-top: 4px; }
    table.missions { border-top: 2px solid var(--ink); }
    dl.details { grid-template-columns: repeat(auto-fill, minmax(min(130px, 100%), 1fr)); gap: 10px 16px; }
}
