/* ════════════════════════════
   GALLERY — TOOLBAR & TABS
════════════════════════════ */
.gallery-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; gap: 10px; flex-wrap: wrap;
}
.gallery-toolbar--mobile {
    flex-direction: column; align-items: stretch; gap: 8px;
}
.gallery-toolbar--mobile .gallery-perpage__select-wrap {
    align-self: flex-end;
}

.gallery-tabs {
    display: flex; gap: 5px;
    position: relative;
    background: var(--snow);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 3px;
}
[data-theme="dark"] .gallery-tabs { background: rgba(255,255,255,0.04); }

.gallery-tab {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 13px; border-radius: 100px; border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem; font-weight: 500;
    color: var(--muted); background: transparent;
    cursor: pointer; white-space: nowrap;
    position: relative; z-index: 1;
    transition: color 0.18s var(--ease);
}
.gallery-tab svg { flex-shrink: 0; opacity: 0.70; }
.gallery-tab:hover { color: var(--ink); }
[data-theme="dark"] .gallery-tab:hover { color: var(--ice); }

.gallery-tab.active {
    background: transparent;
    color: var(--ink);
}
[data-theme="dark"] .gallery-tab.active {
    background: transparent;
    color: #93C5FD;
}
.gallery-tab.active svg { opacity: 1; }

/* Sliding glider pill for gallery tabs */
.gallery-tabs__glider {
    position: absolute;
    top: 0; left: 0;
    border-radius: 100px;
    pointer-events: none;
    z-index: 0;
    background: var(--card);
    box-shadow: 0 1px 4px rgba(8,12,24,0.08), 0 0 0 1px rgba(8,12,24,0.05);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1),
                width    0.28s cubic-bezier(0.4,0,0.2,1),
                height   0.28s cubic-bezier(0.4,0,0.2,1);
}
[data-theme="dark"] .gallery-tabs__glider {
    background: rgba(56,189,248,0.15);
    box-shadow: 0 0 0 1px rgba(56,189,248,0.22);
}

.gallery-tab__count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 100px;
    background: rgba(100,116,139,0.12);
    font-size: 0.65rem; font-weight: 600;
    color: var(--muted);
    transition: background 0.18s, color 0.18s;
}
.gallery-tab.active .gallery-tab__count {
    background: rgba(56,189,248,0.14);
    color: var(--ice-bright);
}

.gallery-tabs--mobile {
    width: 100%; justify-content: center;
}
.gallery-tabs--mobile .gallery-tab {
    flex: 1; justify-content: center;
    padding: 7px 10px; font-size: 0.72rem;
}

/* ── Per-page selector ── */
.gallery-perpage {
    display: flex; align-items: center; gap: 7px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem; color: var(--muted);
    flex-shrink: 0;
}
.gallery-perpage__label { white-space: nowrap; }
.gallery-perpage__select-wrap {
    position: relative; display: flex; align-items: center;
}
.gallery-perpage__select {
    appearance: none; -webkit-appearance: none;
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem; font-weight: 500;
    color: var(--ink);
    background: var(--snow);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 5px 28px 5px 12px;
    cursor: pointer; outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.gallery-perpage__select:hover,
.gallery-perpage__select:focus {
    border-color: rgba(56,189,248,0.50);
    box-shadow: 0 0 0 3px rgba(56,189,248,0.10);
}
[data-theme="dark"] .gallery-perpage__select {
    background: rgba(255,255,255,0.06);
    color: var(--ink);
    border-color: var(--border);
}
.gallery-perpage__chevron {
    position: absolute; right: 10px; top: 50%;
    transform: translateY(-50%);
    pointer-events: none; color: var(--silver);
}
.gallery-perpage__select--mobile { font-size: 0.72rem; padding: 5px 26px 5px 10px; }

/* ── Shown info + footer ── */
.gallery-footer { display: flex; flex-direction: column; gap: 6px; }
.gallery-shown-info {
    font-size: 0.69rem; color: var(--silver); min-height: 1.4em;
}
.gallery-shown-info--mobile { font-size: 0.68rem; color: rgba(148,163,184,0.70); margin-bottom: 4px; }
.gallery-shown-info:empty { display: none; }

/* ── Scrollable grid wrapper (desktop) ── */
.gallery-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    min-height: 0;
    padding-right: 4px;
    margin-right: -4px;
}
.gallery-scroll::-webkit-scrollbar { width: 4px; }
.gallery-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 100px; }

.gallery-item[hidden] { display: none; }

/* ════════════════════════════
   GALLERY — GRID & ITEMS
════════════════════════════ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

/* ── Video card ── */
.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: #0a0f1a;
    border: 1px solid var(--border);
    text-decoration: none;
    display: block;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(8,12,24,0.08);
    transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
}
.gallery-item.gf-hidden { display: none; }

