/* =====================================================
   1. FARBEN UND GRUNDEINSTELLUNGEN
   Ändere hier die Farben der gesamten Galerie.
   ===================================================== */
:root {
  --hauptfarbe: #174b91;
  --zweite-farbe: #ffd500;
  --hintergrund: #ffffff;
  --kartenfarbe: #ffffff;
  --schriftfarbe: #1d2935;
  --helle-schrift: #ffffff;
  --maximale-breite: 1180px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--schriftfarbe);
  background-color: var(--hintergrund);
  line-height: 1.5;
}

.inhalt {
  width: min(92%, var(--maximale-breite));
  margin: 0 auto;
}

/* =====================================================
   2. KOPFBEREICH
   ===================================================== */
.kopfbereich {
  padding: 22px 0 12px;
  color: #151515;
  text-align: center;
  background: #ffffff;
  border: 0;
}

h1 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 2rem);
  line-height: 1.25;
}

.vereinslogo {
  display: block;
  width: min(250px, 65vw);
  max-height: 145px;
  margin: 14px auto 0;
  object-fit: contain;
}

h2 {
  margin: 22px 0 12px;
  color: #151515;
  text-align: center;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
}

/* =====================================================
   3. GALERIE
   Die Anzahl der Spalten passt sich automatisch an.
   ===================================================== */
.galerie {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px 18px;
  padding: 18px 0 28px;
}

.galerie-bild {
  position: relative;
  margin: 0;
  overflow: hidden;
  min-height: 0;
  background-color: var(--kartenfarbe);
  border: 1px solid #d6d6d6;
  border-radius: 0;
  box-shadow: none;
  cursor: zoom-in;
}

/* =====================================================
   4. SEITENNAVIGATION – je 16 Bilder pro Seite
   ===================================================== */
.seitennavigation {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0 0 40px;
}

.seitenknopf {
  min-width: 42px;
  padding: 10px 13px;
  border: 2px solid var(--hauptfarbe);
  border-radius: 3px;
  color: var(--hauptfarbe);
  background: #ffffff;
  font-weight: bold;
  cursor: pointer;
}

.seitenknopf:hover,
.seitenknopf.aktiv {
  color: #10283d;
  background: var(--zweite-farbe);
  border-color: var(--zweite-farbe);
}

.galerie-bild img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.35s ease;
}

/* Das Bild wird beim Berühren mit der Maus leicht vergrößert. */
.galerie-bild:hover img {
  transform: scale(1.06);
}

.galerie-bild figcaption {
  position: static;
  padding: 7px 5px 8px;
  color: #222222;
  text-align: center;
  background: #ffffff;
}

.galerie-bild strong,
.galerie-bild span {
  display: block;
}

.galerie-bild strong {
  font-size: 1rem;
}

.galerie-bild span {
  margin-top: 3px;
  font-size: 0.93rem;
}

/* =====================================================
   5. GROSSE BILDVORSCHAU
   ===================================================== */
.bildvorschau {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 70px 75px 45px;
  color: #ffffff;
  background-color: rgba(3, 12, 22, 0.94);
}

/* hidden muss die Vorschau wirklich ausblenden. */
.bildvorschau[hidden] {
  display: none;
}

.vorschau-inhalt {
  margin: 0;
  max-width: min(1100px, 90vw);
  text-align: center;
}

.vorschau-inhalt img {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

#vorschau-text {
  margin-top: 15px;
  font-size: 1.1rem;
}

.bildnummer {
  margin: 6px 0 0;
  color: #d7e1ea;
}

.vorschau-schliessen,
.vorschau-pfeil {
  position: absolute;
  border: 0;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
  cursor: pointer;
}

.vorschau-schliessen:hover,
.vorschau-pfeil:hover {
  background: var(--hauptfarbe);
}

.vorschau-schliessen {
  top: 18px;
  right: 22px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
}

.vorschau-pfeil {
  top: 50%;
  width: 52px;
  height: 70px;
  border-radius: 8px;
  font-size: 2rem;
  transform: translateY(-50%);
}

.vorschau-zurueck {
  left: 16px;
}

.vorschau-weiter {
  right: 16px;
}

/* =====================================================
   6. FUSSBEREICH
   ===================================================== */
footer {
  padding: 20px 0 32px;
  color: #151515;
  text-align: center;
  background-color: #ffffff;
}

footer p {
  margin: 0;
}

footer a {
  color: #174b91;
}

/* Kleinere Abstände auf Handys */
@media (max-width: 600px) {
  .kopfbereich {
    padding: 18px 0 10px;
  }

  .galerie {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
    padding: 16px 0 24px;
  }

  .bildvorschau {
    padding: 70px 12px 90px;
  }

  .vorschau-inhalt img {
    max-height: 65vh;
  }

  .vorschau-pfeil {
    top: auto;
    bottom: 14px;
    width: 58px;
    height: 50px;
    transform: none;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .galerie {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
