/* ==================================================
   Grundeinstellungen
================================================== */

:root {
    --seitenhintergrund: #f2f4f7;
    --flaeche: #ffffff;
    --text: #202124;
    --text-zurueckhaltend: #5f6368;
    --rahmen: #d9dde3;

    --blau: #0875d1;
    --blau-dunkel: #0055a4;
    --blau-hell: #edf6ff;

    --schatten:
        0 0.35rem 1.25rem rgba(0, 0, 0, 0.08);

    --radius: 0.8rem;
}

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

html {
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    margin: 0;

    color: var(--text);
    background: var(--seitenhintergrund);

    line-height: 1.55;
}

button,
input,
textarea,
select {
    font: inherit;
}

a {
    color: var(--blau-dunkel);
}

a:hover {
    text-decoration-thickness: 0.15em;
}

img {
    max-width: 100%;
    height: auto;
}


/* ==================================================
   Barrierefreiheit
================================================== */

.visuell-versteckt {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;
    clip: rect(0, 0, 0, 0);

    white-space: nowrap;

    border: 0;
}


/* ==================================================
   Seitenkopf
================================================== */

.seitenkopf {
    padding: 2.25rem 1rem;

    text-align: center;

    background: var(--flaeche);
    border-bottom: 1px solid var(--rahmen);
}

.seitenkopf-inhalt {
    width: min(1200px, 100%);
    margin: 0 auto;
}

.seitenkopf h1 {
    margin: 0;

    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.15;
}

.seitenkopf p {
    max-width: 50rem;
    margin: 0.75rem auto 0;

    color: var(--text-zurueckhaltend);
    font-size: clamp(1rem, 2vw, 1.15rem);
}


/* ==================================================
   Hauptbereich
================================================== */

.hauptinhalt {
    width: min(1200px, calc(100% - 2rem));
    margin: 2rem auto;
}


/* ==================================================
   Kartenbereich
================================================== */

.kartenbereich {
    position: relative;

    width: 100%;
    padding: 0.75rem;

    background: var(--flaeche);

    border: 1px solid var(--rahmen);
    border-radius: var(--radius);

    box-shadow: var(--schatten);

    overflow: hidden;
}

/*
   Leaflet benötigt eine explizite Höhe für den
   Kartencontainer.
*/
#karte {
    position: relative;

    width: 100%;
    height: 65vh;
    min-height: 450px;

    background: #dce5eb;

    border-radius: calc(var(--radius) - 0.25rem);

    overflow: hidden;

    z-index: 0;
}


/* ==================================================
   Leaflet-Ergänzungen
================================================== */

/*
   Diese Regeln ersetzen Leaflet nicht.
   Sie ergänzen nur unser eigenes Erscheinungsbild.
*/

.leaflet-container {
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #dce5eb;
}

.leaflet-control-zoom a {
    color: var(--text);
}

.leaflet-popup-content {
    margin: 0.9rem 1rem;

    line-height: 1.45;
}

.leaflet-popup-content strong {
    display: block;

    margin-bottom: 0.15rem;
}

.leaflet-tooltip {
    padding: 0.55rem 0.7rem;

    color: var(--text);
    background: var(--flaeche);

    border: 1px solid var(--rahmen);
    border-radius: 0.4rem;

    box-shadow:
        0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
}


/* ==================================================
   Informationsbereich
================================================== */

.personen-info {
    margin-top: 1.5rem;
    padding: 1.5rem;

    background: var(--flaeche);

    border: 1px solid var(--rahmen);
    border-left: 0.4rem solid var(--blau);
    border-radius: var(--radius);

    box-shadow: var(--schatten);
}

.personen-info h2 {
    margin: 0;
}

.personen-info h3 {
    margin: 1rem 0 0.15rem;

    font-size: 1.35rem;
}

.personen-info p:last-child {
    margin-bottom: 0;
}

.personen-info .lebensdaten {
    margin-top: 0.15rem;

    color: var(--text-zurueckhaltend);
    font-weight: 650;
}

