@charset "utf-8";
/* CSS Document */

/* ============================================================
   Bildergalerie
   ============================================================ */

/* --- Galerie: 3 Spalten --- */

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    margin: 20px 0;
}


/* --- Einzelnes Galerie-Element --- */

.gallery-item {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    line-height: 0;

    /* Wichtig: überschreibt das allgemeine button-CSS
       deiner Website */
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-item:focus-visible {
    outline: 2px solid #7094B4;
    outline-offset: 3px;
}


/* --- Thumbnail --- */

.gallery-item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
    
    /* Browser-Rendering-Fixes gegen Pixelbildung */
    overflow-clip-margin: unset;
    image-rendering: smooth;
    transform: translateZ(0); /* Aktiviert Grafikbeschleunigung für saubere Kanten */
}


/* ============================================================
   Lightbox / vergrößerte Darstellung
   ============================================================ */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 40px;

    background-color: rgba(0, 0, 0, 0.88);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}


/* Lightbox geöffnet */

.gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}


/* --- Bildbereich --- */

.gallery-lightbox-content {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    max-width: 1400px;
    max-height: 100%;
}


/* --- Großes Bild --- */

.gallery-lightbox-image {
    display: block;

    max-width: calc(100% - 120px);
    max-height: calc(100vh - 80px);

    width: auto;
    height: auto;

    object-fit: contain;

    border-radius: 3px;

    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}


/* ============================================================
   Schließen-Button
   ============================================================ */

.gallery-lightbox-close {
    position: fixed;
    top: 20px;
    right: 25px;

    z-index: 10001;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    padding: 0;

    border: none;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.15);
    color: white;

    font-family: Arial, sans-serif;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.gallery-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.gallery-lightbox-close:focus-visible {
    outline: 2px solid white;
    outline-offset: 3px;
}


/* ============================================================
   Pfeile
   ============================================================ */

.gallery-lightbox-prev,
.gallery-lightbox-next {
    position: fixed;
    top: 50%;

    z-index: 10001;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 50px;
    height: 70px;

    padding: 0;

    border: none;
    border-radius: 4px;

    background: rgba(255, 255, 255, 0.12);
    color: white;

    font-family: Arial, sans-serif;
    font-size: 42px;
    font-weight: 300;
    line-height: 1;

    cursor: pointer;

    transform: translateY(-50%);

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.gallery-lightbox-prev {
    left: 20px;
}

.gallery-lightbox-next {
    right: 20px;
}

.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
}

.gallery-lightbox-prev:focus-visible,
.gallery-lightbox-next:focus-visible {
    outline: 2px solid white;
    outline-offset: 3px;
}


/* ============================================================
   Bildnummer
   ============================================================ */

.gallery-lightbox-counter {
    position: fixed;
    left: 50%;
    bottom: 18px;

    z-index: 10001;

    transform: translateX(-50%);

    color: white;

    font-family: 'Montserrat', sans-serif;
    font-size: 13px;

    background: rgba(0, 0, 0, 0.35);

    padding: 5px 10px;
    border-radius: 4px;
}


/* ============================================================
   Beschreibung / Alt-Text
   ============================================================ */

.gallery-lightbox-caption {
    position: fixed;
    left: 50%;
    bottom: 50px;

    z-index: 10001;

    max-width: 80%;

    transform: translateX(-50%);

    color: white;

    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    text-align: center;

    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}


/* ============================================================
   Verhindert Scrollen der Seite bei geöffneter Lightbox
   ============================================================ */

body.gallery-lightbox-open {
    overflow: hidden;
}


/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {

    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .gallery-lightbox {
        padding: 20px;
    }

    .gallery-lightbox-image {
        max-width: calc(100% - 70px);
        max-height: calc(100vh - 50px);
    }

    .gallery-lightbox-prev,
    .gallery-lightbox-next {
        width: 38px;
        height: 55px;

        font-size: 32px;
    }

    .gallery-lightbox-prev {
        left: 8px;
    }

    .gallery-lightbox-next {
        right: 8px;
    }

    .gallery-lightbox-close {
        top: 10px;
        right: 12px;

        width: 40px;
        height: 40px;

        font-size: 28px;
    }

    .gallery-lightbox-caption {
        bottom: 40px;
        max-width: 75%;
        font-size: 12px;
    }
}


@media (max-width: 450px) {

    .gallery {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .gallery-item img {
        aspect-ratio: 4 / 3;
    }

    .gallery-lightbox {
        padding: 10px;
    }

    .gallery-lightbox-image {
        max-width: calc(100% - 60px);
        max-height: calc(100vh - 40px);
    }

    .gallery-lightbox-prev,
    .gallery-lightbox-next {
        width: 32px;
        height: 48px;

        font-size: 28px;
    }

    .gallery-lightbox-prev {
        left: 4px;
    }

    .gallery-lightbox-next {
        right: 4px;
    }
}


/* ============================================================
   Wenn nur ein Bild vorhanden ist:
   Pfeile werden per JavaScript ausgeblendet.
   ============================================================ */

.gallery-lightbox.single-image .gallery-lightbox-prev,
.gallery-lightbox.single-image .gallery-lightbox-next {
    display: none;
}


/* ============================================================
   Bewegungsreduktion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    .gallery-item,
    .gallery-lightbox,
    .gallery-lightbox-close,
    .gallery-lightbox-prev,
    .gallery-lightbox-next {
        transition: none;
    }
}