/* Grundlayout */
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #111;
    color: #eee;
}

header {
    padding: 1.5rem 2rem;
    background: #222;
    border-bottom: 1px solid #333;
}

header h1 {
    margin: 0 0 0.5rem;
}

main {
    padding: 1.5rem 2rem;
}

/* Galerie-Grid */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.gallery-item {
    background: #1b1b1b;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    cursor: pointer;
}

.gallery-meta {
    padding: 0.75rem 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filename {
    font-size: 0.85rem;
    color: #aaa;
    word-break: break-all;
}

/* Buttons */
.download-btn {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 4px;
    text-decoration: none;
    color: #fff;
    background: #0078d4;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.download-btn:hover {
    background: #005ea6;
}

/* Lightbox */
.lightbox.hidden {
    display: none;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #111;
    border-radius: 6px;
    padding: 1rem;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1001;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
    background: #000;
}

.lightbox-close {
    position: absolute;
    top: 0.4rem;
    right: 0.7rem;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
}

.lightbox-close:hover {
    color: #ff6666;
}

/* Lightbox Download Button */
#lightbox-download {
    align-self: flex-start;
}
