/* ==========================================================================
   ursula-gresser.de – Theme für Contao 5.7 (Layout-Typ "modern")
   Kein CSS-Framework, keine Abhängigkeiten. Schriften lokal (DSGVO).
   ========================================================================== */

@font-face {
    font-family: "Source Sans Pro";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/source-sans-pro-v11-latin-regular.woff2") format("woff2");
}
@font-face {
    font-family: "Source Sans Pro";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/source-sans-pro-v11-latin-700.woff2") format("woff2");
}
@font-face {
    font-family: "Lusitana";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/lusitana-v5-latin-regular.woff2") format("woff2");
}
@font-face {
    font-family: "Lusitana";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/lusitana-v5-latin-700.woff2") format("woff2");
}

:root {
    --c-brand: #004990;
    --c-brand-dark: #00376d;
    --c-brand-tint: #e8f0f9;
    --c-accent-bg: #f4f7f6;
    --c-text: #1f2933;
    --c-text-muted: #5b6672;
    --c-border: #dde3ea;
    --c-bg: #ffffff;
    --c-page: #eef2f6;

    --font-body: "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --font-head: "Lusitana", Georgia, "Times New Roman", serif;

    --radius: 10px;
    --shadow: 0 1px 2px rgb(16 24 40 / .06), 0 8px 24px rgb(16 24 40 / .08);
    --nav-width: 16rem;
    --content-max: 46rem;
    --site-max: 75rem;
    --gap: clamp(1rem, 2.5vw, 2.5rem);
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
    margin: 0;
    background: var(--c-page);
    color: var(--c-text);
    font-family: var(--font-body);
    /* Schriftgrößen exakt wie im Contao-3.5-Theme (vom Kunden so festgelegt) */
    font-size: 15px;
    line-height: 1.5em;
    text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; }
img { display: block; }

a { color: var(--c-brand); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--c-brand-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #f0b429; outline-offset: 2px; border-radius: 3px; }

strong, b { color: var(--c-brand); font-weight: 700; }

hr { border: 0; border-top: 1px solid var(--c-border); margin: 2rem 0; }

/* Contao-Hilfsklassen */
.invisible {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0);
    border: 0;
}

.skip-link {
    position: absolute;
    left: 1rem; top: -3rem;
    z-index: 100;
    padding: .5rem 1rem;
    background: #fff;
    color: var(--c-brand);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.skip-link:focus { top: 1rem; }

/* ---------- Grundgerüst ---------- */
.site {
    max-width: var(--site-max);
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--c-bg);
}
@media (min-width: 76rem) {
    .site {
        margin-block: 1.5rem;
        min-height: calc(100vh - 3rem);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        overflow: hidden;
    }
}

/* Kopf */
.site-header {
    background: linear-gradient(135deg, var(--c-brand) 0%, var(--c-brand-dark) 100%);
    color: #fff;
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem var(--gap);
    min-height: 5rem;
}
.site-header__brand a {
    color: #fff;
    text-decoration: none;
    font-family: var(--font-head);
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: .01em;
}
.site-header__brand a:hover { text-decoration: underline; text-decoration-thickness: 1px; }

/* Body: Navigation + Inhalt */
.site-body {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
}
@media (min-width: 60rem) {
    .site-body { grid-template-columns: var(--nav-width) minmax(0, 1fr); }
}

/* ---------- Navigation ---------- */
.nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .9rem;
    border: 1px solid rgb(255 255 255 / .5);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: .95rem;
    cursor: pointer;
}
.nav-toggle:hover { background: rgb(255 255 255 / .12); }
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
    display: block;
    width: 1.1rem;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

.site-nav {
    background: var(--c-accent-bg);
    border-bottom: 1px solid var(--c-border);
}
/* Mobil: eingeklappt, sobald JS aktiv ist */
.js .site-nav { display: none; }
.js .site-nav.is-open { display: block; }

@media (min-width: 60rem) {
    .nav-toggle { display: none; }
    .js .site-nav, .site-nav {
        display: block;
        border-bottom: 0;
        border-right: 1px solid var(--c-border);
    }
}

.mod_navigation ul { list-style: none; margin: 0; padding: .75rem 0; }
.mod_navigation li { margin: 0; }
.mod_navigation a,
.mod_navigation strong {
    display: block;
    padding: .3em var(--gap) .3em calc(var(--gap) - 4px);
    border-left: 4px solid transparent;
    color: var(--c-brand);
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    line-height: 2em;
    transition: background-color .15s ease, border-color .15s ease;
}
@media (min-width: 60rem) {
    .mod_navigation a, .mod_navigation strong { padding-inline: 1.5rem 1rem; }
}
.mod_navigation a:hover { background: var(--c-brand-tint); border-left-color: rgb(0 73 144 / .35); }
.mod_navigation strong.active,
.mod_navigation a.trail {
    background: #fff;
    border-left-color: var(--c-brand);
    font-weight: 400;
}

/* ---------- Inhalt ---------- */
.site-main {
    padding: clamp(1.5rem, 4vw, 3rem) var(--gap) 3rem;
    min-width: 0;
}
.site-main > * { max-width: var(--content-max); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    color: var(--c-brand);
    line-height: 1.3em;
    margin: 1.6em 0 .6em;
    text-wrap: balance;
}
.site-main h1 { font-size: 25.5px; font-weight: 700; margin-top: 0; }
.site-main h2 { font-size: 22.5px; font-weight: 400; }
.site-main h3 { font-size: 22.5px; font-weight: 400; }
.site-main h4 { font-size: 20px; font-weight: 400; font-family: var(--font-body); }
.site-main h5, .site-main h6 { font-size: 15px; font-weight: 400; font-family: var(--font-body); }

