* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    font-family: system-ui, sans-serif; 
    background: #121212; 
    color: #fff; 
    padding: 20px; 
}

h1 { 
    text-align: center; 
    margin-bottom: 20px; 
}

/* Debug-Ausgaben */
.debug-box {
    background: #fee2e2;
    border: 1px solid #f87171;
    color: #991b1b;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: monospace;
    font-size: 0.9rem;
}

.debug-box ul { 
    margin-left: 20px; 
    list-style-type: disc; 
}

/* Raster-Layout (Galerie) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3; /* Auf 16:9 vereinheitlicht (für Videos/Bilder) */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.gallery-item_vid {
    position: relative;
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16 / 9; /* Auf 16:9 vereinheitlicht (für Videos/Bilder) */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.gallery-item:hover { 
    transform: scale(1.03); 
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

/* Overlay-Play-Button */
.play-icon {
    position: absolute;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.play-icon::after {
    content: "";
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 14px;
    border-color: transparent transparent transparent #ffffff;
    margin-left: 3px;
}

.gallery-item:hover .play-icon {
    background: rgba(220, 38, 38, 0.9);
    transform: scale(1.1);
}

/* Lightbox (Großansicht) */
.lightbox {
    display: none;
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox.active { 
    display: flex; 
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
    -webkit-user-drag: none;
    transition: opacity 0.2s ease-in-out;
}

.lightbox-video-container {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-video-container video {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 6px;
    outline: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Navigation Buttons */
.nav-btn, .close-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    font-size: 2rem;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.2s;
    z-index: 1010;
}

.nav-btn:hover, .close-btn:hover { 
    background: rgba(255, 255, 255, 0.5); 
}

.prev-btn { left: 20px; }
.next-btn { right: 20px; }
.close-btn { 
    top: 20px; 
    right: 20px; 
    font-size: 1.5rem; 
}

.lightbox-content.is-loading {
    filter: blur(4px);
    transition: filter 0.3s ease-out;
}

.lightbox-content {
    filter: blur(0);
    transition: filter 0.3s ease-out;
}
