/*
 * DRK Ortsverein Ihringen+Wasenweiler - Gestaltung "DRK 2026"
 * Nach DRK-Styleguide (styleguide.drk.de > Webseite):
 *   DRK-Rot #E60005 (Ueberschriften, Buttons), Softrot #E46450, Dunkelrot #A51E0F (Hover),
 *   Dunkelblau #002D55 (Menue), Volltonblau #2275D0 (Links), Hellblau #EBF5FF,
 *   Dunkelgrau #554F4A (Fliesstext), Mittelgrau #B4B4B4 (Linien), Hellgrau #EFEEEA (Flaechen)
 *   Schrift: Helvetica Neue, ersatzweise Open Sans, Arial
 * Bildformate (DRK-Fotobriefing): Buehnenbild 3:1, Kacheln/Artikel 4:3
 */

:root {
    --drk-rot: #e60005;
    --drk-softrot: #e46450;
    --drk-dunkelrot: #a51e0f;
    --drk-dunkelblau: #002d55;
    --drk-blau: #2275d0;
    --drk-hellblau: #ebf5ff;
    --drk-text: #554f4a;
    --drk-linie: #b4b4b4;
    --drk-flaeche: #efeeea;
    --breite: 1200px;
    --abstand: clamp(16px, 3vw, 32px);
    --schrift: "Helvetica Neue", Helvetica, "Open Sans", Arial, sans-serif;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: #fff;
    color: var(--drk-text);
    font: 300 17px/1.6 var(--schrift);
}
img { max-width: 100%; height: auto; }
a { color: var(--drk-blau); text-underline-offset: .15em; }
a:hover, a:focus { color: var(--drk-dunkelrot); }
:focus-visible { outline: 3px solid var(--drk-blau); outline-offset: 2px; }
p { margin: 0 0 1em; }
strong, b { font-weight: 500; }
hr { border: 0; border-top: 1px solid var(--drk-linie); margin: 2em 0; }

h1, h2, h3, h4, h5, h6 { color: var(--drk-rot); font-weight: 500; line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
h3 { font-size: 1.2rem; color: var(--drk-softrot); }
h4, h5, h6 { font-size: 1.05rem; color: var(--drk-softrot); }

.container { max-width: var(--breite); margin: 0 auto; padding: 0 var(--abstand); }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--drk-dunkelblau); color: #fff; padding: .6em 1em; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; color: #fff; }

/* ---------- Kopfbereich ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--drk-flaeche); position: relative; z-index: 10; }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 92px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--drk-text); flex-shrink: 0; }
.brand-logo { width: 160px; height: auto; display: block; }
.brand-name { border-left: 1px solid var(--drk-linie); padding-left: 16px; font-size: 1rem; line-height: 1.25; }
.brand:hover .brand-name, .brand:focus .brand-name { color: var(--drk-text); }

.main-nav { margin-left: auto; display: flex; align-items: center; min-width: 0; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; }
.main-nav li { margin: 0; white-space: nowrap; }
.main-nav a, .main-nav strong, .main-nav span.active {
    display: block; padding: .55em .65em; color: var(--drk-dunkelblau);
    text-decoration: none; font-weight: 400; border-bottom: 3px solid transparent;
}
.main-nav a:hover, .main-nav a:focus { color: var(--drk-dunkelrot); }
.main-nav .active, .main-nav strong.active, .main-nav a.trail { border-bottom-color: var(--drk-rot); color: var(--drk-dunkelblau); }
.main-nav-home { display: none !important; }
.main-nav-search { display: flex !important; align-items: center; gap: .4em; }
.main-nav-search-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.main-nav .mod_navigation { margin: 0; }

.nav-toggle {
    display: none; margin-left: auto; align-items: center; gap: .5em;
    background: none; border: 1px solid var(--drk-linie); border-radius: 4px;
    padding: .5em .8em; font: inherit; color: var(--drk-dunkelblau); cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 20px; height: 2px; background: currentColor; position: relative; content: "";
}
.nav-toggle-bars::before { position: absolute; top: -6px; }
.nav-toggle-bars::after { position: absolute; top: 6px; }

/* ---------- Buehnenbild (Startseite) ---------- */
.buehne { background: #fff; }
.buehne .container { padding-top: var(--abstand); }
.buehne .mod_article { position: relative; margin: 0; }
.buehne .content-image, .buehne .ce_image { position: relative; margin: 0; }
.buehne figure { margin: 0; }
.buehne img { display: block; width: 100%; aspect-ratio: 3 / 1; object-fit: cover; }
.buehne figcaption { position: absolute; right: 8px; bottom: 6px; font-size: .7rem; color: #fff; text-shadow: 0 0 3px rgba(0,0,0,.8); margin: 0; }
/* Rote Banderole vor dem Bild (Styleguide: "roter Banner vor Bildelementen") */
/* Banderole halb ueber der Bildunterkante, damit Gesichter frei bleiben */
.buehne .mod_article { margin-bottom: 2.2em; }
.buehne h1 {
    position: absolute; left: 0; bottom: 0; transform: translateY(50%); z-index: 2; margin: 0; max-width: 80%;
    background: var(--drk-rot); color: #fff; padding: .35em .8em .4em var(--abstand);
    font-size: clamp(1.1rem, 2.6vw, 2rem);
}

/* ---------- Seitenraster ---------- */
.page { padding-top: 1em; padding-bottom: 3em; }
.breadcrumb-wrap { font-size: .85rem; margin: .5em 0 1.5em; }
.mod_breadcrumb ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2em; }
.mod_breadcrumb li:not(:last-child)::after { content: "›"; margin-left: .4em; color: var(--drk-linie); }
.mod_breadcrumb a { color: var(--drk-text); }

.page-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2em; }
.page-grid:has(> .subnav) { grid-template-columns: 240px minmax(0, 1fr); }