p { margin: 0 0 1em; }

.site-main ul, .site-main ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.site-main li { padding: .15em 0; }
.site-main li::marker { color: var(--c-brand); }

.mod_article + .mod_article { margin-top: 2.5rem; }
.content-text, .ce_text { margin-bottom: 1.5rem; }

blockquote, .citation {
    margin: 1.5rem 0;
    padding: .75rem 1.25rem;
    border-left: 4px solid var(--c-brand);
    background: var(--c-accent-bg);
    font-style: italic;
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* Bilder in Texten / Galerien */
figure { margin: 0 0 1.5rem; }
figure img { border-radius: 6px; }
figcaption { margin-top: .4rem; color: var(--c-text-muted); }
.media--left > figure, .image_container.float_left { float: left; margin: .3rem 1.5rem 1rem 0; max-width: 45%; }
.media--right > figure, .image_container.float_right { float: right; margin: .3rem 0 1rem 1.5rem; max-width: 45%; }
.content-text::after, .ce_text::after { content: ""; display: table; clear: both; }
@media (max-width: 40rem) {
    .media--left > figure, .media--right > figure,
    .image_container.float_left, .image_container.float_right { float: none; max-width: 100%; margin: 0 0 1rem; }
}

.content-gallery ul, .ce_gallery ul {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
}
.content-gallery li, .ce_gallery li { padding: 0; }

/* Links-Liste / Hyperlinks */
.content-hyperlink, .ce_hyperlink { margin-bottom: .75rem; font-weight: 700; }
.content-hyperlink a, .ce_hyperlink a { font-weight: 400; overflow-wrap: anywhere; }

/* Publikationen (Nachrichtenliste) */
.mod_newslist .layout_full {
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--c-border);
}
.mod_newslist .layout_full + hr { display: none; }
.layout_full .info { color: var(--c-text-muted); }
.enclosure p { display: flex; align-items: center; gap: .5rem; }
.enclosure .size { color: var(--c-text-muted); }

/* Tabellen */
table { border-collapse: collapse; width: 100%; margin: 0 0 1.5rem; }
th, td { padding: .5rem .75rem; border-bottom: 1px solid var(--c-border); text-align: left; vertical-align: top; }

/* ---------- Formular ---------- */
form .widget { margin-bottom: 1.25rem; }
form label, form legend { display: block; margin-bottom: .35rem; font-weight: 400; color: var(--c-text); }
form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
form legend { padding: 0; float: left; width: 100%; font-weight: 700; }
form legend ~ * { clear: both; }
form span.mandatory { color: #b42318; margin-left: .15em; }
form .checkbox_container label { display: inline; font-weight: 400; }
form .checkbox_container > span { display: flex; gap: .6rem; align-items: flex-start; }
form .checkbox_container > span > input { margin-top: .35rem; flex: none; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea, select {
    width: 100%;
    max-width: 36rem;
    padding: .65rem .8rem;
    border: 1px solid #b8c2cc;
    border-radius: 6px;
    background: #fff;
    color: var(--c-text);
    font: inherit;
    line-height: 1.4;
}
textarea { min-height: 12rem; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--c-brand); outline: 3px solid rgb(0 73 144 / .2); outline-offset: 0; }
::placeholder { color: #8a96a3; }

button[type="submit"], input[type="submit"], .submit {
    display: inline-block;
    padding: .7rem 1.6rem;
    border: 0;
    border-radius: 999px;
    background: var(--c-brand);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .15s ease;
}
button[type="submit"]:hover, input[type="submit"]:hover, .submit:hover { background: var(--c-brand-dark); }
p.error, .widget .error { color: #b42318; font-weight: 700; margin: .25rem 0; }

/* Spamschutz (ALTCHA, in Contao 5.7 eingebaut) */
altcha-widget {
    --altcha-border-width: 1px;
    --altcha-border-radius: 6px;
    --altcha-color-border: #b8c2cc;
    --altcha-color-border-focus: var(--c-brand);
    --altcha-color-text: var(--c-text);
    --altcha-color-active: var(--c-brand);
    --altcha-max-width: 22rem;
    font-family: var(--font-body);
}

/* ---------- Fuß ---------- */
.site-footer {
    padding: 1.25rem var(--gap);
    background: var(--c-accent-bg);
    border-top: 1px solid var(--c-border);
    color: var(--c-text-muted);
    font-size: 13.5px;
    text-align: center;
}
.site-footer a { color: inherit; }

/* ---------- Lightbox (theme.js) ---------- */
.lightbox {
    padding: 0;
    border: 0;
    background: transparent;
    max-width: 95vw;
    max-height: 95vh;
}
.lightbox::backdrop { background: rgb(10 15 25 / .85); }
.lightbox img { max-width: 95vw; max-height: 88vh; width: auto; border-radius: 6px; }
.lightbox__caption { color: #fff; text-align: center; margin-top: .5rem; font-size: .95rem; }
.lightbox__close {
    position: fixed;
    top: 1rem; right: 1rem;
    width: 2.75rem; height: 2.75rem;
    border: 0;
    border-radius: 50%;
    background: rgb(255 255 255 / .15);
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}
.lightbox__close:hover { background: rgb(255 255 255 / .3); }

/* ---------- Druck ---------- */
@media print {
    body { background: #fff; }
    .site { box-shadow: none; margin: 0; }
    .site-nav, .nav-toggle, .skip-link { display: none !important; }
    .site-body { display: block; }
    .site-header { background: none; color: #000; }
    .site-header__brand a { color: #000; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; }
}
