/* ============================================
   Gallery, upload page, and admin — shared additions on top of
   styles.css. Consumes the existing design tokens; does not redefine
   them (plan §11).
   ============================================ */

/* ---- Gate card ---- */
#gate-card {
    max-width: 480px;
    margin: 140px auto 0;
}
#gate-card .deco-card-inner {
    gap: 20px;
}
#gate-error {
    color: var(--accent-red);
    font-family: var(--font-display);
    font-size: 0.85rem;
    text-align: center;
    min-height: 18px;
}

/* ---- Filter chips ---- */
.chip-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}
.chip {
    padding: 8px 20px;
    border: 1px solid var(--gold-500);
    background: transparent;
    color: var(--gold-300);
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-base);
}
.chip.active,
.chip:hover {
    background: var(--gold-gradient);
    color: var(--bg-deep);
    border-color: var(--gold-100);
}

/* ---- Masonry grid ---- */
.gallery-grid {
    columns: 1;
    column-gap: 12px;
}
@media (min-width: 640px) { .gallery-grid { columns: 2; } }
@media (min-width: 1024px) { .gallery-grid { columns: 3; } }
@media (min-width: 1400px) { .gallery-grid { columns: 4; } }

.gallery-tile {
    break-inside: avoid;
    margin-bottom: 12px;
    position: relative;
    border: 1px solid var(--gold-500);
    background: var(--bg-dark);
    cursor: pointer;
    overflow: hidden;
}
.gallery-tile img {
    display: block;
    width: 100%;
    height: auto;
}
.gallery-tile.featured::before {
    content: '◈ FEATURED';
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    background: var(--bg-deep);
    color: var(--gold-300);
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    padding: 4px 8px;
    border: 1px solid var(--gold-400);
}
.gallery-tile .play-badge {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 48px; height: 48px;
    border: 2px solid var(--gold-200);
    background: rgba(10,10,12,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-200);
    pointer-events: none;
}
.gallery-tile .processing-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.8rem;
    text-align: center;
    padding: 16px;
}
.gallery-tile.skeleton {
    aspect-ratio: 4/5;
    background: linear-gradient(90deg, var(--bg-dark) 25%, #1a1a1e 37%, var(--bg-dark) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ---- Empty state ---- */
#empty-state {
    text-align: center;
    padding: 60px 24px;
    display: none;
}
#empty-state .card-title { margin-bottom: 12px; }

/* ---- Lightbox ---- */
#lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(5,5,6,0.96);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 24px;
}
#lightbox.open { display: flex; }

#lightbox-close {
    position: absolute;
    top: 20px; right: 24px;
    background: none;
    border: none;
    color: var(--gold-200);
    font-size: 1.75rem;
    cursor: pointer;
    z-index: 2;
}
#lightbox-nav-prev, #lightbox-nav-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gold-300);
    font-size: 2.5rem;
    cursor: pointer;
    padding: 20px;
    z-index: 2;
}
#lightbox-nav-prev { left: 8px; }
#lightbox-nav-next { right: 8px; }

#lightbox-media {
    max-width: min(90vw, 1100px);
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
#lightbox-media img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}
#lightbox-media iframe {
    width: min(90vw, 1100px);
    height: min(50vw, 620px);
    border: none;
}

#lightbox-caption {
    text-align: center;
    max-width: 640px;
    margin-top: 20px;
}
#lightbox-download {
    margin-top: 16px;
}

/* ---- Load more ---- */
#load-sentinel {
    height: 40px;
}
#load-status {
    text-align: center;
    font-family: var(--font-display);
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 20px;
}
