:root {
  --green-dark: #14452f;
  --green-hover: #0d2e1f;
  --green-light: #2d6b2d;
  --gold: #c9a227;
  --alert-red: #d32f2f;
  --alert-red-bg: #fde8e8;
  --bg-main: #f5f7f5;
  --card-bg: #ffffff;
  --border-soft: #eaeee9;
  --text-main: #2b3330;
  --text-light: #ffffff;
  --text-muted: #6b7280;
  --text-white-dim: rgba(255,255,255,0.75);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,40,28,0.04), 0 4px 16px rgba(16,40,28,0.05);
  --shadow-hover: 0 8px 20px rgba(16,40,28,0.08), 0 16px 48px rgba(16,40,28,0.10);
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  --font: 'Inter','Segoe UI','Open Sans',sans-serif;
  --sidebar-w: 260px;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
  font-family: var(--font);
  background: var(--bg-main);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* Sicherheit: lange Wörter/URLs nie das Layout sprengen */
p, li, a, h1, h2, h3, h4, span, div { overflow-wrap: break-word; }

/* ==============================
   NINA WARNING BAR (Top Banner)
   ============================== */
#nina-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  background: var(--alert-red);
  color: #fff;
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(211,47,47,0.3);
}
#nina-bar.active { display: block; }
#nina-bar .nina-close {
  float: right;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.2rem;
  cursor: pointer;
}
#nina-bar .nina-close:hover { color: #fff; }

/* ==============================
   SIDEBAR / NAVIGATION
   ============================== */
#left {
  margin-left: 0 !important;
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--green-dark);
  color: var(--text-light);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

#left .logo-area {
  padding: 28px 20px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 8px;
}

#left .logo-area img {
  width: 44px; height: auto;
  flex-shrink: 0;
}

#left .logo-area .site-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

#left .logo-area .site-sub {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

#left .nav {
  list-style: none;
  padding: 4px 0;
  flex: 1;
}

#left .nav li { margin: 2px 8px; }

#left .nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: var(--text-white-dim);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

#left .nav a:hover,
#left .nav a.active,
#left .nav strong.active {
  background: var(--green-hover);
  color: #fff;
}

#left .nav a .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Subnav – Level 2 (Kinder) */
#left .nav li ul.level_2 {
  list-style: none;
  padding: 2px 0 2px 20px;
  margin: 0;
}
#left .nav li ul.level_2 li { margin: 1px 8px; }
#left .nav li ul.level_2 li a {
  display: block;
  padding: 7px 12px;
  color: var(--text-white-dim);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 400;
  opacity: 0.7;
  transition: var(--transition);
}
#left .nav li ul.level_2 li a:hover { opacity: 1; background: var(--green-hover); }
#left .nav li ul.level_2 li.active a { opacity: 1; color: #fff; }

/* Subnav – Level 3 (Enkel) */
#left .nav li ul.level_3 {
  list-style: none;
  padding: 2px 0 2px 16px;
  margin: 0;
}
#left .nav li ul.level_3 li a {
  display: block;
  padding: 5px 12px;
  color: var(--text-white-dim);
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.55;
  transition: var(--transition);
}
#left .nav li ul.level_3 li a:hover { opacity: 1; background: var(--green-hover); }

/* Alte .sub-Klasse (Fallback) */
#left .nav .sub a {
  padding-left: 42px;
  font-size: 0.78rem;
  font-weight: 400;
  opacity: 0.6;
}

#left .nav .sub a:hover { opacity: 1; }
#left .nav .warning-icon { color: var(--alert-red); }

/* Container-Toggle (Nav) */
#left .nav .nav-toggle-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  color: var(--text-white-dim);
  border: none;
  background: none;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}
#left .nav .nav-toggle-btn:hover {
  background: var(--green-hover);
  color: #fff;
}
#left .nav .nav-toggle-icon {
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform 0.3s;
  opacity: 0.5;
}
#left .nav .nav-toggle-btn[aria-expanded="true"] .nav-toggle-icon {
  transform: rotate(180deg);
}
#left .nav .nav-toggle-btn[aria-expanded="true"] {
  color: #fff;
}
#left .nav .nav-toggle-btn .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Subnav-Wrapper (Toggle) */
#left .nav .nav-sub-wrap {
  display: none;
  padding-left: 0;
}
#left .nav .nav-sub-wrap.is-open {
  display: block;
}

#left .sponsors-area {
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: auto;
}

#left .sponsors-area .sp-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.4;
  margin-bottom: 8px;
}

#left .sponsors-area .sponsors {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#left .sponsors-area .sponsors span {
  font-size: 0.75rem;
  opacity: 0.5;
  padding: 4px 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
}

/* ==============================
   MOBILE HEADER
   ============================== */
.mobile-header {
  display: none;
  background: var(--green-dark);
  color: #fff;
  padding: 13px 16px;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(16,40,28,0.18);
}

.mobile-header .mobile-logo {
  font-weight: 700;
  font-size: 1.1rem;
}

.menu-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
}

/* ==============================
   HEADER BAR (desktop top bar)
   ============================== */
.header-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  padding: 16px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.header-bar .greeting {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-bar .header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-bar .header-actions .btn-login {
  font-size: 0.85rem;
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--green-dark);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.header-bar .header-actions .btn-login:hover { background: var(--green-hover); }

/* ==============================
   MAIN CONTENT
   ============================== */
body:has(#left) #wrapper {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
}
#wrapper {
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
#container {
  flex: 1;
  position: relative;
  z-index: 3;
}

#main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px;
  flex: 1;
  width: 100%;
  float: none;
}

#main .inside {
  max-width: 100%;
  margin: 0 auto;
  min-height: 50vh;
}

/* ==============================
   HERO WRAPPER – Custom Section
   Gefüllt per Contao-Modul in Sektion hero_image
   Startseite (.startseite) = groß | Content = schmal
   ============================== */
.hero-wrapper {
  width: 100%;
  position: relative;
  overflow: hidden;
  background: var(--green-dark);
}

.hero-wrapper:empty { display: none; }

.hero-wrapper .hero-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  z-index: 0;
}
.hero-wrapper:has(.ce_gallery) .hero-fallback,
.hero-wrapper:has(.content-gallery) .hero-fallback { display: none; }

