* {
  box-sizing: border-box;
}

:root {
  --green-deep: #0b1a05;
  --green: #1b3809;
  --gold: #bfab51;
  --gold-light: #d5c88e;
  /* Wärmeres Beige statt fast-weiß - sorgt für spürbareren Kontrast zu den
     weißen Kacheln und wirkt papierhafter/traditioneller. */
  --cream: #f4ecdd;
  --ink: #1a1a1a;
  --wrap: 1400px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--ink);
  background-color: var(--cream);
  /* Dezente Papier-Struktur statt Einheitsfläche: feines Rauschen +
     zwei sanfte Farblichter in Gold/Grün, bewusst subtil für Lesbarkeit. */
  background-image:
    radial-gradient(circle at 12% -8%, rgba(191, 171, 81, 0.14), transparent 42%),
    radial-gradient(circle at 100% 15%, rgba(27, 56, 9, 0.08), transparent 38%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-attachment: fixed;
  background-repeat: no-repeat, no-repeat, repeat;
}

h1, h2, h3 {
  font-family: "Fraunces", Georgia, serif;
  margin: 0;
  line-height: 1.05;
}

main {
  flex: 1 0 auto;
  /* Ohne das behalten Flex-Items als Cross-Axis-Standard min-width:auto -
     ihre Mindestbreite richtet sich dann nach dem breitesten Inhalt
     (z. B. eine min-width:480px-Tabelle), wodurch die ganze Seite statt nur
     der eigentlich dafür vorgesehenen overflow-x:auto-Stelle horizontal
     wächst/scrollt. min-width:0 erlaubt main, unter diese Inhaltsbreite zu
     schrumpfen, sodass der Overflow dort landet, wo er hingehört. */
  min-width: 0;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ---- Skip Link (Barrierefreiheit) ---- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--green);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 2000;
  border-radius: 0 0 8px 0;
}

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

/* ---- Fokus-Sichtbarkeit ---- */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ---- Header ---- */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(244, 236, 221, 0.85);
  backdrop-filter: blur(6px);
  transition: background-color 0.3s ease;
}

header.scrolled {
  background-color: rgba(244, 236, 221, 0.98);
  box-shadow: 0 2px 12px rgba(11, 26, 5, 0.06);
}

.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1rem 2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.brand-name {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--green);
}

.brand-name em {
  font-style: normal;
  color: var(--gold);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.main-nav a {
  color: var(--green);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--gold);
}

/* "Mehr"-Dropdown: für Inhalte, die keinen eigenen Platz in der
   Hauptnavigation brauchen (aktuell: Wichtige Links und Dokumente). */
.nav-dropdown {
  position: relative;
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--green);
  font-weight: 500;
  font-size: 0.95rem;
  font-family: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.dropdown-toggle:hover,
.nav-dropdown.open .dropdown-toggle {
  color: var(--gold);
}

.dropdown-arrow {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.nav-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.9rem);
  left: 50%;
  transform: translateX(-50%);
  background-color: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(11, 26, 5, 0.15);
  padding: 0.5rem;
  min-width: 260px;
  z-index: 10;
}

.nav-dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  color: var(--green-deep);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  background-color: var(--cream);
  color: var(--green);
}

.dropdown-menu a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--green);
}

/* Kontakt/Termine stehen normalerweise direkt in der Hauptnav und wandern
   erst bei knapperer Breite gestaffelt ins "Mehr"-Dropdown (siehe
   Responsiv-Block weiter unten). Standardmäßig ausgeblendet, damit sie auf
   breiten Viewports nicht doppelt (Nav + Dropdown) auftauchen. */
.dropdown-menu a.dropdown-menu-extra-kontakt,
.dropdown-menu a.dropdown-menu-extra-termine {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Burger-Menu: nur auf Mobile sichtbar (siehe Responsiv-Block), als drei
   CSS-Balken gezeichnet statt Unicode-Zeichen für exakte Zentrierung
   unabhängig von Schriftart/Betriebssystem. */
.burger {
  display: none;
  width: 34px;
  height: 34px;
  padding: 0;
  cursor: pointer;
  color: var(--green);
  background: none;
  border: none;
  position: relative;
  flex-shrink: 0;
}

.burger span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 2px;
  background-color: var(--green);
  transform: translate(-50%, -50%);
  transition: background-color 0.25s ease;
}

.burger span::before,
.burger span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background-color: var(--green);
  transition: top 0.25s ease, transform 0.25s ease;
}

.burger span::before { top: -6px; }
.burger span::after { top: 6px; }

/* Verwandelt die drei Balken in ein "X", sobald das Menü offen ist -
   aria-expanded wird bereits per JS gesetzt, hier nur die Optik dazu. */
.burger[aria-expanded="true"] span {
  background-color: transparent;
}

.burger[aria-expanded="true"] span::before {
  top: 0;
  transform: rotate(45deg);
}

