/* =====================================================================
   Galerie - Bilderraster und Grossansicht
   ===================================================================== */

.inhalt--weit {
    max-width: var(--breite-weit);
}

.galeriehinweis {
    margin-bottom: var(--raum-l);
    text-align: center;
    font-size: 0.92rem;
    color: var(--farbe-tinte-leise);
}

.galeriegruppe {
    margin-bottom: var(--raum-xl);
}

.galeriegruppe__titel {
    display: flex;
    align-items: center;
    gap: var(--raum-s);
    margin-bottom: var(--raum-m);
    font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.8rem);
}

/* Feine Linie, die den Rest der Zeile ausfuellt */
.galeriegruppe__titel::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--farbe-linie);
}

.galerie {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    grid-auto-rows: 11rem;
    gap: var(--raum-xs);
}

.galerie__eintrag {
    margin: 0;
    border-radius: var(--radius-klein);
    overflow: hidden;
    background: var(--farbe-warm);
}

.galerie__eintrag img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.4s ease;
}

.galerie__eintrag:hover img {
    transform: scale(1.05);
}

/* Jedes vierte Bild bekommt doppelte Hoehe, jedes siebte doppelte
   Breite. Das bricht das gleichfoermige Raster auf, ohne dass zu jedem
   Bild eine Angabe gepflegt werden muesste. */
.galerie__eintrag:nth-child(4n + 1) {
    grid-row: span 2;
}

.galerie__eintrag:nth-child(7n + 3) {
    grid-column: span 2;
}

/* --- Grossansicht --------------------------------------------------------- */

.lichtbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--raum-m);
    background: rgba(16, 18, 14, 0.94);
}

.lichtbox[hidden] {
    display: none;
}

.lichtbox__bild {
    max-width: 100%;
    max-height: 88vh;
    object-fit: contain;
    border-radius: var(--radius-klein);
    box-shadow: var(--schatten-tief);
}

.lichtbox__schliessen {
    position: absolute;
    top: var(--raum-s);
    right: var(--raum-s);
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.14);
    color: #fff;
    border: 0;
    border-radius: 50%;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

.lichtbox__schliessen:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* --- Mobil ----------------------------------------------------------------- */

@media (max-width: 52rem) {
    .galerie {
        grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
        grid-auto-rows: 8rem;
        gap: var(--raum-2xs);
    }
}