.personen-info .kurzbeschreibung {
    font-weight: 700;
}

.personen-info-bild {
    display: block;

    width: min(280px, 100%);
    margin-top: 1.25rem;

    border-radius: 0.6rem;
}

.personen-info-quelle {
    margin-top: 1rem;
}


/* ==================================================
   Legende
================================================== */

.legendenbereich {
    margin-top: 1.5rem;
}

.legendenbereich > h2 {
    margin: 0 0 0.8rem;
}

.legende {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(min(280px, 100%), 1fr));

    gap: 0.75rem;
}

.legenden-eintrag {
    display: flex;
    align-items: center;
    gap: 1rem;

    width: 100%;
    min-height: 5rem;
    padding: 1rem;

    color: var(--text);
    background: var(--flaeche);

    text-align: left;

    border: 1px solid var(--rahmen);
    border-radius: 0.65rem;

    box-shadow:
        0 0.15rem 0.5rem rgba(0, 0, 0, 0.04);

    cursor: pointer;

    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        transform 160ms ease,
        box-shadow 160ms ease;
}

.legenden-eintrag:hover {
    background: var(--blau-hell);
    border-color: var(--blau);

    transform: translateY(-1px);

    box-shadow:
        0 0.3rem 0.8rem rgba(0, 0, 0, 0.08);
}

.legenden-eintrag:focus-visible {
    outline: 0.2rem solid var(--blau);
    outline-offset: 0.15rem;
}

.legenden-eintrag.ist-aktiv {
    background: var(--blau-hell);
    border-color: var(--blau);
}

.legenden-nummer {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 2.4rem;

    width: 2.4rem;
    height: 2.4rem;

    color: #ffffff;
    background: var(--blau);

    border-radius: 50%;

    font-weight: 750;
}

.legenden-text {
    min-width: 0;
}

.legenden-text strong,
.legenden-text span {
    display: block;
}

.legenden-text strong {
    line-height: 1.3;
}

.legenden-text span {
    margin-top: 0.25rem;

    color: var(--text-zurueckhaltend);

    line-height: 1.35;
}


/* ==================================================
   Nummern auf der Karte
================================================== */

.strassen-nummer {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 2.2rem;
    height: 2.2rem;

    color: #ffffff;
    background: var(--blau);

    border: 0.15rem solid #ffffff;
    border-radius: 50%;

    font-size: 0.95rem;
    font-weight: 750;

    box-shadow:
        0 0.15rem 0.45rem rgba(0, 0, 0, 0.5);

    cursor: pointer;
}

.strassen-nummer:hover {
    background: var(--blau-dunkel);
}


/* ==================================================
   Fehleranzeige
================================================== */

.fehlerhinweis {
    padding: 1rem;

    color: #7b2020;
    background: #fff0f0;

    border: 1px solid #e5b3b3;
    border-radius: 0.5rem;
}


/* ==================================================
   Fußbereich
================================================== */

.seitenfuss {
    padding: 1.5rem 1rem;

    color: var(--text-zurueckhaltend);
    background: var(--flaeche);

    text-align: center;
    font-size: 0.9rem;

    border-top: 1px solid var(--rahmen);
}

.seitenfuss p {
    margin: 0.2rem 0;
}


/* ==================================================
   Mobilansicht
================================================== */

@media (max-width: 650px) {

    .seitenkopf {
        padding: 1.4rem 1rem;
    }

    .hauptinhalt {
        width: calc(100% - 1rem);
        margin: 0.5rem auto 1.5rem;
    }

    .kartenbereich {
        padding: 0.4rem;
        border-radius: 0.6rem;
    }

    #karte {
        height: 60vh;
        min-height: 380px;

        border-radius: 0.4rem;
    }

    .personen-info {
        margin-top: 1rem;
        padding: 1rem;
    }

    .legendenbereich {
        margin-top: 1rem;
    }

    .legende {
        grid-template-columns: 1fr;
    }

    .legenden-eintrag {
        min-height: 4.5rem;
    }
}


/* ==================================================
   Reduzierte Animationen
================================================== */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