.burger[aria-expanded="true"] span::after {
  top: 0;
  transform: rotate(-45deg);
}

.social-icons {
  display: flex;
  gap: 0.6rem;
}

.social-icons a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: rgba(27, 56, 9, 0.07);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.social-icons a svg {
  width: 18px;
  height: 18px;
}

.social-icons a:hover {
  background-color: var(--gold);
  color: var(--green-deep);
}

.cta-button {
  background-color: var(--green);
  color: var(--cream);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.cta-button:hover {
  background-color: var(--gold);
  color: var(--green-deep);
}

/* ---- Bento-Grid (Startseite) ----
   Verzahnung entsteht durch unterschiedliche Zeilenhöhen je Spalte, statt
   eines durchgängigen Rasters. minmax() statt fixer Zeilenhöhe verhindert,
   dass Kacheln mit viel Inhalt über ihre Zeile hinausragen. */
.bento {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(90px, auto);
  gap: 1.25rem;
}

.tile {
  border-radius: 22px;
  padding: 1.75rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background-color: #fff;
  box-shadow: 0 1px 2px rgba(11, 26, 5, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
  color: inherit;
}

.tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(11, 26, 5, 0.14);
}

.tile:hover .tile-link,
.tile:hover .link-small {
  transform: translateX(4px);
}

.tile:hover .tile-small-icon {
  transform: scale(1.08);
}

.tile h3 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--green-deep);
}

.tile p {
  margin: 0;
}

/* Hero */
.tile-hero {
  grid-column: 1 / 4;
  grid-row: 1 / 4;
  background-size: cover;
  background-position: center;
  padding: 3rem;
}

.eyebrow {
  color: var(--gold-light);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.tile-hero h1 {
  color: #fff;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-text {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  max-width: 34ch;
  margin-bottom: 1.75rem;
}

.btn-outline {
  align-self: flex-start;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-weight: 600;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  background-color: #fff;
  color: var(--green-deep);
}

/* Training (frühere "1951 gegründet"-Kachel, dient jetzt als Anker-Ziel
   für den Header-Link "Training"). Nutzt wie alle anderen Content-Kacheln
   das linksbündige Kicker/Überschrift/Link-Muster, hier auf Gold. */
.tile-stat {
  grid-column: 4 / 5;
  grid-row: 1 / 2;
}

.tile-stat h3 {
  color: #fff;
}

/* Termine-Teaser */
.tile-termine {
  grid-column: 4 / 5;
  grid-row: 2 / 4;
  background-color: var(--green);
  color: var(--cream);
  text-decoration: none;
}

.tile-termine h3 {
  color: var(--cream);
}

.tile-termine .tile-meta {
  color: rgba(244, 236, 221, 0.75);
  font-size: 0.85rem;
  margin: 0.35rem 0 0;
}

/* Liste für 1-2 Termine am gleichen Tag (js/termine-teaser.js) - etwas
   kompakter als die einzelne Überschrift, damit auch zwei Einträge in die
   Kachel passen. */
.tile-termine-liste {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tile-termine-eintrag h3 {
  font-size: 1.05rem;
}

.tile-termine-eintrag .tile-meta {
  margin: 0.1rem 0 0;
}

.tile-kicker {
  color: var(--gold-light);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

/* Einheitliches Überschrift-/Link-Format für alle "Content-Kacheln"
   (Training, Termine, Königshaus, Ämter) - nur die Farbe unterscheidet
   sich je nach Hintergrund. */
.tile-stat h3,
.tile-termine h3,
.tile-koenigshaus h3,
.tile-aemter h3 {
  font-size: 1.2rem;
}

.tile-link {
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 0.6rem;
  display: inline-block;
  text-decoration: none;
  transition: transform 0.25s ease;
}

.tile-termine .tile-link {
  color: var(--gold-light);
}

/* Carousel-Kachel (wiederverwendetes Carousel-System)
   Feste Höhe ist hier bewusst gesetzt: .tile-carousel liegt in einer
   grid-auto-rows:auto-Zeile, hat also von Haus aus keine definierte Höhe.
   Ohne festen Wert lösen sich die height:100%-Ketten von
   .carousel-container/-track/-item/img nicht auf, wodurch ein großes
   Beitragsbild in seiner echten (oft hochkant-lastigen) Auflösung gerendert
   wird und die ganze Bento-Zeile in die Länge zieht. Der Wert 200px matcht
   bewusst die Höhe der "Nächster Termin"-Kachel (Zeile 2-3), damit beide
   mittleren Kachelzeilen gleich hoch wirken. */
.tile-carousel {
  grid-column: 1 / 3;
  grid-row: 4 / 6;
  width: 100%;
  height: 200px;
  padding: 0;
}

.tile-carousel .carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease;
}

.carousel-item {
  min-width: 100%;
  height: 100%;
  box-sizing: border-box;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center;
}

.carousel-error {
  padding: 2rem 1rem;
  text-align: center;
  margin: 0;
  color: var(--green-deep);
}

.caption {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background-color: rgba(11, 26, 5, 0.65);
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.95rem;
  margin: 0;
}

.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(11, 26, 5, 0.55);
  color: #fff;
  font-size: 1.6rem;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1;
}

.carousel-control:hover {
  background-color: var(--gold);
  color: var(--green-deep);
}

.carousel-control.prev { left: 12px; }
.carousel-control.next { right: 12px; }

.carousel-dots {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  gap: 6px;
  z-index: 1;
}

.carousel-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--green);
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.carousel-dots button[aria-selected="true"] {
  background: #4a4a4a;
}

