:root {
  --primary: #1e398f;
  --secondary: #ffe066;
  --background: linear-gradient(135deg, #ffe066 0%, #1e398f 100%);
  --card-bg: #091ab3;
  --blue-gradient: linear-gradient(120deg, #2344b8 30%, #1e398f 100%);
  --shadow: 0 8px 40px rgba(30, 57, 143, 0.12);
  --radius: 8px;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

.fixed-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  width: 100vw;
  height: 100vh;
  background: var(--background);
  background-attachment: fixed;
}

body {
  background: transparent;
}

.container {
  max-width: 1020px;
  margin: 32px auto 0 auto;
  padding: 0 16px 36px 16px;
}

.header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 36px;
  margin-bottom: 36px;
  gap: 22px;
}

.header-logo {
  width: 110px;
  height: 110px;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 2px 16px #23398e11;
  background: #e8edfd;
}

.header-title {
  flex: 1 1 auto;
  text-align: center;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 2.4em;
  font-weight: 800;
  color: var(--primary);
  background: var(--secondary);
  border-radius: 18px;
  padding: 10px 24px;
  letter-spacing: 2px;
  box-shadow: 0 2px 16px #ffe06640;
  display: inline-block;
}

.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--blue-gradient);
  color: var(--secondary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 42px 36px 32px 36px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.portrait {
  display: block;
  margin: 0 auto 22px auto;
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid var(--secondary);
  background: #f7f8fc;
  box-shadow: 0 4px 24px #1e398f18;
}

.hero-section h2 {
  font-family: 'Montserrat', Arial, sans-serif;
  color: var(--secondary);
  font-weight: 700;
  font-size: 2em;
  margin: 0 0 8px 0;
  text-shadow: 0 1px 10px #1e398f44;
}

.hero-section p {
  color: var(--secondary);
  font-size: 1.13em;
  font-weight: 500;
  margin-bottom: 0.8em;
  margin-top: 0;
  text-align: center;
  text-shadow: 0 2px 8px #1e398f30;
}

.yellow-card-section {
  background: var(--secondary);
  color: var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px 26px 32px;
  margin-bottom: 32px;
  font-family: 'Quicksand', Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.1em;
  font-weight: 500;
}

.yellow-card-section h2 {
  font-family: 'Montserrat', Arial, sans-serif;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.45em;
  margin-top: 0;
  margin-bottom: 14px;
  letter-spacing: 1px;
}

.highlights-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  width: 100%;
}

.highlight-card {
  background: var(--blue-gradient);
  color: var(--secondary);
  border-radius: 20px;
  box-shadow: 0 4px 18px #23398e16;
  padding: 22px 22px 16px 22px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-family: 'Quicksand', Arial, sans-serif;
  font-size: 1.08em;
  font-weight: 500;
  line-height: 1.7;
  transition: transform 0.14s;
}

.highlight-card strong {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1.19em;
  letter-spacing: 1px;
  color: var(--secondary);
  text-shadow: 0 1px 8px #23398e44;
}

.highlight-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 32px #1e398f18;
}

.motto-section {
  background: var(--secondary);
  color: var(--primary);
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1.28em;
  font-style: italic;
  font-weight: 700;
  box-shadow: 0 2px 16px #ffe06622;
  margin: 0 auto 28px auto;
  padding: 18px 24px;
  text-align: center;
  max-width: 800px;
  letter-spacing: 1px;
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  text-align: center;
  padding: 10px 10px 10px 10px;
  color: #ffe066;
  background: var(--primary);
  font-size: 1.12em;
  letter-spacing: 1px;
  box-shadow: 0 0px 16px #12306312;
  font-family: 'Montserrat', Arial, sans-serif;
}

/* Burger-Menü */
.burger-menu {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 10001;
  width: 44px;
  height: 44px;
  background: #ffe066;
  border-radius: 12px;
  box-shadow: 0 2px 12px #ffe06633;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  outline: none;
  transition: background 0.2s;
}

.burger-menu:hover {
  background: #fffbe6;
}

.burger-icon {
  width: 26px;
  height: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.burger-icon span {
  display: block;
  height: 4px;
  width: 100%;
  background: #1e398f;
  border-radius: 2px;
  transition: all 0.2s;
}

.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background: #ffe066;
  box-shadow: 2px 0 24px #1e398f22;
  z-index: 10000;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(.4, 1.3, .5, 1);
  display: flex;
  flex-direction: column;
  padding-top: 70px;
}