.subnav ul { list-style: none; margin: 0; padding: 0; }
.subnav li { border-bottom: 1px solid var(--drk-flaeche); }
.subnav a, .subnav strong, .subnav span.active { display: block; padding: .5em .6em; color: var(--drk-dunkelblau); text-decoration: none; }
.subnav ul ul a, .subnav ul ul strong { padding-left: 1.4em; font-size: .95em; }
.subnav ul ul ul a, .subnav ul ul ul strong { padding-left: 2.2em; }
.subnav a:hover { background: var(--drk-hellblau); }
.subnav .active, .subnav strong.active { color: var(--drk-rot); font-weight: 500; border-left: 3px solid var(--drk-rot); }
.subnav a.trail { color: var(--drk-rot); }

.content { min-width: 0; }
.mod_article { margin-bottom: 2em; }
/* Leere Artikel (z. B. "WICHTIG" ohne aktuellen Termin) nehmen keinen Platz ein */
.mod_article:not(:has(*)) { display: none; }
.mod_article > :last-child { margin-bottom: 0; }

/* ---------- Inhaltselemente ---------- */
.content-text, .ce_text, .content-image, .ce_image, .content-table, .content-download, .content-downloads, .content-gallery, .content-hyperlink, .content-player { margin-bottom: 1.5em; }
.content-text ul, .ce_text ul { padding-left: 1.2em; }
.content-text li, .ce_text li { margin-bottom: .3em; }
.content-text li::marker, .ce_text li::marker { color: var(--drk-rot); }
figure { margin: 0 0 1em; }
/* Eingebettete Videos/Beitraege (YouTube, Facebook) duerfen nicht ueber den Rand ragen */
.content iframe, .content video, .content embed, .content object { max-width: 100%; }
figcaption, .caption { font-size: .8rem; color: #7f7f7f; margin-top: .3em; line-height: 1.4; }
.float_left, figure.float_left { float: left; margin: .3em 1.5em 1em 0; max-width: 45%; }
.float_right, figure.float_right { float: right; margin: .3em 0 1em 1.5em; max-width: 45%; }
.content-text::after, .ce_text::after, .mod_article::after { content: ""; display: table; clear: both; }

table { border-collapse: collapse; width: 100%; margin-bottom: 1.5em; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: .55em .8em; border-bottom: 1px solid var(--drk-flaeche); }
th { background: var(--drk-flaeche); color: var(--drk-dunkelblau); font-weight: 500; }

.content-download a, .content-downloads a, .enclosure a { font-weight: 400; }
.content-download a::before, .content-downloads a::before { content: "↓ "; color: var(--drk-rot); }

.content-gallery ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.content-gallery li { margin: 0; }
.content-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }

/* Buttons und Formulare */
.button, button.submit, input.submit, .widget-submit button, .mod_search button {
    display: inline-block; background: var(--drk-rot); color: #fff; border: 0; border-radius: 3px;
    padding: .6em 1.2em; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none;
}
.button:hover, button.submit:hover, input.submit:hover, .widget-submit button:hover, .mod_search button:hover { background: var(--drk-dunkelrot); color: #fff; }
input[type=text], input[type=search], input[type=email], input[type=tel], textarea, select {
    font: inherit; color: var(--drk-text); border: 1px solid var(--drk-linie); border-radius: 3px; padding: .5em .6em; width: 100%; max-width: 32em; background: #fff;
}
.widget { margin-bottom: 1em; }
.widget label { display: block; margin-bottom: .25em; color: var(--drk-dunkelblau); }
.mod_search .formbody { display: flex; gap: .5em; flex-wrap: wrap; align-items: center; }
.mod_search .formbody input[type=search], .mod_search .formbody input[type=text] { flex: 1 1 16em; }
.mod_search .relevance { display: none; }
.mod_search .url { color: #7f7f7f; font-size: .85rem; }

/* ---------- Nachrichten und Termine ---------- */
.layout_latest { display: flow-root; padding: 1.2em 0; border-bottom: 1px solid var(--drk-flaeche); }
.layout_latest .image_container { margin: .2em 1.5em .5em 0 !important; max-width: 40%; }
.layout_latest .image_container img { display: block; }
.layout_latest h2 { font-size: 1.25rem; margin-bottom: .3em; }
.layout_latest h2 a { color: var(--drk-rot); text-decoration: none; }
.layout_latest h2 a:hover { color: var(--drk-dunkelrot); text-decoration: underline; }
.layout_latest .info { font-size: .85rem; color: #7f7f7f; margin-bottom: .4em; }
.layout_latest .more a { font-weight: 500; }
.layout_full .info { color: #7f7f7f; font-size: .9rem; }
.pagination ul { list-style: none; padding: 0; display: flex; gap: .3em; flex-wrap: wrap; }
.pagination a, .pagination strong { display: block; padding: .3em .7em; border: 1px solid var(--drk-flaeche); text-decoration: none; }
.pagination strong { background: var(--drk-dunkelblau); color: #fff; }
.back a::before { content: "← "; }

.mod_eventlist .event { border-bottom: 1px solid var(--drk-flaeche); }
.mod_eventlist .event table { margin: 0; }
.mod_eventlist .event td { border: 0; padding: .7em .5em; }
.mod_eventlist .layout_upcoming { padding: .4em 0; }
.mod_eventlist .date { color: var(--drk-dunkelblau); font-weight: 400; }
.mod_eventlist h2, .mod_newslist > h2 { border-bottom: 2px solid var(--drk-rot); padding-bottom: .3em; }

/* ---------- Startseite ---------- */
.kacheln { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0 0 2.5em; }
.kacheln .mod_article { display: contents; }
.kacheln .mod_article::after { display: none; }
body:has(.buehne) .breadcrumb-wrap { display: none; }
.kacheln .content-image, .kacheln .ce_image {
    margin: 0; background: #fff; border: 1px solid var(--drk-flaeche); display: flex; flex-direction: column;
    transition: box-shadow .2s;
}
.kacheln .content-image:hover { box-shadow: 0 4px 16px rgba(0, 45, 85, .15); }
.kacheln h2 { order: 2; font-size: 1.15rem; margin: 0; padding: .6em .8em .7em; color: var(--drk-rot); }
.kacheln figure { order: 1; margin: 0; }
.kacheln img { width: 100% !important; height: auto !important; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.kacheln figcaption { display: none; }
.startseite .mod_article { margin-bottom: 2.5em; }

/* Mehrspaltige Seiten (Angebote) */
.spalten { display: grid; gap: 24px; margin-bottom: 2em; }
.spalten-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.spalten-60-40 { grid-template-columns: 3fr 2fr; }
.spalten .content-image img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.spalten h2 { font-size: 1.15rem; }

/* ---------- Info-Karten (frueher rechte Spalte) ---------- */
.info-karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 1em; padding-top: 2em; border-top: 1px solid var(--drk-flaeche); }
.info-karten .mod_article { background: var(--drk-hellblau); padding: 1.2em 1.4em; margin: 0; font-size: .95rem; }
.info-karten h2 { font-size: 1.15rem; color: var(--drk-dunkelblau); }
.info-karten img { height: auto; }
.info-karten .jahreskalender div { line-height: 1.8; }

/* ---------- Fussbereich ---------- */
.site-footer { background: var(--drk-flaeche); color: var(--drk-text); margin-top: 2em; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.5em; padding-top: 2em; padding-bottom: 2em; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { width: 128px; height: auto; }
.footer-brand p { margin: 0; padding-left: 14px; border-left: 1px solid var(--drk-linie); font-size: .9rem; line-height: 1.3; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4em 1.4em; }
.footer-nav a, .footer-nav strong { color: var(--drk-dunkelblau); text-decoration: none; font-size: .95rem; }
.footer-nav a:hover { color: var(--drk-dunkelrot); text-decoration: underline; }

/* ---------- Tablet ---------- */
@media (max-width: 1020px) {
    .kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .spalten-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Handy und Tablet bis 980 px: Menue-Schaltflaeche ---------- */
@media (max-width: 980px) {
    body { font-size: 16px; }
    .header-inner { flex-wrap: wrap; min-height: 72px; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
    .brand-logo { width: 120px; }
    .brand-name { font-size: .9rem; padding-left: 12px; }
    .nav-toggle { display: flex; }
    .main-nav { display: none; width: 100%; margin: 0; flex-direction: column; align-items: stretch; border-top: 1px solid var(--drk-flaeche); }
    .main-nav.is-open { display: flex; }
    .main-nav-home { display: block !important; }
    .main-nav ul { flex-direction: column; }
    .main-nav a, .main-nav strong, .main-nav span.active { padding: .8em .2em; border-bottom: 1px solid var(--drk-flaeche); }
    .main-nav .active, .main-nav strong.active { border-left: 3px solid var(--drk-rot); padding-left: .6em; border-bottom-color: var(--drk-flaeche); }
    .main-nav-search-label { position: static; width: auto; height: auto; clip: auto; }
    .page-grid:has(> .subnav) { grid-template-columns: minmax(0, 1fr); }
    .subnav { order: 2; border-top: 2px solid var(--drk-rot); padding-top: .5em; }
    .spalten-60-40 { grid-template-columns: minmax(0, 1fr); }
    .buehne h1 { position: static; transform: none; max-width: none; padding: .5em var(--abstand); }
    .buehne .content-image { display: flex; flex-direction: column-reverse; }
}

@media (max-width: 560px) {
    .spalten-3 { grid-template-columns: minmax(0, 1fr); }
    .float_left, figure.float_left, .float_right, figure.float_right, .layout_latest .image_container { float: none !important; max-width: 100%; margin: 0 0 1em !important; }
    .header-inner { flex-wrap: nowrap; }
    .main-nav { position: absolute; left: 0; right: 0; top: 100%; background: #fff; padding: 0 var(--abstand) .5em; box-shadow: 0 8px 16px rgba(0, 0, 0, .08); }
    .nav-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .nav-toggle { padding: .6em; }
    .brand { gap: 10px; }
    .brand-logo { width: 104px; }
    .brand-name { font-size: .8rem; padding-left: 10px; }
}

/* Backend-Schalter "hideonsmall" (CSS-Klasse am Artikel) weiterhin beachten */
@media (max-width: 430px) {
    .hideonsmall { display: none !important; }
    /* Kachelbereich ganz weglassen, wenn alle Kacheln ausgeblendet sind */
    .kacheln:not(:has(.mod_article:not(.hideonsmall))) { display: none; }
}

@media print {
    .site-header nav, .nav-toggle, .subnav, .site-footer nav, .info-karten { display: none !important; }
    body { font-size: 11pt; color: #000; }
}