/* Foto-Kacheln (Königshaus etc.) */
.tile-photo {
  background-size: cover;
  background-position: center;
}

.tile-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, rgba(11, 26, 5, 0.85), rgba(11, 26, 5, 0.05) 65%);
}

.tile-photo > * {
  position: relative;
  z-index: 1;
}

.tile-koenigshaus {
  grid-column: 3 / 4;
  grid-row: 4 / 6;
}

/* .tile-koenigshaus nutzt (anders als andere .tile-photo-Kacheln) ein
   echtes <img> statt background-image, damit sich Zoom/Position im
   Admin-Panel (admin/koenigshaus.php) genau wie bei den Personenfotos per
   transform einstellen lassen. Liegt bewusst UNTER dem .tile-photo::before-
   Verlauf (z-index:0 vs. 1), damit der abdunkelnde Verlauf für lesbaren
   Text weiterhin sichtbar bleibt. */
.tile-koenigshaus-bildwrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.tile-koenigshaus-bildwrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center;
}

.tile-koenigshaus h3 {
  color: #fff;
}

.light {
  color: #fff !important;
}

/* Wichtige Ämter und Ehrenmitglieder (frühere "Mitglied werden"-Position) */
.tile-aemter {
  grid-column: 4 / 5;
  grid-row: 4 / 6;
  background-color: var(--gold);
  text-decoration: none;
}

.tile-aemter .tile-kicker {
  color: var(--green);
}

.tile-aemter h3 {
  color: var(--green-deep);
}

.tile-aemter .tile-link {
  color: var(--green-deep);
}

/* Kleine Kacheln (Mitglied werden, Altpapier) */
.tile-small {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
}

.tile-small-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--green);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}

.tile-small-icon svg {
  width: 20px;
  height: 20px;
}

.tile-small-title {
  font-weight: 600;
  color: var(--green-deep);
  font-size: 0.95rem;
  margin: 0;
  text-align: left;
}

.tile-small-meta {
  font-size: 0.8rem;
  color: rgba(26, 26, 26, 0.6);
  margin: 0.15rem 0 0;
  text-align: left;
}

/* Altpapier-Annahme: dunkles Grün wie Termine/Kontakt, damit sie als
   "wichtiger Hinweis" statt reiner Utility-Kachel wahrgenommen wird. */
.tile-altpapier {
  grid-column: 2 / 3;
  grid-row: 6 / 7;
}

.tile-galerie {
  grid-column: 1 / 2;
  grid-row: 6 / 7;
}

/* Maps-Kachel: linke Spalte Adresse/Überschrift, rechts füllt die Karte
   den restlichen Platz. */
.tile-maps {
  grid-column: 3 / 5;
  grid-row: 6 / 7;
  padding: 0;
  flex-direction: row;
  align-items: stretch;
}

.tile-maps-info {
  flex: 0 0 33%;
  padding: 1.25rem 1.5rem;
  background-color: #fff;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

.tile-maps-info h3 {
  color: var(--green-deep);
  font-size: 1.05rem;
}

.tile-maps-info .tile-kicker {
  color: var(--green);
}

/* Kein Iframe auf der Startseite (Datenschutz + schlanke Kachel) - nur ein
   Vorschaubild, das zu Google Maps verlinkt. Solange images/maps-vorschau.jpg
   fehlt, greift die dunkelgrüne Fallback-Fläche. Die "echte", interaktive
   Karte ist für die Kontakt-Seite vorgesehen. */
.tile-maps-map {
  flex: 1 1 auto;
  display: block;
  position: relative;
  isolation: isolate;
  background-color: var(--green);
  background-image: url('../images/Maps2.png');
  background-size: cover;
  background-position: center;
}

/* Farbton statt Filterkette: "color" überträgt nur Farbton/Sättigung des
   Grüns, behält aber die Helligkeitsstufen des Originalbilds bei - Wege
   bleiben hell, Wald bleibt dunkel, nur die Farbe wechselt zu Oliv. Das ist
   deutlich lesbarer als eine Graustufen+Sepia-Filterkette. */
.tile-maps-map::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--green);
  mix-blend-mode: color;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.tile-maps-map:hover::after {
  opacity: 0.95;
}

/* Zusätzlicher Text-Link zum Standort, gut sichtbar links neben der
   Kartenvorschau. */