.side-menu.open {
  transform: translateX(0);
}

.side-menu a {
  color: #1e398f;
  text-decoration: none;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1.0em;
  font-weight: 700;
  padding: 18px 32px;
  border-radius: 8px;
  margin: 0 12px 8px 12px;
  transition: background 0.18s;
}

.side-menu a:hover {
  background: #fffbe6;
}

.side-menu .close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  font-size: 1.0em;
  color: #1e398f;
  cursor: pointer;
}

/* Tab-Menü */
.tab-menu {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 8px;
  background: #ffe066;
  border-bottom: 2px solid #1e398f22;
  box-shadow: 0 2px 12px #ffe06633;
  padding: 0.5em 0 0.5em 0;
  position: relative;
  z-index: 9;
}

.tab-link {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1.0em;
  font-weight: 700;
  color: #1e398f;
  text-decoration: none;
  padding: 0.5em 1.4em;
  border-radius: 10px 10px 0 0;
  background: transparent;
  transition: background 0.18s, color 0.18s;
  border: none;
  outline: none;
  box-shadow: none;
  margin-bottom: -2px;
}

.tab-link.active,
.tab-link:hover {
  background: #fffbe6;
  color: #2344b8;
  box-shadow: 0 2px 12px #ffe06633;
}

/* Hofstaat-Styles */
.hofstaat-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: 32px 0 24px 0;
}

.hofstaat-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--blue-gradient);
  color: var(--secondary);
  border-radius: 20px;
  box-shadow: 0 4px 18px #23398e16;
  padding: 18px 28px;
  font-family: 'Quicksand', Arial, sans-serif;
  font-size: 1.08em;
  font-weight: 500;
  line-height: 1.7;
  transition: transform 0.14s;
}

.hofstaat-card strong {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1.13em;
  color: var(--secondary);
  margin-right: 8px;
}

.hofstaat-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 32px #1e398f18;
}

.hofstaat-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #e8edfd;
  box-shadow: 0 2px 16px #23398e11;
  margin-right: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  color: #1e398f;
  font-family: 'Montserrat', Arial, sans-serif;
}

.back-link {
  display: inline-block;
  margin-top: 18px;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1.08em;
  color: var(--primary);
  background: var(--secondary);
  padding: 8px 18px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 2px 12px #ffe06633;
  transition: background 0.18s, color 0.18s;
}

.back-link:hover {
  background: #fffbe6;
  color: #2344b8;
}