/* Section-Container in hero-wrapper – padding/margin entfernen */
.hero-wrapper > .inside,
.hero-wrapper .mod_section,
.hero-wrapper .mod_section > .inside {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
}

/* Gallery/Slider in hero-wrapper – absolut füllen */
.hero-wrapper .ce_gallery,
.hero-wrapper .content-gallery {
  position: absolute;
  inset: 0;
  margin: 0 !important;
}
.hero-wrapper .ce_gallery ul,
.hero-wrapper .content-gallery ul {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

/* Eigener Fade-Slider (per script.js aus der Galerie gebaut) */
.hero-slider-track {
  position: absolute;
  inset: 0;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}
.hero-slide.is-active {
  opacity: 1;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* Bilder im Hero: cover + top center */
.hero-wrapper .ce_gallery img,
.hero-wrapper .content-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* Ausfaden nach unten – mask statt ::after (kein z-index-Problem) */
.startseite .hero-wrapper {
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

/* Hero Text-Overlay */
.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 2;
  padding: 40px 20px;
}

.hero-overlay .hero-wappen {
  height: 160px !important;
  width: auto;
  margin-bottom: 8px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}

.hero-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,30,20,0.15) 0%, rgba(10,30,20,0.30) 45%, rgba(10,30,20,0.55) 100%);
  z-index: -1;
}

.hero-overlay .hero-pre {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 4px;
}

.hero-overlay .hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero-overlay .hero-sub {
  font-size: 1.05rem;
  font-weight: 400;
  color: rgba(255,255,255,0.8);
  margin-top: 8px;
}

/* Groß: Startseite */
.startseite .hero-wrapper {
  height: calc(65vh - 50px);
  min-height: 350px;
  background: var(--green-dark);
}
.startseite .hero-wrapper img {
  height: 100%;
}
.startseite .hero-overlay .hero-title {
  font-size: 3.2rem;
}

/* Schmal: Content-Seiten */
.hero-wrapper {
  height: 200px;
}
.hero-wrapper img {
  height: 100%;
}

/* ==============================
   DASHBOARD GRID (Startseite)
   ============================== */
.startseite #main { padding-top: 0; }
.startseite .block { overflow: visible; }
.startseite .mod_article.layout-3-col {
  display: block;
}
.startseite .dashboard-grid {
  position: relative;
  z-index: 3;
  margin-top: -60px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: 20px;
  margin-bottom: 36px;
}

/* ==============================
   GRID SPAN UTILITIES
   1-4 Spalten breite Karten
   ============================== */
.col-span-1 { grid-column: span 1; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }

/* ==============================
   AKTUELLES-GRID (News auf Startseite)
   ============================== */
.aktuelles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 36px;
}

.aktuelles-grid .news-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}
.aktuelles-grid .news-item:hover { box-shadow: var(--shadow-hover); }
.aktuelles-grid .news-item .news-image img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.aktuelles-grid .news-item .news-text {
  padding: 16px;
}
.aktuelles-grid .news-item .news-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.aktuelles-grid .news-item .news-title a { color: var(--green-dark); }
.aktuelles-grid .news-item .news-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.aktuelles-grid .news-item .news-teaser {
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.5;
  margin-top: 8px;
}

/* ==============================
   VEREINE-GRID (Community auf Startseite)
   ============================== */
.vereine-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 36px;
}

.vereine-grid .news-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
  transition: var(--transition);
}
.vereine-grid .news-item:hover { box-shadow: var(--shadow-hover); }
.vereine-grid .news-item .news-image img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
}
.vereine-grid .news-item .news-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.vereine-grid .news-item .news-title a { color: var(--green-dark); }
.vereine-grid .news-item .news-teaser {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 8px;
}

/* ==============================
   BOTTOM ROW (Karte + Quicklinks)
   ============================== */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 36px;
  grid-column: 1 / -1;
}

/* ==============================
   QUICKLINKS BOX (Karte links + Links rechts)
   ============================== */
.quicklinks-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--card-bg);
}

.quicklinks-box .ql-map {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.12), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 26px),
    linear-gradient(135deg, var(--green-light), var(--green-dark));
  transition: var(--transition);
}
.quicklinks-box .ql-map:hover { filter: brightness(1.06); }
.quicklinks-box .ql-map .ql-map-pin { font-size: 2.4rem; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35)); }
.quicklinks-box .ql-map .ql-map-cta {
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(255,255,255,0.16);
  padding: 8px 16px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* "Beuchte entdecken"-Karten-Block (Content-Element) */
.karte-embed {
  background: linear-gradient(135deg, var(--green-light), var(--green-dark));
  color: #fff;
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}
.karte-embed h2 { color: #fff; border: none; padding: 0; margin: 0 0 8px; }
.karte-embed p { color: rgba(255,255,255,0.85); margin-bottom: 18px; }
.karte-btn {
  display: inline-block;
  background: #fff;
  color: var(--green-dark);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 999px;
  transition: var(--transition);
}
.karte-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }
.quicklinks-box .ql-links { padding: 20px; }
.quicklinks-box .ql-links h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  color: var(--green-dark);
}
.quicklinks-box .ql-links ul { list-style: none; }
.quicklinks-box .ql-links li {
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
}
.quicklinks-box .ql-links li:last-child { border: none; }
.quicklinks-box .ql-links a {
  font-size: 0.9rem;
  color: var(--green-dark);
  font-weight: 500;
}
.quicklinks-box .ql-links a:hover { text-decoration: underline; }

/* ==============================
   NEWS-ROW (Bild rechts + Text links)
   ============================== */
.news-row {
  display: flex;
  gap: 0;
  overflow: hidden;
}
.news-row .news-image { flex-shrink: 0; width: 140px; }
.news-row .news-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
}
.news-row .news-text { flex: 1; padding: 16px; }
.news-row .news-text .news-title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.news-row .news-text .news-title a { color: var(--green-dark); }
.news-row .news-text .news-date { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.news-row .news-text .news-teaser { font-size: 0.85rem; color: var(--text-main); line-height: 1.5; }

/* ==============================
   CARDS & TILES
   ============================== */
.card, .tile {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-soft);
  transition: var(--transition);
  min-height: 140px;
  display: flex;
  flex-direction: column;
}

.card:hover, .tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}