.tile-maps-link {
  display: inline-block;
  color: var(--green);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: color 0.2s ease, transform 0.25s ease;
}

.tile-maps-link:hover {
  color: var(--gold);
  transform: translateX(4px);
}

.link-small {
  display: inline-block;
  color: var(--green);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  transition: transform 0.25s ease;
}

.link-small:hover {
  text-decoration: underline;
}

/* ---- Einzelseiten-Karte (Berichte-Liste, Bericht, Admin, Termine) ---- */
.page-wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.6rem 1.1rem;
  border: 1.5px solid var(--green);
  border-radius: 999px;
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.25s ease;
}

.back-link:hover {
  background-color: var(--green);
  color: var(--cream);
  transform: translateX(-4px);
}

.back-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.content-card {
  background-color: #fff;
  border-radius: 22px;
  padding: 2rem 2.5rem;
  box-shadow: 0 1px 2px rgba(11, 26, 5, 0.06);
}

.content-card h1 {
  color: var(--green-deep);
  margin-bottom: 0.5rem;
}

.content-card h2 {
  color: var(--green-deep);
  font-size: 1.3rem;
  margin: 0 0 0.75rem;
}

/* ---- Königshaus-Seite ---- */
.koenigshaus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.koenigshaus-karte {
  background-color: var(--cream);
  border-radius: 18px;
  padding: 1.5rem;
  text-align: center;
}

/* .tile-kicker ist standardmäßig gold-hell für dunkle Kachel-Hintergründe
   ausgelegt - auf der hellen Cream-Karte hier zu kontrastarm, daher Grün. */
.koenigshaus-karte .tile-kicker {
  color: var(--green);
}

.koenigshaus-haupt {
  margin-top: 0.5rem;
}

/* Wrapper übernimmt Größe/Rundung/Clipping, das <img> darin trägt Zoom
   und Verschieben als transform (aus dem admin-foto-position-Widget) -
   nur so bleibt der sichtbare Kreis fix, während das Bild darin "zoomt". */
.koenigshaus-foto-wrap {
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 0.6rem;
  /* Sichtbar als runder Platzhalter, wenn keine Person kein Foto hat (siehe
     js/koenigshaus.js) - bei vorhandenem Foto deckt object-fit:cover die
     Fläche vollständig ab, daher hier unkritisch immer gesetzt. */
  background-color: rgba(11, 26, 5, 0.06);
}

.koenigshaus-foto-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center;
}

.koenigshaus-foto-wrap-gross {
  width: 128px;
  height: 128px;
}

.koenigshaus-foto-wrap-klein {
  width: 64px;
  height: 64px;
}

.koenigshaus-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--green-deep);
  margin: 0;
}

.koenigshaus-beiname {
  font-style: italic;
  color: rgba(26, 26, 26, 0.6);
  font-size: 0.9rem;
  margin: 0.15rem 0 0;
}

.koenigshaus-begleiter {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(11, 26, 5, 0.1);
  flex-wrap: wrap;
}

.koenigshaus-begleiter-person {
  flex: 0 1 90px;
}

.koenigshaus-name-klein {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--green-deep);
  margin: 0;
}

.koenigshaus-position {
  font-size: 0.75rem;
  color: rgba(26, 26, 26, 0.6);
  margin: 0.1rem 0 0;
}

.koenigshaus-beschreibung {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  max-width: none;
}

#koenigshausHistorie {
  margin-top: 1.5rem;
}

/* Historie: <details> hält jede Kategorie-Tabelle standardmäßig
   eingeklappt - platzsparend ohne eigenes JS für Auf-/Zuklappen. */
.koenigshaus-historie-gruppe {
  border-radius: 12px;
  background-color: var(--cream);
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.75rem;
}

.koenigshaus-historie-gruppe summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--green-deep);
}

.koenigshaus-historie-tabelle {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-top: 0.85rem;
  font-size: 0.85rem;
}

/* table-layout:fixed sorgt dafür, dass die Jahr-Spalte in jeder der
   separaten Kategorie-Tabellen exakt gleich breit ist, statt sich (wie bei
   auto-layout) an der Anzahl/Länge der übrigen Spalten je Tabelle zu
   orientieren. */
.koenigshaus-historie-tabelle th:first-child,
.koenigshaus-historie-tabelle td:first-child {
  width: 4.5rem;
}

.koenigshaus-historie-tabelle th,
.koenigshaus-historie-tabelle td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid rgba(11, 26, 5, 0.08);
  overflow-wrap: break-word;
}

.koenigshaus-historie-tabelle th {
  color: var(--green-deep);
  font-weight: 600;
}

.koenigshaus-historie-tabelle tr:last-child td {
  border-bottom: none;
}