/* Popup overlay + animierbarer Content */
.bild-popup {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;               /* sichtbar nur bei .open */
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.bild-popup.open {
  display: block;
  pointer-events: auto;
  /* leicht dunkeln + weichzeichnen des Hintergrunds */
  background: rgba(0,0,0,0.14);
  backdrop-filter: blur(8px) saturate(0.95);
  -webkit-backdrop-filter: blur(8px) saturate(0.95); /* Safari */
}

/* das tatsächlich animierte Panel */
.bild-popup-content {
  width: 1ßßßpx;        /* feste Standardbreite */
  max-width: 90vw;     /* nicht breiter als Viewport */
  min-width: 320px;    /* Minimum */
  max-height: 85vh;    /* höhe begrenzen */
  box-sizing: border-box;
  opacity: 0;
  transform-origin: center;
  /* Transition für die Eigenschaften, die wir animieren */
  transition:
    opacity 420ms cubic-bezier(.2,.9,.2,1),
    top 420ms cubic-bezier(.2,.9,.2,1),
    left 420ms cubic-bezier(.2,.9,.2,1),
    width 420ms cubic-bezier(.2,.9,.2,1),
    height 420ms cubic-bezier(.2,.9,.2,1),
    transform 420ms cubic-bezier(.2,.9,.2,1);
  overflow: visible; /* damit Profilbild rausragen kann */
}

/* Innen: Text und Profilbild */
.popup-img-rahmen-wrapper { position: relative; width: 100%; height: 100%; }
.popup-rahmen-text {
  display: block;
  color: #1e398f;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1em;
  line-height: 1.3;
  text-align: left;
  padding: 8px 12px;
  box-sizing: border-box;
}

/* Symbol oben links (falls verwendet) */
.popup-symbol-img {
  display: none;
  position: absolute;
  top: 12px;
  left: 12px;
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  z-index: 30;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  background: #fff;
}

/* Überschreiben: keine abgerundeten Ecken für das Symbol */
.popup-symbol-img {
  border-radius: 0 !important;
  overflow: visible; /* falls Parent das Bild sonst zuschneidet */
}

/* funktion-img (Profilbild) — bleibt unabhängig, kann rausragen */
.funktion-img {
  position: absolute;
  right: -36px;    /* ragt rechts aus der Karte heraus */
  bottom: -16px;
  width: 160px;    /* anpassen */
  height: auto;
  object-fit: contain;
  z-index: 20;
  border-radius: 0;
  box-shadow: none;
  border: none;
}

/* Close Button (oben rechts auf der Karte) */
.bild-popup-close {
  position: absolute;
  top: -12px;
  right: -12px;
  background: #1e398f;
  color: #fff;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 40;
}

/* Responsive */
@media (max-width: 850px) {
  .header-card,
  .hero-section,
  .yellow-card-section {
    padding: 20px 8vw;
  }
  .highlights-section {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 600px) {
  .header-card {
    flex-direction: column;
    padding: 12px 3vw;
  }
  .header-title {
    font-size: 1.2em;
    padding: 7px 10px;
  }
  .hero-section,
  .yellow-card-section {
    padding: 16px 3vw;
  }
  .portrait {
    width: 100px;
    height: 100px;
  }
  .motto-section {
    font-size: 1em;
    padding: 11px 8px;
  }
  .burger-menu {
    top: 12px;
    left: 12px;
    width: 38px;
    height: 38px;
  }
  .side-menu {
    width: 80vw;
    min-width: 160px;
  }
  .tab-menu {
    padding: 0.5em 0;
  }
  .tab-link {
    font-size: 1em;
    padding: 0.5em 1em;
  }
  .highlight-card {
    padding: 18px 16px;
    font-size: 1em;
  }
  .yellow-card-section {
    padding: 24px 16px;
  }
  .hero-section {
    padding: 32px 16px;
  }
  .header-logo {
    width: 90px;
    height: 90px;
  }
  .header-card {
    padding: 18px 12px;
  }
  .footer {
    font-size: 1em;
    padding: 8px 8px;
  }
  .burger-icon span {
    height: 3px;
  }
}

/* Mobile: Navigation tweaks */
@media (max-width: 800px) {
  /* Tab-Menü ausblenden, damit es nicht doppelt mit dem Burger erscheint */
  .tab-menu {
    display: none;
  }

  /* Sicherstellen, dass Burger sichtbar (falls JS noch nicht eingefügt wurde) */
  .burger-menu {
    display: flex;
  }

  /* Side menu als Overlay (vollbild-schatten) */
  .side-menu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 80vw;
    max-width: 360px;
    transform: translateX(-110%);
    transition: transform 260ms cubic-bezier(.2,.9,.2,1);
    z-index: 10002;
    box-shadow: 4px 0 34px rgba(0,0,0,0.32);
    background: #ffe066;
  }

  .side-menu.open {
    transform: translateX(0);
  }

  /* semi-transparenter backdrop wenn Menü offen */
  .side-menu-backdrop {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.32);
    z-index: 10001;
    display: none;
  }
  .side-menu.open + .side-menu-backdrop {
    display: block;
  }

  /* Menülinks größer und leichter zu treffen */
  .side-menu a {
    padding: 18px 22px;
    font-size: 1.05em;
  }
}

/* Hofstaat-Responsive */
@media (max-width: 600px) {
  .hofstaat-card {
    padding: 12px 10px;
    font-size: 0.98em;
    gap: 10px;
  }
  .hofstaat-avatar {
    width: 38px;
    height: 38px;
    font-size: 1em;
  }
}

/* Mobile: Hofstaat-Bilder untereinander anordnen */
@media (max-width: 600px) {
  .hofstaat-bilder-row {
    flex-direction: column;
    gap: 18px;
    margin: 18px 0 24px 0;
    align-items: stretch; /* sorgt dafür, dass Kinder volle Breite einnehmen */
  }

  .hofstaat-bild-wrapper {
    width: 100%;
    display: block;
    margin: 0 auto;
  }

  .hofstaat-bild {
    width: 100%;
    height: auto; /* proportional skalieren */
    max-width: 420px; /* verhindert zu breite Bilder auf mittelgroßen Phones */
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 18px #23398e16;
    border-radius: 12px;
  }

  /* Die Hover-Detail-Box innerhalb der Wrapper anpassen, damit sie nicht außerhalb des Viewports liegt */
  .bild-detail {
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: auto;
    max-width: calc(100% - 40px);
  }
}

