/* ==============================================================================
   Gemeinde Ehingen am Ries · Belzheim — Design-System
   ------------------------------------------------------------------------------
   Amtlicher, ruhiger Auftritt in Gemeindefarben (Rot/Gold aus dem Wappen).
   Datenschutz: ausschließlich Systemschriften — keine externen Font-Dienste.
   ============================================================================== */

:root {
    /* Gemeindefarben — leuchtendes Rot & Gold aus dem Ehinger Wappen */
    --c-primary: #c01c1c;
    --c-primary-dark: #991b1b;
    --c-primary-deep: #7f1d1d;
    --c-gold: #b45309;        /* textsicheres Gold (Kontrast ≥ 4.5:1 auf Weiß) */
    --c-gold-light: #d97706;
    --c-gold-bright: #fbbf24; /* leuchtendes Wappen-Gold, nur dekorativ */

    /* Wappen-Verlauf (Rot → Orange → Gold) — nur für Flächen OHNE Text */
    --grad-wappen: linear-gradient(90deg, #e11d1d 0%, #f97316 55%, #fbbf24 100%);
    --grad-wappen-v: linear-gradient(180deg, #e11d1d 0%, #f97316 60%, #fbbf24 100%);
    /* Tiefer Amtsverlauf — kontrastsicher unter weißem Text (alle Töne ≥ 4.5:1) */
    --grad-amt: linear-gradient(90deg, #b91c1c 0%, #c2410c 60%, #b45309 100%);

    /* Flächen */
    --bg-page: #faf9f6;
    --bg-card: #ffffff;
    --bg-surface: #f5f3ec;
    --bg-surface-deep: #edeae0;

    /* Linien */
    --border: #e5e1d6;
    --border-strong: #cfc9b9;

    /* Text (Kontraste WCAG-geprüft) */
    --text-main: #1c1917;
    --text-muted: #57534e;
    --text-invert: #ffffff;

    /* Status */
    --ok-bg: #dcfce7;   --ok-text: #166534;
    --warn-bg: #fef3c7; --warn-text: #92400e;
    --err-bg: #fee2e2;  --err-text: #991b1b;
    --neutral-bg: #e7e5e4; --neutral-text: #44403c;
    --info-bg: #e0f2fe; --info-text: #075985;

    /* Typografie (Systemschriften, DSGVO-konform ohne externe Dienste) */
    --font-serif: Georgia, 'Times New Roman', 'Liberation Serif', serif;
    --font-sans: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;

    /* Radien & Schatten */
    --radius-sm: 7px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.06), 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-md: 0 6px 18px rgba(28, 25, 23, 0.09);
    --shadow-lg: 0 18px 44px rgba(28, 25, 23, 0.18);

    /* Fokus */
    --focus-ring: 0 0 0 3px #ffffff, 0 0 0 6px var(--c-primary);
}

/* ------------------------------------------------------------------ *
 *  Basis
 * ------------------------------------------------------------------ */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Muss vor allen display-Regeln stehen und diese schlagen — sonst bleiben
   ausgeblendete Elemente (z. B. deaktivierte Bereiche) sichtbar. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 15.5px;
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    color: var(--c-primary-dark);
    font-weight: 700;
    line-height: 1.28;
}

a { color: var(--c-primary); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--c-primary-dark); }

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

button { font-family: inherit; }

code { font-family: 'Cascadia Mono', Consolas, 'Courier New', monospace; }

.muted { color: var(--text-muted); }

/* ------------------------------------------------------------------ *
 *  Barrierefreiheit
 * ------------------------------------------------------------------ */

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -60px; left: 12px;
    z-index: 200;
    background: var(--c-primary-dark);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: top 0.15s ease;
}
.skip-link:focus { top: 0; color: #ffffff; }

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001s !important;
        scroll-behavior: auto !important;
    }
}

/* ------------------------------------------------------------------ *
 *  Amtsleiste (Topbar)
 * ------------------------------------------------------------------ */