/* ---- Training-Seite ---- */
/* flex statt grid: bei weniger als 3 Angeboten sollen die Kacheln ihre
   feste Breite behalten (nicht auf volle Zeilenbreite gestreckt werden,
   wie es 1fr-Spalten in einem Grid tun würden). flex-grow:0 auf den
   Kacheln sorgt dafür, dass eine unvollständige letzte Zeile links bündig
   stehen bleibt statt sich zu strecken. */
.training-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

/* Mehr Luft zwischen der Trainings-Kachelreihe und der nachfolgenden
   "Interesse geweckt?"-Überschrift, statt direkt aneinanderzustoßen. */
#trainingListe + h2 {
  margin-top: 2.5rem;
}

.training-karte {
  flex: 0 1 calc((100% - 3rem) / 3);
  min-width: 280px;
  background-color: var(--cream);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(11, 26, 5, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Gleiche Hover-Animation wie die Bento-Kacheln auf der Startseite (Lift +
   weicher Schatten), damit sich die Trainingskacheln konsistent anfühlen. */
.training-karte:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(11, 26, 5, 0.14);
}

.training-bild-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.training-bild-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center;
}

.training-inhalt {
  padding: 1.5rem;
}

.training-inhalt h3 {
  color: var(--green-deep);
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.training-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.training-meta-zeile {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  font-size: 0.9rem;
}

.training-meta-zeile svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--green);
  margin-top: 0.1rem;
}

.training-weitere-infos {
  font-size: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(11, 26, 5, 0.1);
}

.training-weitere-infos p {
  margin: 0 0 0.75rem;
}

.training-weitere-infos ul {
  margin: 0 0 0.75rem;
  padding-left: 1.3rem;
}

.training-weitere-infos p:last-child {
  margin-bottom: 0;
}

.training-galerie-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.training-galerie-thumb {
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: none;
  transition: transform 0.2s ease;
}

.training-galerie-thumb:hover {
  transform: scale(1.06);
}

.training-galerie-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Schlichte Lightbox für die Werbe-Bilder - ein einziges Overlay-Element,
   das per JS wiederverwendet wird statt für jedes Bild ein eigenes zu
   erzeugen. */
/* display:none als Grundzustand (nicht das hidden-Attribut) - eine reine
   .training-lightbox-Regel mit display:flex hätte dieselbe Spezifität wie
   die UA-Regel "[hidden]{display:none}" und würde sie unberechenbar
   überschreiben, sobald hidden per JS gesetzt wird. */
.training-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background-color: rgba(11, 26, 5, 0.9);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.training-lightbox.ist-offen {
  display: flex;
}

.training-lightbox-bild {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  object-fit: contain;
}

.training-lightbox-schliessen {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
}

.training-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(244, 236, 221, 0.15);
  border: none;
  color: #fff;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
}

.training-lightbox-nav:hover {
  background: rgba(244, 236, 221, 0.3);
}

.training-lightbox-zurueck {
  left: 1.5rem;
}

.training-lightbox-weiter {
  right: 1.5rem;
}

@media (max-width: 700px) {
  .training-karte {
    flex: 1 1 100%;
  }
}

/* ---- Ämter-Seite ---- */
/* Zwei Funktionsgruppen nebeneinander statt jede volle Breite - nutzt die
   sonst leere rechte Seite bei Gruppen mit nur 1-2 Personen deutlich
   besser aus. justify-content:center sorgt dafür, dass eine bei ungerader
   Gruppenanzahl übrig bleibende letzte Gruppe zentriert statt gestreckt
   wird (flex-grow bewusst 0). */
.aemter-funktionsgruppen-reihe {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 0.5rem;
}

.aemter-funktionsgruppe-block {
  flex: 0 1 calc(50% - 1.25rem);
  min-width: 280px;
}

.aemter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin: 1rem 0 1.75rem;
}

.aemter-karte {
  background-color: var(--cream);
  border-radius: 18px;
  padding: 1.25rem;
  text-align: center;
}

.aemter-foto-wrap {
  border-radius: 50%;
  overflow: hidden;
  background-color: rgba(11, 26, 5, 0.06);
}

.aemter-foto-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center;
}

.aemter-foto-wrap-standard {
  width: 88px;
  height: 88px;
  margin: 0 auto 0.6rem;
}

.aemter-foto-wrap-klein {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

/* Untergruppen-Überschrift innerhalb eines Abschnitts (z. B. "Vorsitzende"
   innerhalb "Geschäftsführender Vorstand"). */
.aemter-funktionsgruppe {
  font-size: 1rem;
  color: var(--green);
  margin: 1.1rem 0 0.5rem;
}

.aemter-amt {
  font-size: 0.8rem;
  color: var(--green);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0;
}

.aemter-name {
  font-weight: 600;
  color: var(--green-deep);
  margin: 0.2rem 0 0;
}

.aemter-email {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--green);
  word-break: break-word;
}

#aemterEhrenmitglieder {
  margin-top: 1.5rem;
}

.aemter-ehren-gruppe {
  border-radius: 12px;
  background-color: var(--cream);
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.75rem;
}