.card h2, .tile .tile-label {
  margin-top: 0;
  font-size: 1.15rem;
  font-weight: 700;
  padding-bottom: 12px;
  margin-bottom: 16px;
  color: var(--green-dark);
  position: relative;
}
.card > h2::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 36px; height: 3px;
  border-radius: 3px;
  background: var(--gold);
}

.tile .tile-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
  border: none;
  padding: 0;
}

.tile .tile-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.tile .tile-icon.danger { background: var(--alert-red-bg); color: var(--alert-red); }
.tile .tile-icon.info { background: #e3f2fd; color: #1565c0; }
.tile .tile-icon.success { background: #e8f5e9; color: #2e7d32; }
.tile .tile-icon.warning-accent { background: #fff8e1; color: #f9a825; }

.tile .tile-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 4px;
}

.tile .tile-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.tile .tile-action {
  margin-top: auto;
  padding-top: 16px;
}

.tile .tile-action a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tile .tile-action a:hover { color: var(--green-hover); }

.card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.card .card-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-dark);
  margin-top: 12px;
  display: inline-block;
}

.card .card-link:hover { color: var(--green-hover); }

/* ==============================
   ALARM / RED WARNING CARD (NOTFALL-MELDUNGEN)
   ============================== */
.card-alert {
  background: var(--alert-red);
  color: var(--text-light);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.card-alert > h2::after { display: none; }
.card-alert h2 {
  color: var(--text-light);
  border-bottom: none;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 0;
  margin-bottom: 12px;
}

.card-alert p { color: rgba(255,255,255,0.8); }

.card-alert .alert-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
  opacity: 0.9;
}

.card-alert .nina-warnings .warning-item {
  padding: 6px 0;
  font-size: 0.85rem;
}

.card-alert .card-link {
  color: rgba(255,255,255,0.8);
  font-size: 0.8rem;
  font-weight: 600;
}
.card-alert .card-link:hover { color: #fff; }

/* ==============================
   POPULATION TILE
   ============================== */
.population-tile { cursor: pointer; text-align: center; }
.population-tile .pop-main { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0; transition: opacity 0.3s; }
.population-tile .pop-main.hidden { display: none; }
.population-tile .pop-number { font-size: 3.5rem; font-weight: 800; line-height: 1; color: var(--green-dark); }
.population-tile .pop-label { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.population-tile .pop-sub { font-size: 0.8rem; color: var(--text-muted); }

/* Chart-Zustand */
.population-tile .pop-chart { display: none; flex-direction: column; align-items: center; gap: 8px; }
.population-tile .pop-chart.active { display: flex; }
#popChart { width: 100%; height: 180px; }
.pop-stat-link {
  display: block;
  font-size: 0.78rem;
  color: var(--green-dark);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 0 0;
  border-top: 1px solid rgba(0,0,0,0.06);
  width: 100%;
  text-align: center;
  transition: color 0.2s;
}
.pop-stat-link:hover { color: var(--green-hover); }
.pop-image { width: 80px; height: 80px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }

/* ==============================
   WIDGET CARDS (Vereine/Institutionen)
   ============================== */
.widget-card h2 { font-size: 1rem; margin-bottom: 12px; }
.widget-links { list-style: none; padding: 0; margin: 0; }
.widget-links li { padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,0.06); }
.widget-links li:last-child { border-bottom: none; }
.widget-links a {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s, padding-left 0.2s;
}
.widget-links a:hover { color: var(--green-dark); padding-left: 4px; }

/* ==============================
   ARTICLE LAYOUT SYSTEM
   Per Artikel-CSS-Klasse setzbar:
   .layout-3-col, .layout-2-col, .layout-center
   ============================== */

/* 3 Spalten (Widgets nebeneinander) */
.layout-3-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

/* 2 Spalten: 2/3 Inhalt + 1/3 Widgets */
.layout-2-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
}

/* Zentriert: 2/3 Breite, reiner Text */
.layout-center {
  display: grid;
  grid-template-columns: minmax(auto, 800px);
  justify-content: center;
  text-align: left;
}

/* Grid-Span Utilities – in jedem Grid-Container nutzbar */
.col-span-full { grid-column: 1 / -1; }

/* Hintergrund-Varianten (zusätzlich zu layout-*) */
.bg-history {
  background: #f4ecd8;
  padding: 40px;
  border-radius: var(--radius);
}

.bg-dark {
  background: var(--green-dark);
  color: var(--text-light);
  padding: 40px;
  border-radius: var(--radius);
}

.bg-light {
  background: #f0f4f0;
  padding: 40px;
  border-radius: var(--radius);
}

/* NINA Warnings inline (im Dashboard) */
.nina-warnings .warning-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  font-size: 0.9rem;
  color: rgba(255,255,255,0.9);
}
.nina-warnings .warning-item:last-child { border: none; }
.nina-warnings .warning-item .warn-title { font-weight: 600; }
.nina-warnings .warning-item .warn-date { font-size: 0.75rem; opacity: 0.7; }
.nina-warnings .warning-empty { opacity: 0.7; font-size: 0.9rem; }

/* ==============================
   FOOTER
   ============================== */