.gallery-item:hover {
    transform: translateY(-4px) scale(1.015);
    border-color: rgba(56,189,248,0.30);
    box-shadow: 0 12px 32px rgba(8,12,24,0.20), 0 0 0 1px rgba(56,189,248,0.12);
    z-index: 2;
}
.gallery-item--yt:hover  { border-color: rgba(220,38,38,0.36); box-shadow: 0 12px 32px rgba(8,12,24,0.20), 0 0 0 1px rgba(220,38,38,0.16); }
.gallery-item--ig:hover  { border-color: rgba(188,24,136,0.34); box-shadow: 0 12px 32px rgba(8,12,24,0.20), 0 0 0 1px rgba(188,24,136,0.14); }
.gallery-item:active     { transform: scale(0.97); transition-duration: 0.08s; }

/* Thumbnail */
.gallery-item img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.45s var(--ease);
}
.gallery-item:hover img { transform: scale(1.06); }

/* Single clean gradient — dark shelf at bottom, faint top vignette */
.gallery-item__overlay {
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(
        to top,
        rgba(4,7,16,0.92) 0%,
        rgba(4,7,16,0.30) 38%,
        rgba(4,7,16,0.08) 60%,
        transparent 78%
    );
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 8px 9px 9px; gap: 2px;
}

.gallery-item__caption {
    font-family: 'Outfit', sans-serif;
    font-size: 0.65rem; font-weight: 600; line-height: 1.3;
    color: rgba(255,255,255,0.92);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.gallery-item__date {
    font-family: 'Outfit', sans-serif;
    font-size: 0.58rem; font-weight: 400;
    color: rgba(255,255,255,0.42);
    letter-spacing: 0.04em;
    display: block;
}

/* Platform badge — top-right, brand-colored */
.gallery-item__badge {
    position: absolute; top: 7px; right: 7px;
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.20);
    backdrop-filter: blur(8px);
    color: #fff;
    transition: transform 0.20s var(--ease);
}
.gallery-item--yt .gallery-item__badge { background: rgba(200,30,30,0.85); }
.gallery-item--ig .gallery-item__badge {
    background: linear-gradient(135deg, rgba(240,148,51,0.90) 0%, rgba(188,24,136,0.90) 100%);
}
.gallery-item:hover .gallery-item__badge { transform: scale(1.10); }

/* "NEU" badge — top left */
.gallery-item__new {
    position: absolute; top: 7px; left: 7px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.55rem; font-weight: 700; letter-spacing: 0.10em;
    color: #080C18;
    background: var(--ice-bright);
    padding: 2px 6px; border-radius: 100px;
    pointer-events: none;
    animation: newPulse 2.4s ease-in-out infinite;
}
@keyframes newPulse {
    0%, 100% { box-shadow: 0 0 0 0   rgba(56,189,248,0.50); }
    50%       { box-shadow: 0 0 0 5px rgba(56,189,248,0);    }
}

/* Play button — centered */
.gallery-item__play {
    position: absolute; top: 42%; left: 50%;
    transform: translate(-50%, -50%);
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255,255,255,0.28);
    color: #fff;
    pointer-events: none;
    opacity: 0.72;
    transition: opacity 0.24s var(--ease), transform 0.24s var(--ease), background 0.24s var(--ease);
}
.gallery-item--ig .gallery-item__play { background: rgba(255,255,255,0.16); }
.gallery-item--yt .gallery-item__play { background: rgba(200,30,30,0.80); border-color: rgba(255,255,255,0.22); }

.gallery-item:hover .gallery-item__play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.12);
}
.gallery-item--yt:hover .gallery-item__play { background: rgba(220,38,38,0.95); }
.gallery-item--ig:hover .gallery-item__play { background: rgba(255,255,255,0.24); }

/* Touch */
@media (hover: none) and (pointer: coarse) {
    .gallery-item__play  { opacity: 0.85; }
    .gallery-item:hover  { transform: none; box-shadow: 0 2px 8px rgba(8,12,24,0.10); }
    .gallery-item:active { transform: scale(0.96); }
}

/* Empty state */
.gallery-empty {
    grid-column: 1 / -1;
    text-align: center; padding: 40px 20px;
    color: var(--muted); font-size: 0.88rem;
}

/* Load more */
.gallery-load-more {
    display: block; width: 100%;
    padding: 11px; margin-top: 4px; margin-bottom: 10px;
    border-radius: var(--radius-btn);
    border: 1px solid var(--border);
    background: var(--snow); color: var(--muted);
    font-family: 'Outfit', sans-serif; font-size: 0.80rem; font-weight: 500;
    cursor: pointer;
    transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
}
.gallery-load-more:hover { background: rgba(56,189,248,0.07); border-color: rgba(56,189,248,0.30); color: var(--active-c); }
[data-theme="dark"] .gallery-load-more { background: rgba(255,255,255,0.04); }