.aemter-ehren-gruppe summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--green-deep);
}

.aemter-ehren-liste {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.aemter-ehren-liste li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background-color: #fff;
  border-radius: 10px;
}

.aemter-ehren-text {
  flex: 1 1 auto;
  min-width: 0;
}

.aemter-ehren-name {
  font-weight: 600;
  color: var(--green-deep);
  margin: 0;
}

.aemter-ehren-titel {
  font-weight: 500;
  color: var(--green);
}

.aemter-ehren-beschreibung {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: rgba(26, 26, 26, 0.75);
}

/* Berichte-Liste */
.berichte-liste {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.bericht-eintrag-link {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: inherit;
  text-decoration: none;
  border-radius: 16px;
  padding: 1rem;
  background-color: var(--cream);
  transition: background-color 0.2s ease;
}

.bericht-eintrag-link:hover {
  background-color: var(--gold-light);
}

.bericht-eintrag-link.angepinnt {
  border: 2px solid var(--green);
  background-color: #ecdfc7;
}

.bericht-eintrag-link.angepinnt:hover {
  background-color: var(--gold-light);
}

.bericht-angepinnt-hinweis {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0 0 0.35rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background-color: rgba(27, 56, 9, 0.12);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bericht-angepinnt-hinweis svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.bericht-eintrag-bild {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.bericht-eintrag-text h2 {
  margin: 0 0 0.25rem;
  font-size: 1.3rem;
  color: var(--green-deep);
}

.bericht-datum {
  font-size: 0.9rem;
  color: rgba(26, 26, 26, 0.6);
  margin: 0 0 0.5rem;
}

.bericht-excerpt {
  margin: 0 0 0.5rem;
}

.weiterlesen {
  font-weight: 600;
  color: var(--green);
}

@media (min-width: 700px) {
  .bericht-eintrag-link {
    flex-direction: row;
    align-items: center;
  }
  .bericht-eintrag-bild {
    width: 280px;
    flex-shrink: 0;
  }
}

/* Kalenderraster: echter Monatskalender statt Liste. Startet immer beim
   aktuellen Monat (js/termine-liste.js), Navigation per Pfeiltasten rechts
   neben dem Monatsnamen. */
.kalender-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem;
}

.kalender-nav h2 {
  font-size: 1.3rem;
  color: var(--green-deep);
  /* Feste Mindestbreite, damit die Pfeile nicht je nach Länge des
     Monatsnamens ("Mai 2026" vs. "September 2026") hin- und herspringen. */
  min-width: 15ch;
}

.kalender-pfeile {
  display: flex;
  gap: 0.4rem;
}

.kalender-pfeile button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background-color: var(--cream);
  color: var(--green);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.kalender-pfeile button:hover {
  background-color: var(--gold);
  color: var(--green-deep);
}

.kalender-wochentage {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.kalender-wochentage span {
  background-color: var(--green);
  color: var(--cream);
  text-align: center;
  padding: 0.4rem 0.2rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
}

.kalender-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  transition: opacity 0.25s ease;
}

/* Sanfter Übergang beim Monatswechsel statt hartem Sprung */
.kalender-grid.wechselt,
.kalender-agenda.wechselt {
  opacity: 0;
}

.kalender-tag {
  min-height: 92px;
  min-width: 0;
  background-color: var(--cream);
  border-radius: 10px;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.kalender-tag.ausserhalb {
  background-color: transparent;
}

.kalender-tag.heute {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.kalender-tag-nummer {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--green-deep);
}

/* Zeit und Ort stehen fest im Text (nicht nur im Hover-Tooltip) - wichtig
   für Mobile und alle, die einen Hover ohnehin nie zu sehen bekommen.
   Deshalb darf der Text hier umbrechen statt abgeschnitten zu werden. */
.kalender-termin {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  font-size: 0.66rem;
  line-height: 1.25;
  background-color: var(--green);
  color: var(--cream);
  padding: 0.25rem 0.4rem;
  border-radius: 5px;
  white-space: normal;
  overflow-wrap: break-word;
}

.kalender-termin-titel {
  font-weight: 600;
}

.kalender-termin-meta {
  font-size: 0.9em;
  opacity: 0.8;
}

.kalender-mehr {
  font-size: 0.62rem;
  color: var(--green);
  font-weight: 600;
}

/* Agenda-Liste: einspaltige, immer voll ausgeschriebene Alternative zum
   Raster - auf Mobile sichtbar statt der Kacheln, da Titel/Zeit/Ort dort
   in 7 schmalen Spalten nicht lesbar umbrechen. Auf Desktop per CSS
   ausgeblendet (siehe @media weiter unten), das Raster reicht dort. */
.kalender-agenda {
  display: none;
  transition: opacity 0.25s ease;
}

.agenda-eintrag {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background-color: var(--cream);
  border-radius: 12px;
}

.agenda-tag {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--green);
  color: var(--cream);
  font-family: "Fraunces", serif;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.agenda-titel {
  font-weight: 600;
  color: var(--green-deep);
  margin: 0;
}

.agenda-meta {
  font-size: 0.85rem;
  color: rgba(26, 26, 26, 0.65);
  margin: 0.15rem 0 0;
}

.kalender-abo {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(11, 26, 5, 0.1);
  text-align: center;
}

.btn-abo {
  display: inline-block;
  background-color: var(--green);
  color: var(--cream);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-abo:hover {
  background-color: var(--gold);
  color: var(--green-deep);
}

/* Rechtstexte (Impressum, Datenschutz) */
.legal-text h2 {
  font-size: 1.2rem;
  color: var(--green-deep);
  margin: 2rem 0 0.75rem;
}

.legal-text h2:first-child {
  margin-top: 1.5rem;
}

.legal-text p {
  margin: 0 0 0.75rem;
  max-width: 68ch;
}

.legal-text .hinweis {
  background-color: var(--cream);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: rgba(26, 26, 26, 0.75);
}

/* Bericht-Detailseite */
.bericht-zurueck {
  margin-top: 0;
}

.bericht-zurueck a {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}

.bericht-hero {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
  margin: 1rem 0;
  display: block;
}

.bericht-text p {
  margin: 0 0 1rem;
}

.bericht-anhaenge {
  margin-top: 1.5rem;
}

.bericht-anhaenge h2 {
  font-size: 1.1rem;
  color: var(--green-deep);
  margin: 0 0 0.75rem;
}

.bericht-anhaenge-liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bericht-anhaenge-liste a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  background-color: var(--cream);
  border-radius: 10px;
  color: var(--green-deep);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}

.bericht-anhaenge-liste a:hover {
  background-color: var(--gold-light);
}

.bericht-anhang-icon {
  flex-shrink: 0;
  color: var(--green);
}

.bericht-anhang-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.bericht-galerie {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.bericht-galerie img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

/* ---- Galerie-Seite ---- */
/* Jahres-Auswahl als einfache Pill-Buttons, aktives Jahr farblich gefüllt
   statt nur umrandet (Zustand über aria-current, von js/galerie.js
   gesetzt). */
.galerie-jahr-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.25rem 0;
}

.galerie-jahr-filter button {
  background-color: transparent;
  border: 1.5px solid var(--green);
  color: var(--green);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.galerie-jahr-filter button:hover {
  background-color: rgba(27, 56, 9, 0.08);
}

.galerie-jahr-filter button[aria-current="true"] {
  background-color: var(--green);
  color: var(--cream);
}

.galerie-bericht {
  margin-top: 2rem;
}

.galerie-bericht:first-child {
  margin-top: 0.5rem;
}

.galerie-bericht-kopf {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.6rem;
  margin-bottom: 0.85rem;
  border-bottom: 2px solid rgba(11, 26, 5, 0.12);
}

.galerie-bericht-kopf h2 {
  margin: 0;
}

/* Klassische "justified gallery": feste Höhe, Breite ergibt sich aus dem
   natürlichen Seitenverhältnis + flex-grow gleicht die letzte Zeile so aus,
   dass die Bilder immer bündig bis zum Rand reichen - ganz ohne pro Bild
   die Abmessungen vorab berechnen zu müssen. */
.galerie-bericht-bilder {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.galerie-bericht-bilder img {
  height: 180px;
  flex: 1 1 auto;
  min-width: 120px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

@media (max-width: 700px) {
  .galerie-bericht-bilder img {
    height: 120px;
  }
}

/* ---- Footer (schlank) ---- */
/* Kein eigener margin-top mehr: der addierte sich bisher zum bereits
   vorhandenen Bottom-Padding von .bento/.page-wrap und ließ den Abstand vor
   dem Footer sichtbar größer wirken als den symmetrischen Abstand nach dem
   Header (der obendrein farblich nicht abgesetzt ist, dadurch fiel dort
   nichts auf). */
.site-footer {
  background-color: var(--green-deep);
  color: rgba(244, 236, 221, 0.7);
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "Fraunces", serif;
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
}

.footer-brand img {
  width: 30px;
  height: 30px;
}

.footer-brand em {
  font-style: normal;
  color: var(--gold-light);
}

.footer-copy {
  font-size: 0.85rem;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: rgba(244, 236, 221, 0.75);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--gold-light);
}

.footer-links a.admin-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.lock-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* ---- Gestaffeltes Nav-Overflow (zwischen Mobile-Menü und voller Breite) ----
   Zwischen ~1000px und ~1110px reicht der Platz für alle 5 Hauptlinks +
   "Mehr"-Button + Logo + Actions nicht mehr aus - ohne Eingriff bricht die
   Nav in eine zweite Zeile um. Statt dessen wandern Kontakt und (bei noch
   knapperer Breite) Termine gestaffelt ins "Mehr"-Dropdown, bis wieder
   alles in eine Zeile passt. */
@media (min-width: 1001px) and (max-width: 1109px) {
  /* Attribut-Selektor statt [data-nav-key]: build.ps1 entfernt data-nav-key
     auf allen Seiten außer der jeweils aktiven (siehe build.ps1) - href
     bleibt dagegen auf jeder Seite unverändert "kontakt.html". */
  .main-nav > a[href="kontakt.html"] { display: none; }
  .dropdown-menu a.dropdown-menu-extra-kontakt { display: flex; }
}

@media (min-width: 1001px) and (max-width: 1026px) {
  .main-nav > a[href="termine.html"] { display: none; }
  .dropdown-menu a.dropdown-menu-extra-termine { display: flex; }
}

/* ---- Responsiv ----
   Ein einziger Umbruchpunkt: Bento-Grid und Header-Nav wechseln
   gemeinsam auf gestapelte, einspaltige Darstellung. Kein separates
   Tablet-Zwischenlayout, um die Fläche für Fehlerquellen klein zu halten. */
@media (max-width: 1000px) {
  .bento {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    padding: 1rem 1.25rem;
  }

  .tile-hero, .tile-stat, .tile-termine, .tile-carousel,
  .tile-koenigshaus, .tile-aemter, .tile-altpapier,
  .tile-galerie, .tile-maps {
    grid-column: 1 / 2 !important;
    grid-row: auto !important;
  }

  .tile-hero { min-height: 340px; }
  .tile-carousel, .tile-koenigshaus { min-height: 260px; }

  .header-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    /* Die vom Desktop-Grid geerbte gap:1.5rem hat hier unbemerkt Platz
       gefressen und den Umbruch schon ausgelöst, obwohl Marke + Actions
       eigentlich noch nebeneinander gepasst hätten - space-between braucht
       keinen zusätzlichen Gap. */
    gap: 0;
    padding: 1rem 1.25rem;
  }

  .burger { display: flex; align-items: center; justify-content: center; }

  .main-nav {
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    background-color: var(--cream);
    border-radius: 12px;
    padding: 0;
    margin-top: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease,
      margin-top 0.3s ease, visibility 0s linear 0.3s;
  }

  .main-nav.show {
    max-height: 420px;
    opacity: 1;
    padding: 1rem 0;
    margin-top: 0.5rem;
    visibility: visible;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease,
      margin-top 0.3s ease, visibility 0s linear 0s;
  }

  .dropdown-menu {
    position: static;
    transform: none;
    box-shadow: none;
    background-color: transparent;
    padding: 0.4rem 0 0;
    min-width: 0;
  }

  .dropdown-menu a {
    justify-content: center;
  }

  .header-actions { gap: 0.85rem; }

  .page-wrap { padding: 1rem 1.25rem 2.5rem; }
  .content-card { padding: 1.5rem; }

  .tile-maps { flex-direction: column; }
  .tile-maps-info { flex: none; }
  .tile-maps-map { min-height: 220px; }

  /* Historie-Tabellen (Königshaus) haben je nach Kategorie 2-4 Spalten -
     auf schmalen Handys quetscht table-layout:fixed die Namen sonst
     unlesbar zusammen. Statt das Layout umzubauen (und damit die auf
     Desktop gewollte einheitliche Jahr-Spaltenbreite zu verlieren) bleibt
     die Tabelle bei ihrer Mindestbreite und wird bei Bedarf waagerecht
     scrollbar. */
  .koenigshaus-historie-gruppe {
    overflow-x: auto;
  }

  .koenigshaus-historie-tabelle {
    min-width: 480px;
  }

  /* Unter 1000px übernimmt die Agenda-Liste (siehe oben) - im Raster
     bricht Text in 7 schmalen Spalten sonst unlesbar Zeichen für Zeichen
     um. Wichtig für Mobile und weniger geübte Nutzer:innen. */
  .kalender-wochentage,
  .kalender-grid {
    display: none;
  }

  .kalender-agenda {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }

  .footer-inner { flex-direction: column; text-align: center; }
}

/* ---- Animationen ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Kein "forwards/both" Fill-Mode: eine gefüllte Animation "gewinnt" sonst
   dauerhaft gegenüber späteren normalen transform-Regeln (z. B. :hover) im
   Cascade-Vergleich, selbst nachdem sie fertig gelaufen ist - das hat den
   Hover-Schwebeeffekt lautlos blockiert. Ohne Fill-Mode verhält sich das
   Element nach 0.6s wieder normal, optisch macht das keinen Unterschied
   (Endzustand der Animation entspricht ohnehin dem Ruhezustand). */
.tile, .content-card {
  animation: fadeInUp 0.6s ease;
}

@media (prefers-reduced-motion: reduce) {
  .tile, .content-card {
    animation: none;
  }
  .carousel-track {
    transition: none;
  }
  .tile:hover {
    transform: none;
  }
}