.topbar {
    background: var(--grad-amt);
    color: #fdf3ea;
    font-size: 12.5px;
}

.topbar-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 6px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar a { color: #ffffff; text-decoration: none; font-weight: 600; }
.topbar a:hover { text-decoration: underline; color: #ffffff; }

.topbar-contact { display: flex; gap: 6px; align-items: center; }

/* ------------------------------------------------------------------ *
 *  Kopfbereich
 * ------------------------------------------------------------------ */

.site-header { background: var(--bg-card); border-bottom: 1px solid var(--border); }

.header-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
}

.brand-wappen { flex: 0 0 auto; }

.brand-text { display: flex; flex-direction: column; }

.brand-name {
    font-family: var(--font-serif);
    font-size: 23px;
    font-weight: 700;
    color: var(--c-primary-dark);
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.brand-sub {
    font-size: 12.5px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    margin-top: 2px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-link {
    display: inline-block;
    padding: 9px 14px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 14.5px;
    text-decoration: none;
    border-radius: var(--radius-sm);
    border-bottom: 3px solid transparent;
}

.nav-link:hover { background: var(--bg-surface); color: var(--c-primary-dark); }

.nav-link.active {
    color: var(--c-primary-dark);
    border-bottom-color: var(--c-primary);
    background: transparent;
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
    padding: 9px 16px;
    border: 1.5px solid var(--c-primary);
    border-radius: var(--radius-sm);
    color: var(--c-primary-dark);
    font-weight: 600;
    font-size: 14.5px;
    text-decoration: none;
    background: transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-cta:hover { background: var(--c-primary); color: #ffffff; }
.nav-cta.active { background: var(--c-primary); color: #ffffff; }
.nav-cta svg { flex: 0 0 auto; }

.header-ribbon {
    height: 5px;
    background: var(--grad-wappen);
}

/* ------------------------------------------------------------------ *
 *  Hauptbereich
 * ------------------------------------------------------------------ */

.main-wrapper {
    max-width: 1240px;
    margin: 36px auto 0;
    padding: 0 24px;
    width: 100%;
    flex: 1;
}

.main-wrapper:focus { outline: none; box-shadow: none; }

/* ------------------------------------------------------------------ *
 *  Fußbereich
 * ------------------------------------------------------------------ */

.site-footer {
    margin-top: 64px;
    background: #292524;
    color: #d6d3d1;
    font-size: 13.5px;
    border-top: 4px solid;
    border-image: var(--grad-wappen) 1;
}

.footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 36px 24px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 28px;
}

.footer-col h4 {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #a8a29e;
    margin-bottom: 12px;
}

.footer-col p { margin-bottom: 4px; }

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 7px; }

.site-footer a { color: #e7e5e4; text-decoration: none; }
.site-footer a:hover { color: #ffffff; text-decoration: underline; }

.footer-bottom {
    border-top: 1px solid #44403c;
    padding: 14px 24px;
}

.footer-bottom-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: #a8a29e;
}

/* ------------------------------------------------------------------ *
 *  NoScript-Hinweis
 * ------------------------------------------------------------------ */

.noscript-box {
    background: var(--warn-bg);
    color: var(--warn-text);
    border: 1px solid #f3d48a;
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 24px;
    font-weight: 600;
}

/* ------------------------------------------------------------------ *
 *  Druckansicht
 * ------------------------------------------------------------------ */

@media print {
    .topbar, .site-nav, .site-footer, .skip-link, .toast-region { display: none !important; }
    body { background: #ffffff; }
    .card, .modal-card { box-shadow: none !important; border: 1px solid #d6d0c2; }
}

/* ------------------------------------------------------------------ *
 *  Mobile Anpassungen
 * ------------------------------------------------------------------ */

@media (max-width: 720px) {
    .header-inner { justify-content: center; text-align: center; }
    .brand { flex-direction: column; gap: 8px; }
    .site-nav { justify-content: center; }
    .main-wrapper { margin-top: 24px; padding: 0 16px; }
    .topbar-inner { justify-content: center; }
}