/* Legal attribution */
.gallery-legal {
    display: flex; align-items: flex-start; gap: 6px;
    font-size: 0.68rem; color: var(--silver); line-height: 1.65;
    margin-top: 4px; padding-top: 10px;
    border-top: 1px solid var(--border);
}
.gallery-legal svg { flex-shrink: 0; margin-top: 2px; opacity: 0.55; }

/* Lightbox nav arrows */
.lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.16);
    color: rgba(226,232,240,0.80); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    z-index: 2;
}
.lb-nav:hover { background: rgba(56,189,248,0.18); color: #38BDF8; border-color: rgba(56,189,248,0.32); }
.lb-nav--prev { left: -52px; }
.lb-nav--next { right: -52px; }
@media (max-width: 1020px) {
    .lb-nav--prev { left: 6px; }
    .lb-nav--next { right: 6px; }
}

/* Mobile gallery: 3-col */
@media (max-width: 720px) {
    .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .gallery-item { aspect-ratio: 3 / 4; border-radius: 12px; }
    .gallery-item__caption { font-size: 0.60rem; }
    .gallery-item__play { width: 34px; height: 34px; }
}
@media (max-width: 340px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Touch device: show gallery overlay permanently ── */
@media (hover: none) {
    .gallery-item__overlay { opacity: 1; }
    .gallery-item:hover { transform: none; }
    .gallery-item:active { transform: scale(0.97); }
}

/* ═══════════════════════════
   SKELETON LOADING
═══════════════════════════ */

.gallery-item__skeleton {
    position: absolute; inset: 0; z-index: 2;
    background: linear-gradient(
        90deg,
        var(--snow) 0%,
        rgba(168,216,234,0.18) 40%,
        var(--snow) 80%
    );
    background-size: 200% 100%;
    animation: skeleton-sweep 1.6s ease-in-out infinite;
    border-radius: inherit;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
@keyframes skeleton-sweep {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Hide skeleton once image loaded */
.gallery-item.loaded .gallery-item__skeleton { opacity: 0; pointer-events: none; }
.gallery-item img { opacity: 0; transition: opacity 0.4s ease; }
.gallery-item.loaded img { opacity: 1; }

[data-theme="dark"] .gallery-item__skeleton {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.05) 0%,
        rgba(56,189,248,0.10) 40%,
        rgba(255,255,255,0.05) 80%
    );
    background-size: 200% 100%;
    animation: skeleton-sweep 1.6s ease-in-out infinite;
}

/* ═══════════════════════════
   GALLERY LIGHTBOX
═══════════════════════════ */

.lb {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(4,7,16,0.92);
    backdrop-filter: blur(16px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
}
.lb.visible {
    opacity: 1; pointer-events: all;
}

.lb-inner {
    width: 100%; max-width: 900px;
    display: flex; flex-direction: column; gap: 10px;
}
.lb.visible .lb-inner { animation: lbIn 0.30s cubic-bezier(0.16,1,0.3,1) both; }
@keyframes lbIn {
    from { opacity:0; transform: scale(0.96) translateY(10px); }
    to   { opacity:1; transform: scale(1)    translateY(0);    }
}

.lb-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.lb-title {
    font-family: 'Outfit', sans-serif; font-size: 0.88rem; font-weight: 500;
    color: rgba(226,232,240,0.92); flex: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.lb-action {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 100px;
    background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14);
    color: rgba(226,232,240,0.80); font-size: 0.75rem; font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.lb-action:hover { background: rgba(56,189,248,0.15); color: #38BDF8; border-color: rgba(56,189,248,0.32); }

.lb-close {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
    color: rgba(226,232,240,0.80); cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}
.lb-close:hover { background: rgba(239,68,68,0.18); color: #f87171; border-color: rgba(239,68,68,0.32); }

.lb-media {
    width: 100%; border-radius: 16px; overflow: hidden;
    background: rgba(4,7,16,0.80);
    border: 1px solid rgba(255,255,255,0.07);
    aspect-ratio: 16 / 9;
    position: relative;
}
.lb-frame {
    width: 100%; height: 100%;
    display: none; border: none;
}
.lb-img {
    width: 100%; height: 100%;
    object-fit: contain; display: none;
    background: rgba(4,7,16,0.6);
}

.lb-swipe-hint {
    text-align: center; font-size: 0.65rem; letter-spacing: 0.06em;
    color: rgba(255,255,255,0.18); text-transform: uppercase;
    display: none;
}
@media (hover: none) and (pointer: coarse) {
    .lb-swipe-hint { display: block; }
}

/* Mobile lightbox: taller aspect ratio */
@media (max-width: 720px) {
    .lb { padding: 12px; align-items: flex-end; padding-bottom: 0; }
    .lb-inner { max-height: 92dvh; }
    .lb-media { aspect-ratio: 4 / 5; }
}