body:has(#left) .footer {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
}
.footer, #footer {
  padding: 40px 36px 60px;
  background: var(--green-dark);
  color: var(--text-light);
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer h4 { color: #fff; font-size: 0.9rem; margin-bottom: 12px; }
.footer p, .footer li { font-size: 0.8rem; opacity: 0.7; }
.footer ul { list-style: none; }
.footer a { color: rgba(255,255,255,0.7); }
.footer a:hover { color: #fff; }

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
  opacity: 0.5;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* ==============================
   CONTENT ELEMENTS
   ============================== */

/* Textinhalt */
.content-text { margin-bottom: 24px; }
.content-text .rte { line-height: 1.8; }
.content-text .rte p { margin-bottom: 1em; }
.content-text .rte h2 { font-size: 1.5rem; font-weight: 700; margin: 1.5em 0 0.5em; color: var(--green-dark); }
.content-text .rte h3 { font-size: 1.2rem; font-weight: 600; margin: 1.2em 0 0.4em; color: var(--green-dark); }
.content-text .rte ul, .content-text .rte ol { padding-left: 1.5em; margin-bottom: 1em; }
.content-text .rte li { margin-bottom: 0.3em; }
.content-text .rte a { color: var(--green-dark); text-decoration: underline; }
.content-text .rte a:hover { color: var(--green-hover); }
.content-text .rte img { border-radius: 8px; margin: 1em 0; }
.content-text .rte blockquote {
  border-left: 4px solid var(--green-dark);
  padding: 12px 20px;
  margin: 1em 0;
  background: #f0f4f0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
}
.content-text .rte hr {
  border: none;
  border-top: 2px solid #e0e0e0;
  margin: 2em 0;
}
.content-text .rte table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.content-text .rte th, .content-text .rte td {
  border: 1px solid #e0e0e0;
  padding: 10px 14px;
  text-align: left;
}
.content-text .rte th { background: var(--green-dark); color: #fff; font-weight: 600; }

/* Überschrift */
.ce_headline { margin-bottom: 24px; }
.ce_headline h1 { font-size: 2rem; font-weight: 800; color: var(--green-dark); }
.ce_headline h2 { font-size: 1.6rem; font-weight: 700; color: var(--green-dark); }
.ce_headline h3 { font-size: 1.3rem; font-weight: 600; color: var(--green-dark); }

/* HTML (roh) */
.ce_html { margin-bottom: 24px; }

/* Bild */
.ce_image { margin-bottom: 24px; }
.ce_image figure { margin: 0; }
.ce_image img { border-radius: 8px; width: 100%; height: auto; }
.ce_image figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
  font-style: italic;
}

/* Gallery */
.ce_gallery { margin-bottom: 24px; }
.ce_gallery .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.ce_gallery figure { margin: 0; }
.ce_gallery img { border-radius: 8px; width: 100%; height: 180px; object-fit: cover; }

/* Download */
.ce_download { margin-bottom: 16px; }
.ce_download a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--green-dark);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}
.ce_download a:hover { background: var(--green-hover); }

/* Hyperlink */
.ce_hyperlink { margin-bottom: 16px; }
.ce_hyperlink a {
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: underline;
}
.ce_hyperlink a:hover { color: var(--green-hover); }

