/* ==========================================================================
   BEW Weßling - Basis-Stylesheet
   Schrift: groteske Systemschrift (keine Google-Fonts)
   ========================================================================== */

:root {
    --gruen-dunkel: #1e5c2f;   /* sattes Gruen fuer Text und Ueberschriften */
    --gruen-mittel: #2e7d32;
    --gruen-hell:   #eaf3e7;   /* zarter Hintergrund */
    --gruen-linie:  #c3ddc0;
    --weiss:        #ffffff;
    --grau-text:    #4a5a4c;
    --breite:       880px;   /* Lesebreite - haelt auch die Bilder in Groesse */
}

* {
    box-sizing: border-box;
}

html {
    font-size: 100%;
}

body {
    margin: 0;
    font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--gruen-dunkel);
    background-color: var(--weiss);
}

/* --- Hilfslink fuer Tastaturbedienung ----------------------------------- */

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--gruen-dunkel);
    color: var(--weiss);
    padding: 0.5rem 1rem;
    z-index: 100;
}

.skip-link:focus {
    left: 0;
}

/* Inhalt, den nur Vorlesegeraete und Suchmaschinen auswerten */
.nur-vorlesen {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* --- Kopfbereich mit Menueleiste ---------------------------------------- */

.site-header {
    background-color: var(--weiss);
    border-bottom: 1px solid var(--gruen-linie);
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Obere Zeile: Logo und Menue, darunter die gruene Linie */
.header-balken {
    border-bottom: 4px solid var(--gruen-mittel);
}

.header-top {
    max-width: var(--breite);
    margin: 0 auto;
    padding: 0.6rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: block;
    line-height: 0;
}

/* Logo: Breite ergibt sich aus dem Seitenverhaeltnis (rund 2,9 : 1) */
.brand img {
    height: 48px;
    width: auto;
    max-width: 100%;
}

/* Einzeiler unter der gruenen Linie */
.header-name {
    max-width: var(--breite);
    margin: 0 auto;
    padding: 0.35rem 1rem;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    color: var(--grau-text);
}

/* --- Navigation (grosse Bildschirme) ------------------------------------ */

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.25rem;
}

.nav-list a {
    display: block;
    padding: 0.6rem 0.9rem;
    text-decoration: none;
    color: var(--gruen-dunkel);
    font-weight: 600;
    border-radius: 4px;
}

.nav-list a:hover,
.nav-list a:focus {
    background-color: var(--gruen-hell);
}

.nav-list a.is-active {
    background-color: var(--gruen-mittel);
    color: var(--weiss);
}

/* Schalter fuer das Menue auf kleinen Bildschirmen */
.nav-toggle,
.nav-toggle-label {
    display: none;
}

/* --- Inhalt -------------------------------------------------------------- */

.content {
    max-width: var(--breite);
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

h1 {
    font-size: 1.6rem;
    line-height: 1.25;
    margin: 0 0 1.25rem;
    color: var(--gruen-dunkel);
}

h2 {
    font-size: 1.2rem;
    margin: 2.25rem 0 0.6rem;
    color: var(--gruen-mittel);
}

h3 {
    font-size: 1.05rem;
    margin: 1.5rem 0 0.4rem;
    color: var(--gruen-mittel);
}

p {
    margin: 0 0 1.1rem;
}

address {
    font-style: normal;
    margin: 0 0 1.1rem;
}

.quelle {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--grau-text);
}

ul.liste {
    margin: 0 0 1.5rem;
    padding-left: 1.3rem;
}

ul.liste li {
    margin-bottom: 0.45rem;
}

a {
    color: var(--gruen-mittel);
    text-underline-offset: 0.25em;
    text-decoration-thickness: 1px;
}

/* --- Reihe aus mehreren Bildern ------------------------------------------ */

.bilderreihe {
    margin: 0 0 1.75rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.bilderreihe img {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 6px;
}

/* --- Unter-Navigation auf den Unterseiten -------------------------------- */

.unternavi {
    margin: 0 0 2rem;
}

.unternavi ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.unternavi a {
    display: block;
    padding: 0.45rem 0.9rem;
    text-decoration: none;
    font-weight: 600;
    color: var(--gruen-dunkel);
    background-color: var(--gruen-hell);
    border-radius: 999px;
}

.unternavi a:hover,
.unternavi a:focus {
    background-color: var(--gruen-linie);
}

.unternavi a.is-active {
    background-color: var(--gruen-mittel);
    color: var(--weiss);
}

/* --- Kacheln fuer Uebersichtsseiten -------------------------------------- */

.kacheln {
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.kachel a {
    display: block;
    height: 100%;
    text-decoration: none;
    color: var(--gruen-dunkel);
    background-color: var(--weiss);
    border: 1px solid var(--gruen-linie);
    border-radius: 6px;
    overflow: hidden;
}

.kachel a:hover,
.kachel a:focus {
    border-color: var(--gruen-mittel);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.kachel img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.kachel-text {
    padding: 1rem 1.15rem 1.25rem;
}

.kachel-titel {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gruen-mittel);
    margin-bottom: 0.4rem;
}

.kachel-text p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--grau-text);
}

/* --- Kontaktdaten -------------------------------------------------------- */

.kontaktdaten {
    margin: 0 0 2rem;
    padding: 1.25rem 1.5rem;
    background-color: var(--gruen-hell);
    border-radius: 6px;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.6rem 1.5rem;
}

.kontaktdaten dt {
    font-weight: 700;
}

.kontaktdaten dd {
    margin: 0;
}

.kontaktdaten address {
    font-style: normal;
}

/* --- Liste der Mitarbeiterinnen und Mitarbeiter -------------------------- */

.team {
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.team li {
    padding: 0.9rem 1.1rem;
    background-color: var(--gruen-hell);
    border-left: 5px solid var(--gruen-mittel);
    border-radius: 4px;
}

.team-name {
    display: block;
    font-weight: 700;
}

.team-rolle {
    display: block;
    font-size: 0.95rem;
    color: var(--grau-text);
}

/* --- Bilder mit Bildtext ------------------------------------------------- */

figure {
    margin: 0 0 1.75rem;
    text-align: center;
}

/* Bilder werden nie hochgerechnet und nie hoeher als der halbe Bildschirm */
figure img {
    display: block;
    margin: 0 auto;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(460px, 60vh);
    border-radius: 6px;
}

figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-style: italic;
    color: var(--grau-text);
}

.titelbild {
    margin-bottom: 2rem;
}

/* --- Hervorgehobener Textblock ------------------------------------------ */

.hinweis {
    background-color: var(--gruen-hell);
    border-left: 5px solid var(--gruen-mittel);
    padding: 1rem 1.25rem;
    border-radius: 4px;
    margin: 0 0 1.75rem;
}

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

/* --- Fusszeile ----------------------------------------------------------- */

.site-footer {
    background-color: var(--gruen-dunkel);
    color: var(--weiss);
    margin-top: 2rem;
}

.footer-inner {
    max-width: var(--breite);
    margin: 0 auto;
    padding: 2rem 1rem 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5rem 2.5rem;
}

/* Spalten richten sich nach ihrem Inhalt, die letzte rueckt nach rechts */
.footer-col {
    flex: 0 1 auto;
}

/* Telefon und E-Mail sollen nicht umbrechen */
.footer-kontakt {
    white-space: nowrap;
}

.footer-title {
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.site-footer a {
    color: var(--weiss);
}

.footer-bottom {
    max-width: var(--breite);
    margin: 0 auto;
    padding: 0.75rem 1rem 1.5rem;
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

/* --- Kleine Bildschirme (Smartphone, Tablet) ---------------------------- */

@media (max-width: 860px) {

    .brand img {
        height: 42px;
    }

    /* Menue-Schalter als drei Striche */
    .nav-toggle-label {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 34px;
        height: 26px;
        cursor: pointer;
        padding: 2px 0;
    }

    .nav-toggle-label span {
        display: block;
        height: 4px;
        background-color: var(--gruen-dunkel);
        border-radius: 2px;
    }

    .site-nav {
        flex-basis: 100%;
        display: none;
    }

    .nav-toggle:checked ~ .site-nav {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
        margin-top: 0.75rem;
        border-top: 1px solid var(--gruen-linie);
    }

    .nav-list > li {
        border-bottom: 1px solid var(--gruen-linie);
    }

    .nav-list a {
        padding: 0.8rem 0.5rem;
    }

    h1 {
        font-size: 1.4rem;
    }
}

/* Sehr schmale Bildschirme */

@media (max-width: 520px) {

    .brand img {
        height: 38px;
    }

    .header-name {
        font-size: 0.8rem;
    }

    /* Auf sehr schmalen Geraeten darf die E-Mail-Adresse umbrechen */
    .footer-kontakt {
        white-space: normal;
    }
}