.hofstaat-bilder-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 36px 0 48px 0; /* Abstand nach unten erhöht */
}

.hofstaat-bild {
  width: 250px;
  height: 250px;
  object-fit: cover;
  box-shadow: 0 4px 18px #23398e16;
  background: #e8edfd;
}

/* Ergänze in styles.css */
.bild-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  top: 0;
  background: rgba(30,57,143,0.25);
  display: none;
  z-index: 9999;
  transition: background 0.3s;
}
.bild-sheet.open {
  display: block;
}
.bild-sheet-content {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  background: #ffe066;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 40px #1e398f44;
  padding: 32px 28px 24px 28px;
  max-width: 340px;
  width: 90vw;
  text-align: center;
  animation: sheetSlideUp 0.35s cubic-bezier(.4,1.3,.5,1);
}
@keyframes sheetSlideUp {
  from { transform: translateX(-50%) translateY(100px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.sheet-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 2px 16px #23398e22;
  margin-bottom: 18px;
}
.bild-sheet-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none;
  border: none;
  font-size: 2em;
  color: #1e398f;
  cursor: pointer;
}
#sheetName {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1.25em;
  font-weight: 700;
  color: #1e398f;
  margin-bottom: 8px;
}
#sheetInfo {
  font-family: 'Quicksand', Arial, sans-serif;
  font-size: 1.05em;
  color: #1e398f;
}

.hofstaat-bild-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.bild-detail {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #ffe066;
  color: #1e398f;
  font-family: 'Quicksand', Arial, sans-serif;
  font-size: 1.07em;
  border-radius: 14px;
  box-shadow: 0 4px 18px #23398e22;
  padding: 18px 22px;
  text-align: center;
  min-width: 180px;
  max-width: 220px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s cubic-bezier(.4,1.3,.5,1), transform 0.7s cubic-bezier(.4,1.3,.5,1);
  z-index: 10;
}

.hofstaat-bild-wrapper:hover .bild-detail,
.hofstaat-bild-wrapper:focus-within .bild-detail {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(12px) scale(1.04);
}

/* Ergänze oder ersetze in styles.css */
.bild-popup {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: transparent;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  pointer-events: none;
}

.bild-popup.open {
  display: flex;
  pointer-events: auto;
}

.bild-popup-content {
  width: 800px !important;        /* feste Standardbreite */
  max-width: 2000px;     /* nicht breiter als Viewport */
  min-width: 320px;    /* Minimum */
  max-height: 85vh;    /* höhe begrenzen */
  box-sizing: border-box;
  position: absolute;
  background: #ffe066;
  border-radius: 18px;
  box-shadow: 0 8px 40px #1e398f44;
  padding: 40px 40px 32px 40px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.5s cubic-bezier(0.4,0,0.2,1),
    transform 0.5s cubic-bezier(0.4,0,0.2,1),
    top 0.5s cubic-bezier(0.4,0,0.2,1),
    left 0.5s cubic-bezier(0.4,0,0.2,1),
    width 0.5s cubic-bezier(0.4,0,0.2,1),
    height 0.5s cubic-bezier(0.4,0,0.2,1);
  z-index: 1000;
}

.bild-popup.open .bild-popup-content {
  opacity: 1;
  pointer-events: auto;
}

.popup-img-rahmen-wrapper {
  position: relative;
  width: 1200px;
  height: auto;
  min-width: 320px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 2px 16px #23398e22;
  margin-bottom: 18px;
}

.bild-popup-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none;
  border: none;
  font-size: 2em;
  color: #1e398f;
  cursor: pointer;
}

#popupName {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1.25em;
  font-weight: 700;
  color: #1e398f;
  margin-bottom: 8px;
}

#popupInfo {
  font-family: 'Quicksand', Arial, sans-serif;
  font-size: 1.05em;
  color: #1e398f;
}