/* Accordion */
.ce_accordionStart { margin-bottom: 0; border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
.ce_accordionStart + .ce_accordionStart { border-top: none; border-radius: 0; }
.ce_accordionStart .toggler {
  display: block;
  width: 100%;
  padding: 14px 18px;
  background: #f0f4f0;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  text-align: left;
  color: var(--green-dark);
}
.ce_accordionStart .toggler:hover { background: #e0e8e0; }
.ce_accordionStop { display: none; }
.ce_accordionStart + .ce_accordionStop { display: block; padding: 16px 18px; }

/* YouTube / Vimeo / Video */
.ce_youtube, .ce_vimeo, .ce_player { margin-bottom: 24px; }
.ce_youtube iframe, .ce_vimeo iframe { border-radius: 8px; max-width: 100%; }

/* Toplink */
.ce_toplink { text-align: right; margin: 24px 0; }
.ce_toplink a { font-size: 0.85rem; color: var(--text-muted); }

/* ==============================
   MODULES (Frontend)
   ============================== */

/* Article */
.mod_article {
  margin-bottom: 36px;
  padding: 24px;
  background: transparent;
}
.mod_article.layout-3-col,
.mod_article.layout-2-col,
.mod_article.layout-center {
  padding: 0;
  background: transparent;
}
.mod_article > .content-text:last-child,
.mod_article > .ce_text:last-child { margin-bottom: 0; }

/* Newslist / Newsreader – Contao-Standard-Markup (.layout_short/.latest/.full) als Karten */
.mod_newslist { margin-bottom: 36px; }
.mod_newslist:not(.warn-center) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 22px;
  align-items: start;
}
.mod_newslist .layout_short,
.mod_newslist .layout_latest,
.mod_newslist .layout_full {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}
.mod_newslist .layout_short:hover,
.mod_newslist .layout_latest:hover,
.mod_newslist .layout_full:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}
/* Bild oben */
.mod_newslist figure,
.mod_newslist .image_container { margin: 0; order: -1; }
.mod_newslist figure img,
.mod_newslist .image_container img { width: 100%; height: 190px; object-fit: cover; display: block; background: #eef1ee; }
/* Innenabstand für alle Nicht-Bild-Elemente */
.mod_newslist .layout_short > :not(figure):not(.image_container),
.mod_newslist .layout_latest > :not(figure):not(.image_container),
.mod_newslist .layout_full > :not(figure):not(.image_container) { padding-left: 20px; padding-right: 20px; }
.mod_newslist .info { padding-top: 18px; font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.mod_newslist h2 { font-size: 1.1rem; font-weight: 700; margin: 6px 0 8px; line-height: 1.3; }
.mod_newslist h2 a { color: var(--green-dark); }
.mod_newslist h2 a:hover { color: var(--green-hover); }
.mod_newslist .ce_text { font-size: 0.88rem; color: var(--text-main); line-height: 1.6; }
.mod_newslist .more { padding-bottom: 18px; padding-top: 14px; margin-top: auto; }
.mod_newslist .more a { display: inline-flex; align-items: center; gap: 5px; color: var(--green-dark); font-weight: 600; font-size: 0.85rem; transition: gap 0.2s; }
.mod_newslist .more a:hover { gap: 9px; }
.mod_newslist .empty {
  grid-column: 1 / -1;
  padding: 22px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  background: var(--card-bg);
  border: 1px dashed var(--border-soft);
  border-radius: var(--radius);
}

/* Newsreader */
.mod_newsreader .news-full { padding: 24px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); }
.mod_newsreader .news-full .news-title { font-size: 1.8rem; font-weight: 800; color: var(--green-dark); margin-bottom: 8px; }
.mod_newsreader .news-full .news-date { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; }
.mod_newsreader .news-full .news-text { line-height: 1.8; }
.mod_newsreader .news-back { margin-top: 20px; }
.mod_newsreader .news-back a { color: var(--green-dark); font-weight: 600; }

/* ==============================
   FORMULARE
   ============================== */
.mod_form { margin-bottom: 36px; }
.mod_form .formbody { max-width: 700px; }
.mod_form .widget {
  margin-bottom: 20px;
}
.mod_form label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text-main);
}
.mod_form label .invisible {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}
.mod_form label.mandatory:after {
  content: ' *';
  color: var(--alert-red);
}
.mod_form input[type="text"],
.mod_form input[type="email"],
.mod_form input[type="password"],
.mod_form input[type="tel"],
.mod_form input[type="url"],
.mod_form input[type="number"],
.mod_form textarea,
.mod_form select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.95rem;
  transition: var(--transition);
  background: #fff;
  color: var(--text-main);
}
.mod_form input:focus,
.mod_form textarea:focus,
.mod_form select:focus {
  outline: none;
  border-color: var(--green-dark);
  box-shadow: 0 0 0 3px rgba(20,69,47,0.1);
}
.mod_form textarea { min-height: 120px; resize: vertical; }
.mod_form select { cursor: pointer; appearance: auto; }
.mod_form .widget-checkbox label,
.mod_form .widget-radio label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  cursor: pointer;
  margin-bottom: 4px;
}
.mod_form .widget-checkbox input,
.mod_form .widget-radio input {
  width: 18px; height: 18px;
  accent-color: var(--green-dark);
}
.mod_form .widget-submit button,
.mod_form .widget-submit input[type="submit"] {
  padding: 12px 32px;
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.mod_form .widget-submit button:hover,
.mod_form .widget-submit input[type="submit"]:hover {
  background: var(--green-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(20,69,47,0.3);
}
.mod_form .widget-error {
  color: var(--alert-red);
  font-size: 0.85rem;
  margin-top: 4px;
}
.mod_form .widget-text span.mandatory,
.mod_form .widget-textarea span.mandatory,
.mod_form .widget-password span.mandatory,
.mod_form .widget-select span.mandatory { color: var(--alert-red); margin-right: 2px; }

/* ==============================
   KALENDER / EVENTS
   ============================== */
.mod_calendar { margin-bottom: 36px; overflow-x: auto; }
.mod_calendar table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.mod_calendar th {
  background: var(--green-dark);
  color: #fff;
  padding: 12px 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}
/* Alle Tageszellen einheitlich – feste Höhe, ruhige Optik (egal ob Event oder nicht) */
.mod_calendar td {
  width: 14.285%;
  height: 96px;
  padding: 6px 7px;
  border: 1px solid var(--border-soft);
  font-size: 0.9rem;
  vertical-align: top;
  background: var(--card-bg);
  position: relative;
  overflow: hidden;
}
.mod_calendar td.empty { background: #fafbfa; }
.mod_calendar td.weekend { background: #fbfcfb; }
.mod_calendar td .day {
  display: block;
  text-align: right;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.mod_calendar td .event {
  display: block;
  background: var(--green-light);
  color: #fff;
  font-size: 0.68rem;
  line-height: 1.3;
  padding: 2px 6px;
  border-radius: 5px;
  margin-top: 3px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mod_calendar td .event a { color: #fff; display: block; }
.mod_calendar td.today { box-shadow: inset 0 0 0 2px var(--green-dark); }
.mod_calendar td.today .day { color: var(--green-dark); font-weight: 800; }
.mod_calendar td.highlight { background: #eef5ee; }
.mod_calendar .header { background: #f0f4f0; }
.mod_calendar .header a { color: var(--green-dark); font-weight: 700; }
.mod_calendar .header .month { font-size: 1.1rem; }
.mod_calendar .calendar-nav { display: flex; justify-content: space-between; padding: 12px 16px; }

/* Eventlist */
.mod_eventlist { margin-bottom: 36px; }
.mod_eventlist .event {
  padding: 20px 24px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border-left: 4px solid var(--green-dark);
  transition: var(--transition);
}
.mod_eventlist .event:hover { box-shadow: var(--shadow-hover); }
.mod_eventlist .event .event-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.mod_eventlist .event .event-title a { color: var(--green-dark); }
.mod_eventlist .event .event-date { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.mod_eventlist .event .event-time { font-size: 0.85rem; color: var(--text-muted); }
.mod_eventlist .event .event-location { font-size: 0.85rem; color: var(--text-muted); }
.mod_eventlist .event .event-teaser { font-size: 0.9rem; margin-top: 8px; line-height: 1.6; }
.mod_eventlist .empty { padding: 40px; text-align: center; color: var(--text-muted); font-style: italic; }

/* Eventreader */
.mod_eventreader { margin-bottom: 36px; }
.mod_eventreader .event-full {
  padding: 24px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.mod_eventreader .event-full .event-title { font-size: 1.8rem; font-weight: 800; color: var(--green-dark); margin-bottom: 6px; }
.mod_eventreader .event-full .event-date,
.mod_eventreader .event-full .event-time,
.mod_eventreader .event-full .event-location { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 4px; }
.mod_eventreader .event-full .event-details { margin-top: 20px; line-height: 1.8; }
.mod_eventreader .event-back { margin-top: 20px; }
.mod_eventreader .event-back a { color: var(--green-dark); font-weight: 600; }

/* ==============================
   PAGINATION
   ============================== */
.pagination { margin: 36px 0; text-align: center; }
.pagination ul { list-style: none; display: inline-flex; gap: 4px; }
.pagination li { display: inline; }
.pagination a, .pagination strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px; height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--card-bg);
  color: var(--text-main);
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.pagination a:hover {
  background: var(--green-dark);
  color: #fff;
}
.pagination strong {
  background: var(--green-dark);
  color: #fff;
}

/* ==============================
   SEASONAL OVERLAY (Snow)
   ============================== */
#season-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100vh;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.season-winter #season-overlay .snowflake {
  position: absolute;
  top: -20px;
  color: rgba(255,255,255,0.7);
  font-size: 1em;
  animation: snowfall linear infinite;
  font-family: monospace;
}

@keyframes snowfall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 0.8; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0.2; }
}

/* ==============================
   DEVELOPMENT BANNER (oben rechts)
   Zum Entfernen: Banner-HTML aus template löschen
   ============================== */
.dev-banner {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 9999;
  background: var(--alert-red);
  color: #fff;
  padding: 8px 16px 8px 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  border-bottom-left-radius: 8px;
  pointer-events: auto;
}
.dev-banner button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.2s;
}
.dev-banner button:hover { color: #fff; }

/* ==============================
   ZEITSTRAHL / HISTORIE (Pergament)
   Neueste oben → Linie von oben nach unten
   ============================== */
.zeitstrahl-intro {
  max-width: 820px;
  margin: 0 auto 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
}
.zeitstrahl {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 0;
}
/* Vertikale Linie – mittig */
.zeitstrahl::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: linear-gradient(var(--green-light), var(--green-dark));
  border-radius: 3px;
}
/* Jahr links (50%), Text rechts (50%) */
.zeitstrahl-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 34px;
  align-items: start;
}
.zeitstrahl-item:last-child { margin-bottom: 0; }
/* Punkt auf der Mittellinie */
.zeitstrahl-item::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 6px;
  transform: translateX(-50%);
  width: 19px; height: 19px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--green-dark);
  z-index: 1;
}
.zeitstrahl-jahr {
  grid-column: 1;
  text-align: right;
  padding-right: 34px;
  padding-top: 2px;
  font-weight: 800;
  font-size: 1.7rem;
  color: var(--green-dark);
  letter-spacing: 0.3px;
}
.zeitstrahl-card { margin-left: 34px; }
/* Flyer-Bild in Event-Detailseiten */
.event-flyer {
  display: block;
  max-width: 340px;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow);
  margin: 0 0 18px;
}
@media (max-width: 767px) {
  .zeitstrahl::before { left: 20px; transform: none; }
  .zeitstrahl-item { grid-template-columns: 1fr; gap: 2px; padding-left: 52px; }
  .zeitstrahl-item::before { left: 12px; transform: none; }
  .zeitstrahl-jahr { text-align: left; padding-right: 0; margin-bottom: 4px; }
  .zeitstrahl-card { margin-left: 0; }
}
/* Pergament-Karte */
.pergament, .zeitstrahl-card {
  position: relative;
  background:
    radial-gradient(circle at 15% 20%, rgba(120,85,30,0.06), transparent 55%),
    radial-gradient(circle at 85% 75%, rgba(120,85,30,0.07), transparent 55%),
    linear-gradient(180deg, #f8f1dd, #f1e6c8);
  border: 1px solid #e2d3a8;
  border-radius: 10px;
  padding: 20px 24px;
  box-shadow: 0 2px 8px rgba(90,70,20,0.10), inset 0 0 40px rgba(150,120,50,0.06);
  color: #4a3f28;
  line-height: 1.75;
  font-family: 'Georgia', 'Times New Roman', serif;
}
.pergament h1, .pergament h2, .pergament h3,
.zeitstrahl-card h1, .zeitstrahl-card h2, .zeitstrahl-card h3 {
  color: var(--green-dark);
  font-family: 'Georgia', serif;
  margin-bottom: 8px;
}
.pergament p { margin-bottom: 0.8em; }
.pergament p:last-child { margin-bottom: 0; }
.pergament .quelle, .zeitstrahl-card .quelle {
  font-size: 0.8rem;
  font-style: italic;
  color: #8a7a52;
  margin-top: 12px;
}

/* ==============================
   VEREINS-/INSTITUTIONS-SEITEN
   Inhalt + rechte Widget-Sidebar
   ============================== */
.layout-verein {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}
.layout-verein .verein-main { min-width: 0; }
.layout-verein .verein-side { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 20px; }

/* Schnellzugriff-Leiste oben (Alternative/Ergänzung zur Sidebar) */
.schnellzugriff-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}
.schnellzugriff-bar a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--green-dark);
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.schnellzugriff-bar a:hover { background: var(--green-dark); color: #fff; transform: translateY(-2px); }

/* Info-Widget (Sidebar-Box) */
.info-widget {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.info-widget .iw-head {
  background: var(--green-dark);
  color: #fff;
  padding: 12px 18px;
  font-size: 0.9rem;
  font-weight: 700;
}
.info-widget .iw-body { padding: 16px 18px; font-size: 0.88rem; }
.info-widget .iw-body ul { list-style: none; padding: 0; margin: 0; }
.info-widget .iw-body li { padding: 7px 0; border-bottom: 1px solid var(--border-soft); }
.info-widget .iw-body li:last-child { border-bottom: none; }
.info-widget .iw-body a { color: var(--green-dark); font-weight: 500; }
.info-widget .iw-body a:hover { text-decoration: underline; }

/* ==============================
   PRESSE-GALERIE
   ============================== */
.presse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 8px;
}
.presse-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.presse-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.presse-img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  object-position: top center;
  display: block;
  background: #f0f0f0;
}
.presse-cap {
  padding: 12px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-dark);
}

