 /* RESET & BODY */
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    
    /***********************************************
     * FILTER MENU (header)
     ***********************************************/
    header {
      padding: 20px;
      text-align: center;
      border-bottom: 1px solid #ccc;
      margin-bottom: 20px;
    }
    .filter-menu {
      list-style: none;
      display: inline-flex;
      gap: 1.5rem;
    }
    .filter-button {
      cursor: pointer;
      position: relative;
      font-weight: bold;
      text-transform: uppercase;
      font-size: 0.9rem;
      color: #555;
      transition: color 0.3s ease;
    }
    .filter-button:hover {
      color: #000;
    }
    .filter-button.active {
      color: var(--secondary-dark);
    }
    .filter-button.active::after {
      content: "";
      position: absolute;
      left: 0;
      bottom: -4px;
      width: 100%;
      height: 2px;
      background: var(--secondary-dark);
    }
    
    /***********************************************
     * GALLERY: MOSAIC LAYOUT (Variante 1)
     ***********************************************/
    .gallery {
      padding: 20px;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
      gap: 5px;
      grid-auto-rows: 150px;
      grid-auto-flow: dense;
      max-width: 1400px;
      margin: 0 auto;
      opacity: 1; /* für Fade-Effekte */
      transition: opacity 0.4s ease;
    }
    .gallery-item {
      position: relative;
      overflow: hidden;
      cursor: pointer;
    }
    .gallery-item img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      transition: transform 0.3s ease;
    }
    .gallery-item:hover img {
      transform: scale(1.05);
    }
    /* Größen-Klassen für spezielle Bildvarianten */
    .tall {
      grid-row: span 2;
    }
    .wide {
      grid-column: span 2;
    }
    .big {
      grid-column: span 2;
      grid-row: span 2;
    }
    .huge {
      grid-column: span 3;
      grid-row: span 3;
    }
    
    /***********************************************
     * RESPONSIVE BREAKPOINTS
     ***********************************************/
    @media (max-width: 600px) {
      .gallery {
        grid-template-columns: 1fr;
        grid-auto-rows: 200px;
      }
      .gallery-item {
        grid-column: auto !important;
        grid-row: auto !important;
      }
    }
    
    /***********************************************
     * LIGHTBOX STYLES
     ***********************************************/
     .lightbox {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.9);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 1000;
    }
    .lightbox.active {
      display: flex;
    }
    .lightbox-content {
      max-width: 90%;
      max-height: 90%;
    }
    .close {
      position: absolute;
      top: 20px;
      right: 30px;
      font-size: 40px;
      color: #fff;
      cursor: pointer;
      user-select: none;
    }
    .prev, .next {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      font-size: 60px;
      color: #fff;
      cursor: pointer;
      user-select: none;
      padding: 10px;
    }
    .prev {
      left: 20px;
    }
    .next {
      right: 20px;
    }
    
    /***********************************************
     * LOAD MORE BUTTON
     ***********************************************/
    #loadMoreBtn {
      display: block;
      margin: 30px auto;
      padding: 10px 20px;
      font-size: 1rem;
      cursor: pointer;
      border: 1px solid var(--secondary-color);
      background-color: #fff;
      color: var(--secondary-color);
      transition: background-color 0.3s, color 0.3s;
    }
    #loadMoreBtn:hover {
      background-color: var(--secondary-color);
      color: #fff;
    }
    /* Button verstecken (z.B. bei zu wenigen Bildern) */
    .hidden {
      display: none !important;
    }

    /***********************************************
     * FADE-IN ANIMATION FÜR NEUE BILDER
     ***********************************************/
    .fade-in {
      animation: fadeIn 0.6s forwards ease;
    }

    @keyframes fadeIn {
      0% {
        opacity: 0;
      }
      100% {
        opacity: 1;
      }
    }

    /* Mobile-first Grid: kompakt & konsistent */
.gallery {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 Spalten auf sehr kleinen Phones */
  gap: 6px;
  grid-auto-rows: 120px; /* kompakte Kartenhöhe */
  max-width: 1400px;
  margin: 0 auto;
  transition: opacity 0.4s ease;
}

