/* Galerie Container */
.galerie_container {
    width: 90%;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1rem;
    box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.2);
}

.galerie_container h1 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.galerie_intro {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    color: var(--dunkelgrau);
}

.galerie_fehler {
    text-align: center;
    padding: 2rem;
    background: rgba(178, 0, 33, 0.1);
    border: 2px solid var(--rot);
    border-radius: 0.5rem;
    color: var(--rot);
    font-weight: bold;
}

/* Galerie Grid Layout */
.galerie_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

/* Galerie Item */
.galerie_item {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    background: var(--hellgrau);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.galerie_item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

.galerie_item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease, filter 0.5s ease;
    filter: grayscale(0.3);
}

.galerie_item:hover img {
    transform: scale(1.1);
    filter: grayscale(0);
}

/* Galerie Overlay */
.galerie_overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.galerie_item:hover .galerie_overlay {
    transform: translateY(0);
}

.galerie_titel {
    font-size: 1rem;
    font-weight: bold;
    text-transform: capitalize;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox_bild {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border: 4px solid var(--rot);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox_caption {
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 1.2rem;
    text-transform: capitalize;
    max-width: 80%;
}

/* Lightbox Schließen Button */
.lightbox_schliessen {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10000;
}

.lightbox_schliessen:hover {
    color: var(--rot);
}

/* Lightbox Navigation */
.lightbox_prev,
.lightbox_next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    padding: 1rem;
    user-select: none;
    transition: color 0.3s ease, background-color 0.3s ease;
    border-radius: 0.5rem;
}

.lightbox_prev:hover,
.lightbox_next:hover {
    color: var(--rot);
    background-color: rgba(255, 255, 255, 0.1);
}

.lightbox_prev {
    left: 20px;
}

.lightbox_next {
    right: 20px;
}

/* Responsive Design für Tablets */
@media (max-width: 1024px) {
    .galerie_grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .galerie_container {
        width: 95%;
        padding: 1.5rem;
    }
}

/* Responsive Design für Mobile */
@media (max-width: 768px) {
    .galerie_container {
        width: 95%;
        padding: 1rem;
        margin: 1rem auto;
    }

    .galerie_container h1 {
        font-size: 1.8rem;
    }

    .galerie_intro {
        font-size: 1rem;
    }

    .galerie_grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .lightbox_bild {
        max-width: 95%;
        max-height: 70vh;
        border: 2px solid var(--rot);
    }

    .lightbox_schliessen {
        top: 10px;
        right: 20px;
        font-size: 2rem;
    }

    .lightbox_prev,
    .lightbox_next {
        font-size: 2rem;
        padding: 0.5rem;
    }

    .lightbox_prev {
        left: 10px;
    }

    .lightbox_next {
        right: 10px;
    }

    .lightbox_caption {
        font-size: 1rem;
        padding: 0.5rem;
    }
}

/* Sehr kleine Bildschirme */
@media (max-width: 480px) {
    .galerie_grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }

    .galerie_container h1 {
        font-size: 1.5rem;
    }
}