/* ==============================
   RESPONSIVE – TABLET (768-1023px)
   ============================== */
@media (max-width: 1023px) {
  #left {
    width: 72px;
    min-width: 72px;
  }

  #left .logo-area .site-title,
  #left .logo-area .site-sub,
  #left .nav a span:not(.nav-icon),
  #left .nav .nav-toggle-btn span:not(.nav-icon),
  #left .sponsors-area { display: none; }

  #left .logo-area { justify-content: center; padding: 16px 8px; }
  #left .logo-area img { width: 32px; }
  #left .nav { padding: 4px; }
  #left .nav a { justify-content: center; padding: 12px; border: none; }
  #left .nav .nav-toggle-btn { justify-content: center; padding: 12px; }

  body:has(#left) #wrapper { margin-left: 72px; width: calc(100% - 72px); }
  #main { padding: 24px; }

  body:has(#left) .footer { margin-left: 72px; width: calc(100% - 72px); }

  .startseite .hero-wrapper {
    height: 40vh;
    min-height: 300px;
  }
  .startseite .dashboard-grid {
    margin-top: 0;
  }
  .hero-wrapper {
    height: 150px;
  }

  .layout-3-col { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .aktuelles-grid { grid-template-columns: repeat(2, 1fr); }
  .vereine-grid { grid-template-columns: repeat(2, 1fr); }
  .bottom-row { grid-template-columns: 1fr 1fr; }
  .col-span-2 { grid-column: span 2; }
  .col-span-3 { grid-column: span 2; }
  .col-span-4 { grid-column: span 2; }
}

/* ==============================
   RESPONSIVE – MOBILE (<768px)
   ============================== */
@media (max-width: 767px) {
  body { flex-direction: column; }

  .mobile-header { display: flex; }

  #left {
    transform: translateX(-100%);
    width: 100%;
    min-width: 100%;
    height: 100vh;
    z-index: 200;
  }

  #left.is-open { transform: translateX(0); }

  #left .nav a span:not(.nav-icon),
  #left .nav .nav-toggle-btn span:not(.nav-icon),
  #left .nav .sub a,
  #left .sponsors-area { display: block; }

  #left .logo-area .site-title,
  #left .logo-area .site-sub { display: block; }

  #left .nav { padding: 8px 12px; }
  #left .nav a { justify-content: flex-start; padding: 12px 14px; }
  #left .nav .nav-toggle-btn { justify-content: flex-start; padding: 12px 14px; }
  #left .nav .sub a { padding-left: 48px; }

  #wrapper { margin-left: 0; width: 100%; }
  #main { padding: 16px; }
  .footer { margin-left: 0; width: 100%; padding: 30px 20px; }

  .header-bar { padding: 12px 16px; }
  .header-bar .greeting { display: none; }

  .startseite .hero-wrapper {
    height: calc(40vh - 50px);
    min-height: 200px;
  }
  .startseite .dashboard-grid {
    margin-top: 0;
  }
  .startseite .hero-overlay .hero-title {
    font-size: 1.8rem;
  }
  .startseite .hero-overlay .hero-pre {
    font-size: 0.7rem;
  }
  .hero-wrapper {
    height: 140px;
  }

  .layout-3-col { grid-template-columns: 1fr; }
  .layout-2-col { grid-template-columns: 1fr; }
  .layout-verein { grid-template-columns: 1fr; }
  .layout-verein .verein-side { position: static; top: auto; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .aktuelles-grid { grid-template-columns: 1fr; }
  .vereine-grid { grid-template-columns: 1fr; }
  .bottom-row { grid-template-columns: 1fr; }
  .quicklinks-box { grid-template-columns: 1fr; }
  .news-row { flex-direction: column; }
  .news-row .news-image { width: 100%; height: 140px; }
  .col-span-1, .col-span-2, .col-span-3, .col-span-4 { grid-column: span 1; }
  .population-tile .pop-number { font-size: 2.5rem; }
  #popChart { height: 150px; }
}

/* ==============================
   DASHBOARD-WIDGETS (neu)
   ============================== */
.tile-einwohner { text-align: center; align-items: center; justify-content: center; }
.tile-einwohner .pop-number { font-size: 3rem; font-weight: 800; color: var(--green-dark); line-height: 1; }
.tile-einwohner .pop-label { font-size: 1rem; font-weight: 600; }
.tile-einwohner .pop-sub { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }

.widget-countdown { text-align: center; align-items: center; justify-content: center; }
.widget-countdown .cd-icon { font-size: 1.7rem; line-height: 1; }
.widget-countdown .cd-number { font-size: 2.7rem; font-weight: 800; color: var(--green-dark); line-height: 1; margin-top: 4px; }
.widget-countdown .cd-label { font-size: 0.85rem; font-weight: 600; color: var(--text-main); margin-top: 4px; }
.widget-countdown .cd-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.widget-bio {
  background: linear-gradient(135deg, var(--green-light), var(--green-dark));
  color: #fff; text-align: center; align-items: center; justify-content: center;
  text-decoration: none; border: none;
}
.widget-bio .bio-icon { font-size: 2rem; line-height: 1; }
.widget-bio .bio-title { font-size: 1.05rem; font-weight: 700; margin-top: 6px; color: #fff; }
.widget-bio .bio-text { font-size: 0.8rem; opacity: 0.9; margin-top: 4px; }
.widget-bio .bio-more { font-size: 0.78rem; font-weight: 600; margin-top: 12px; background: rgba(255,255,255,0.18); padding: 6px 14px; border-radius: 999px; }
.widget-bio:hover { filter: brightness(1.06); transform: translateY(-3px); }

/* Login-Link im Footer */
.footer .footer-login a { color: rgba(255,255,255,0.85); font-weight: 600; }
.footer .footer-login a:hover { color: #fff; }

/* ==============================
   FOTO-GALERIE + LIGHTBOX
   ============================== */
.foto-galerie { columns: 3 260px; column-gap: 14px; margin-top: 8px; }
.foto-galerie .fg-item { display: block; margin: 0 0 14px; break-inside: avoid; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); position: relative; cursor: zoom-in; }
.foto-galerie .fg-item img { width: 100%; display: block; transition: transform 0.45s ease; }
.foto-galerie .fg-item:hover img { transform: scale(1.06); }
.foto-galerie .fg-item::after { content: '🔍'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: transparent; font-size: 1.6rem; transition: 0.3s; }
.foto-galerie .fg-item:hover::after { background: rgba(20,69,47,0.28); color: #fff; }
.fg-lightbox { position: fixed; inset: 0; z-index: 9998; background: rgba(0,0,0,0.92); display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.fg-lightbox.is-open { opacity: 1; pointer-events: auto; }
.fg-lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 10px 60px rgba(0,0,0,0.6); }
.fg-lightbox .fg-close { position: absolute; top: 16px; right: 22px; color: #fff; font-size: 2rem; cursor: pointer; background: none; border: none; line-height: 1; }
.fg-lightbox .fg-nav { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 2.6rem; cursor: pointer; background: none; border: none; padding: 0 16px; opacity: 0.8; }
.fg-lightbox .fg-prev { left: 4px; } .fg-lightbox .fg-next { right: 4px; }
.fg-lightbox .fg-nav:hover { opacity: 1; }
@media (max-width: 767px) { .foto-galerie { columns: 2 150px; } .fg-lightbox .fg-nav { font-size: 2rem; } }

/* Statistik-Chart */
.statistik-chart { width: 100%; min-height: 300px; margin: 4px 0; }

/* Native Contao-Galerie als modernes Grid */
.ce_gallery ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; padding: 0; margin: 0; }
.ce_gallery li { margin: 0; }
.ce_gallery figure { margin: 0; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); position: relative; }
.ce_gallery figure img { width: 100%; height: 200px; object-fit: cover; display: block; transition: transform 0.45s ease; }
.ce_gallery a { display: block; cursor: zoom-in; }
.ce_gallery a:hover figure img { transform: scale(1.06); }
@media (max-width: 767px) { .ce_gallery ul { grid-template-columns: repeat(2, 1fr); } .ce_gallery figure img { height: 150px; } }

/* Institutions-Kacheln (Jugend/Feuerwehr/Kirche/Bürgerverein) alle gleich breit, 4 in einer Reihe */
.dashboard-grid .widget-card.col-span-2 { grid-column: span 1; }

/* ==============================
   MOBIL-FIXES
   ============================== */
@media (max-width: 767px) {
  /* Kalender: alle 7 Tage passend, kein Horizontal-Scroll */
  .mod_calendar { overflow-x: visible; }
  .mod_calendar table { table-layout: fixed; width: 100%; }
  .mod_calendar th { font-size: 0.58rem; padding: 8px 1px; overflow: hidden; white-space: nowrap; letter-spacing: 0; }
  .mod_calendar td { height: 48px; width: 14.285%; padding: 3px 2px; font-size: 0.68rem; }
  .mod_calendar td .day { font-size: 0.72rem; text-align: center; font-weight: 700; margin-bottom: 2px; }
  .mod_calendar td .event { font-size: 0.5rem; padding: 1px 2px; margin-top: 2px; line-height: 1.2; }
  .mod_calendar .header .month, .mod_calendar .header a { font-size: 0.95rem; }
  .mod_calendar .calendar-nav { padding: 8px 10px; }

  /* leere Listen-Meldungen auf der Startseite ausblenden (Rauschen) */
  .startseite .mod_newslist:has(.empty),
  .startseite .mod_eventlist:has(.empty) { display: none; }
}
/* leere Meldungen auch am Desktop auf der Startseite ausblenden */
.startseite .mod_newslist:has(.empty),
.startseite .mod_eventlist:has(.empty) { display: none; }

/* ==============================
   INFO-KANAL (Mitteilungen-Strip, Startseite)
   ============================== */
.info-kanal { display: block !important; grid-template-columns: none !important; background: #fff8e1; border: 1px solid #ffe082; border-radius: var(--radius); padding: 14px 20px; margin-bottom: 24px; }
.info-kanal::before { content: "📢 Mitteilungen aus Beuchte"; display: block; font-weight: 700; color: #8a6d00; margin-bottom: 6px; font-size: 0.95rem; }
.info-kanal .layout_short, .info-kanal .layout_latest, .info-kanal .layout_full { background: none; border: none; box-shadow: none; border-radius: 0; padding: 7px 0; display: block; border-bottom: 1px dashed #ffe082; }
.info-kanal .layout_short:last-child { border-bottom: none; }
.info-kanal .layout_short:hover, .info-kanal .layout_latest:hover { transform: none; box-shadow: none; }
.info-kanal figure, .info-kanal .image_container, .info-kanal .more { display: none; }
.info-kanal .layout_short > *, .info-kanal .layout_latest > * { padding-left: 0 !important; padding-right: 0 !important; }
.info-kanal .info { padding-top: 0; font-size: 0.66rem; }
.info-kanal h2 { font-size: 0.95rem; margin: 2px 0; }
.info-kanal .ce_text { font-size: 0.82rem; line-height: 1.5; }

/* Bio-Energiedorf: hervorgehobene Intro-Box */
.bio-hero { background: linear-gradient(135deg, var(--green-light), var(--green-dark)); color: #fff; border-radius: var(--radius); padding: 28px 32px; margin-bottom: 28px; }
.bio-hero h1 { color: #fff; margin: 0 0 8px; }
.bio-hero p { color: rgba(255,255,255,0.92); margin: 0; }

/* ==============================
   AGENDA-LISTE (Kalender als Terminliste, Google-Kalender-Stil)
   ============================== */
.agenda-list { display: block; margin-bottom: 36px; }
.agenda-list > h2 { font-size: 1.3rem; color: var(--green-dark); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--border-soft); }
.agenda-list .event {
  display: block; background: var(--card-bg); border: 1px solid var(--border-soft);
  border-left: 4px solid var(--green-light); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 20px; margin-bottom: 12px; transition: var(--transition);
}
.agenda-list .event:hover { box-shadow: var(--shadow-hover); transform: translateX(3px); }
.agenda-list.past .event { border-left-color: #c2c2c2; }
.agenda-list .event h2, .agenda-list .event h3, .agenda-list .event .event-title { font-size: 1.05rem; font-weight: 700; margin: 2px 0 4px; }
.agenda-list .event a { color: var(--green-dark); }
.agenda-list .event a:hover { color: var(--green-hover); }
.agenda-list .event time, .agenda-list .event .event-date, .agenda-list .event .date {
  font-size: 0.8rem; color: var(--green-dark); font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
}
.agenda-list .event .event-location, .agenda-list .event .location { font-size: 0.82rem; color: var(--text-muted); }
.agenda-list .empty { padding: 18px; background: var(--card-bg); border: 1px dashed var(--border-soft); border-radius: var(--radius); color: var(--text-muted); font-style: italic; }

/* Kalender responsiv: Desktop = Monatsraster, Handy = Agenda-Liste */
@media (min-width: 768px) { .agenda-list { display: none !important; } }
@media (max-width: 767px) { .mod_calendar { display: none !important; } }

/* ==============================
   MD-INHALTE (Contao .ce_html) – Typografie & Tabellen
   Gilt für alle über texte/*.md erzeugten Seiten
   ============================== */
.ce_html { line-height: 1.75; }
.ce_html h1 { font-size: 2rem; font-weight: 800; color: var(--green-dark); margin: 0.2em 0 0.5em; }
.ce_html h2 { font-size: 1.5rem; font-weight: 700; color: var(--green-dark); margin: 1.4em 0 0.4em; }
.ce_html h3 { font-size: 1.2rem; font-weight: 600; color: var(--green-dark); margin: 1.2em 0 0.3em; }
.ce_html p { margin-bottom: 1em; }
.ce_html ul, .ce_html ol { padding-left: 1.5em; margin-bottom: 1em; }
.ce_html li { margin-bottom: 0.3em; }
.ce_html a { color: var(--green-dark); text-decoration: underline; }
.ce_html a:hover { color: var(--green-hover); }
.ce_html blockquote { border-left: 4px solid var(--green-light); background: #f0f4f0; padding: 12px 20px; margin: 1em 0; border-radius: 0 8px 8px 0; font-style: italic; }
.ce_html img { border-radius: 8px; }
/* md-Tabellen */
table.content-table { width: 100%; border-collapse: collapse; margin: 1.2em 0; background: var(--card-bg); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
table.content-table th, table.content-table td { border: 1px solid var(--border-soft); padding: 10px 14px; text-align: left; }
table.content-table th { background: var(--green-dark); color: #fff; font-weight: 600; }
table.content-table tbody tr:nth-child(even) { background: #f7faf7; }