/* Auf kleinen Screens: alle Kacheln gleich groß (Span-Klassen neutralisieren) */
@media (max-width: 480px) {
  .gallery-item { grid-column: auto !important; grid-row: auto !important; }
}

/* >= 480px: etwas größer */
@media (min-width: 480px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 150px;
  }
}

/* >= 640px: 3 Spalten, Spans greifen wieder */
@media (min-width: 640px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 160px;
  }
}

/* >= 900px: 4 Spalten */
@media (min-width: 900px) {
  .gallery {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 180px;
  }
}

/* >= 1200px: 5 Spalten */
@media (min-width: 1200px) {
  .gallery {
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 200px;
  }
}


/* Mobile-first Grid: kompakt & konsistent */
.gallery {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 Spalten auf sehr kleinen Phones */
  gap: 6px;
  grid-auto-rows: 120px; /* kompakte Kartenhöhe */
  max-width: 1400px;
  margin: 0 auto;
  transition: opacity 0.4s ease;
}

/* Auf kleinen Screens: alle Kacheln gleich groß (Span-Klassen neutralisieren) */
@media (max-width: 480px) {
  .gallery-item { grid-column: auto !important; grid-row: auto !important; }
}

/* >= 480px: etwas größer */
@media (min-width: 480px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 150px;
  }
}

/* >= 640px: 3 Spalten, Spans greifen wieder */
@media (min-width: 640px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 160px;
  }
}

/* >= 900px: 4 Spalten */
@media (min-width: 900px) {
  .gallery {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 180px;
  }
}

/* >= 1200px: 5 Spalten */
@media (min-width: 1200px) {
  .gallery {
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 200px;
  }
}

/* === Galerie: Handy 1 Spalte, ab 480px 2 Spalten === */

/* Basis: mobile-first – 1 Spalte auf Phones */
.gallery {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr;            /* 1 Bild pro Reihe */
  gap: 8px;
  grid-auto-rows: 220px;                 /* Kartenhöhe auf Phone */
  max-width: 1400px;
  margin: 0 auto;
}

/* Spans bis einschließlich 767px neutralisieren (gleichmäßiges Raster) */
@media (max-width: 767px) {
  .gallery-item { grid-column: auto !important; grid-row: auto !important; }
}

/* ≥ 480px: 2 Spalten (kleine Tablets/Phablets) */
@media (min-width: 480px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);  /* 2 Bilder pro Reihe */
    grid-auto-rows: 180px;
  }
}

/* ≥ 768px: 3 Spalten, Mosaik darf wirken */
@media (min-width: 768px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 180px;
  }
}

/* ≥ 1024px: 4 Spalten */
@media (min-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 190px;
  }
}

/* ≥ 1280px: 5 Spalten */
@media (min-width: 1280px) {
  .gallery {
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 200px;
  }
}

/* (Optional) Bilddarstellung sicher & performant */
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* füllt die Karte sauber */
  display: block;
}


