
.gallery-header{
    text-align: center;
    padding: 4rem 1rem 3rem;
    max-width: 800px;
    margin: 0 auto;
}

.back{
    display: inline-block;
    margin-bottom: 1.5rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: 250ms;
}

.back:hover{
    color: var(--primary);
}

.header-meta h1{
    font-size: var(--font-xxl);
    color: var(--on-primary);
    margin: .5rem 0;
}

.header-meta time{
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.photo-grid{
    column-count: 3;
    column-gap: 1.5rem;
    padding: 0 2rem 4rem;
    max-width: var(--max-size);
    width: 100%;
    margin: 0 auto;
}

.photo-item{
    margin: 0 0 1.5rem 0;
    border-radius: 6px;
    overflow: hidden;
    cursor: zoom-in;
    background: var(--surface);

    break-inside: avoid;

    /* --- ANIMATION START-ZUSTAND --- */
    opacity: 0;
    transform: translateY(40px);
    will-change: opacity, transform;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.photo-item__img {
    display: block;
    width: 100%;
    height: auto;
    transition: filter 0.3s ease;
}

.photo-item:hover .photo-item__img {
    filter: brightness(0.9); /* Subtiles Feedback */
}

@media (max-width: 1024px) {
    .photo-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .photo-grid {
        column-count: 1;
        padding: 0 1rem 2rem;
    }
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none; /* Klicks gehen durch wenn unsichtbar */
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox__content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox__content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.lightbox__counter {
    position: absolute;
    bottom: -30px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-family: monospace;
}

/* Navigation Buttons */
.lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    z-index: 1001;
}

.lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox__nav--prev {
    left: 20px;
}

.lightbox__nav--next {
    right: 20px;
}

/* Mobile Optimierung für Lightbox */
@media (max-width: 768px) {
    .lightbox__nav {
        display: none; /* Auf Handy wird gewischt (Swipe logic needed or simple Tap) */
    }

    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0 0.5rem 2rem;
    }
}