.popup-rahmen {
  width: 80px;
  height: 8px;
  margin: 16px auto 0 auto;
  background: linear-gradient(90deg, #1e398f 0%, #ffe066 100%);
  border-radius: 4px;
}

.popup-img-gross {
  width: 260px;
  height: 260px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 4px 32px #23398e22;
  margin-bottom: 18px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.popup-rahmen-gross {
  width: 120px;
  height: 14px;
  margin: 0 auto 22px auto;
  background: linear-gradient(90deg, #1e398f 0%, #ffe066 100%);
  border-radius: 7px;
}

.popup-textbereich {
  text-align: center;
  margin-top: 0;
}

.popup-textbereich h3 {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1.45em;
  font-weight: 700;
  color: #1e398f;
  margin-bottom: 10px;
}

.popup-textbereich p {
  font-family: 'Quicksand', Arial, sans-serif;
  font-size: 1.12em;
  color: #1e398f;
  margin: 0;
}

.popup-img-rahmen-wrapper {
  position: relative;
  margin: 0 auto 18px auto;
  width: 340px;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-img-rahmen {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
}

.popup-symbol-img {
  display: none;
  position: absolute;
  top: -30px;
  left: -80px;
  width: 120px;
  height: 120px;
  background: #fff;
}

/* Überschreiben: keine abgerundeten Ecken für das Symbol */
.popup-symbol-img {
  border-radius: 0 !important;
  overflow: visible; /* falls Parent das Bild sonst zuschneidet */
}

.popup-rahmen-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  min-height: 80px;
  font-family: 'Montserrat', Arial, sans-serif;
  color: #1e398f;
  font-size: 1em;
  font-weight: 500;
  text-align: left;
  word-break: break-word;
  overflow-wrap: break-word;
  z-index: 2;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Profilfoto rechts, originalgröße, kein runder Rahmen */
.funktion-img {
  position: absolute;
  right: -200px;    /* weiter nach rechts außerhalb des Rahmens */
  bottom: -30px;
  width: 250px;    /* größer */
  height: auto;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
  border: none;
  z-index: 4;
  background: transparent;
}
/* --- Bildergalerie --- */
.gallery-container {
  padding: 20px 0;
}

.gallery-container h2 {
  color: #1e398f;
  margin-top: 40px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #1e398f33;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.gallery-grid img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(30, 57, 143, 0.1);
}

.gallery-grid img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(30, 57, 143, 0.2);
}

/* Plyr video wrapper - responsive */
.video-wrapper {
  width: 150%;
  max-width: 720px; /* limit width so player doesn't break */
  margin: 0 auto; /* center */
  grid-column: auto; /* default: don't force spanning */
}

/* Helper for explicitly small players */
.video-wrapper.small {
  max-width: 420px;
}

.js-player {
  width: 100% !important;
  aspect-ratio: 16 / 9;
  height: auto !important;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(30,57,143,0.12);
  background: #000;
}

/* Ensure plyr fullscreen overlay sits above fixed footer and other elements */
.plyr--fullscreen {
  z-index: 20000 !important;
}

/* For browsers where plyr uses a separate container element */
.plyr__video-embed, .plyr__video-wrapper {
  z-index: inherit;
}

/* Custom fullscreen overlay fallback (used when native FS blocked) */
.plyr-custom-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 25000 !important;
  background: #000;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.plyr-custom-fullscreen .js-player {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  border-radius: 0 !important;
}

@media (max-width: 640px) {
  /* on small screens make player full width but keep aspect ratio */
  .video-wrapper {
    max-width: none;
    grid-column: 1 / -1;
    padding: 0 8px;
  }
  .video-wrapper.small {
    max-width: none;
  }
}

/* --- Lightbox für Vollbildansicht --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: none; /* Wird per JS auf 'flex' gesetzt */
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.lightbox.open {
  display: flex;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(30, 57, 143, 0.5);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 2rem;
  font-weight: bold;
  transition: background 0.2s ease;
  z-index: 1001;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(30, 57, 143, 0.8);
}

.lightbox-close {
  top: 15px;
  right: 25px;
  padding: 0 15px;
  border-radius: 8px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  padding: 15px 10px;
}

.lightbox-prev {
  left: 15px;
  border-radius: 8px 0 0 8px;
}

.lightbox-next {
  right: 15px;
  border-radius: 0 8px 8px 0;
}