/* === MOBILE FILTER-CHIPS (≤ 767px) – Desktop/iPad bleiben wie jetzt === */
@media (max-width: 767px) {
  /* UL selbst wird zur horizontal scrollbaren Chip-Leiste */
  .filter-menu {
    /* Layout */
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 12px 10px;
    margin: 0;
    list-style: none;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;

    /* Sticky unter dem Site-Header (passe bei Bedarf an) */
    position: sticky;
    top: var(--filter-stick-top, 64px);
    z-index: 5;
    background: #fff;
    border-bottom: 1px solid #eee;

    /* Für die Fade-Hinweise */
    position: sticky;
  }

  /* iOS/Android: Scrollbar ausblenden, aber zugänglich lassen */
  .filter-menu::-webkit-scrollbar { display: none; }

  /* Sanfte Fades links/rechts als Scroll-Hinweis */
  .filter-menu {
    position: sticky; /* bereits gesetzt, doppelt ist ok */
  }
  .filter-menu::before,
  .filter-menu::after {
    content: "";
    position: absolute;
    top: 0;
    height: 100%;
    width: 24px;
    pointer-events: none;
    z-index: 6;
  }
  .filter-menu::before {
    left: 0;
    background: linear-gradient(90deg, #fff, rgba(255,255,255,0));
  }
  .filter-menu::after {
    right: 0;
    background: linear-gradient(270deg, #fff, rgba(255,255,255,0));
  }

  /* Chips (deine <li class="filter-button">) */
  .filter-button {
    flex: 0 0 auto;
    scroll-snap-align: start;

    /* Touch-Ziele groß genug */
    padding: 10px 14px;
    min-height: 44px;

    /* Optik im Stil deiner Seite */
    border: 1px solid #ccc;
    border-radius: 999px;
    background: #fff;

    /* Typografie: nicht schreien auf Mobile */
    text-transform: none;         /* Desktop bleibt uppercase */
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;

    /* Fokus sichtbar (A11y) */
    outline: none;
  }
  .filter-button:focus-visible {
    outline: 2px solid #008000;
    outline-offset: 2px;
    border-radius: 999px;
  }

  /* Aktiver Chip – nutzt dein Grün (#008000) */
  .filter-button.active {
    color: #fff;
    background: var(--secondary-color);
    border-color: var(--secondary-dark);
  }
  /* Die Desktop-Unterstreichung ausblenden, damit es wie ein Chip aussieht */
  .filter-button.active::after { display: none; }

  /* Abstand zum Content etwas kleiner als Desktop */
  header .filter-menu { margin-bottom: 6px; }
}

/* === FIX 1: Mobile-Buttons vertikal & horizontal zentrieren === */
@media (max-width: 767px) {
  .filter-button {
    /* aus dem Inline-Text-Flow raus -> eigene Box */
    display: inline-flex;
    align-items: center;       /* vertikal zentrieren */
    justify-content: center;   /* horizontal zentrieren */

    /* stabile Textbox */
    min-height: 44px;          /* gutes Touch-Ziel */
    line-height: 1;            /* verhindert Baseline-Shift */
    padding: 10px 14px;        /* symmetrisch = optisch mittig */

    /* (Rest: deine bestehenden Styles bleiben) */
    border-radius: 999px;
    border: 1px solid #ccc;
    background: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    text-transform: none;      /* Desktop bleibt uppercase */
  }
}

/* === FIX 2: Fades ohne Overlays – kein weißer Strich === */
@media (max-width: 767px) {
  /* alte Overlays sicher deaktivieren, falls noch vorhanden */
  .filter-menu::before,
  .filter-menu::after { display: none !important; content: none !important; }

  /* Platz für die Fade-Zonen */
  :root { --filter-fade: 24px; }

  .filter-menu {
    /* alles wie bisher … */
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 12px 10px;
    margin: 0;
    list-style: none;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: var(--filter-stick-top, 64px);
    z-index: 5;
    background: #fff;          /* wichtig: solider Hintergrund */
    border-bottom: 1px solid #eee;

    /* NEU: Fades als Maske – nichts liegt über den Chips */
    -webkit-mask-image: linear-gradient(to right,
      transparent 0,
      #000 var(--filter-fade),
      #000 calc(100% - var(--filter-fade)),
      transparent 100%);
            mask-image: linear-gradient(to right,
      transparent 0,
      #000 var(--filter-fade),
      #000 calc(100% - var(--filter-fade)),
      transparent 100%);
  }

  /* Scrollbar ausblenden (mobil) */
  .filter-menu::-webkit-scrollbar { display: none; }
}

/* Optional: Fallback, falls ein Browser mask-image nicht kann → keine Fades, aber auch kein Strich */
@supports not ((mask-image: linear-gradient(white, black)) or (-webkit-mask-image: linear-gradient(white, black))) {
  @media (max-width: 767px) {
    .filter-menu { -webkit-mask-image: none; mask-image: none; }
  }
}
