/* ===== Gallery grid (matches card-grid from browse.css) ===== */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1em;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    color: var(--color-text);
    background: var(--color-surface);
    border-radius: 8px;
    overflow: hidden;
    transition: background 0.15s;
}

.gallery-item:hover {
    background: var(--color-card-hover);
}

.gallery-item-thumb {
    position: relative;
    overflow: hidden;
}

.gallery-item-thumb img,
.gallery-item-thumb video {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    transition: transform 0.15s;
}

.gallery-item:hover .gallery-item-thumb img,
.gallery-item:hover .gallery-item-thumb video {
    transform: scale(1.03);
}

.gallery-item .gallery-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.85);
    font-size: 48px;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* ===== Lightbox ===== */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox[hidden] {
    display: none;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    transition: opacity 0.15s;
}

.lightbox-video {
    max-width: 90vw;
    max-height: 80vh;
}

.lightbox-content {
    z-index: 0;
}

.lightbox-close,
.lightbox-share,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    z-index: 2;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: color 0.15s;
    padding: 8px;
}

.lightbox-close:hover,
.lightbox-share:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    color: #fff;
}

.lightbox-close {
    top: 16px;
    right: 16px;
}

.lightbox-share {
    top: 16px;
    right: 64px;
}

.lightbox-close .material-symbols,
.lightbox-share .material-symbols {
    font-size: 32px;
}

.lightbox-prev {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev .material-symbols,
.lightbox-next .material-symbols {
    font-size: 48px;
}

.lightbox-caption {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    z-index: 1;
}

/* ===== Mobile ===== */

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lightbox-prev .material-symbols,
    .lightbox-next .material-symbols {
        font-size: 36px;
    }
}
