/* ========================================
   Gallery Page — Bombelaya Entertainment
   Depends on styles.css for CSS variables
   ======================================== */

/* ── Active nav link ── */
.nav-active {
    color: var(--gold) !important;
}

/* ── Logo — override intro animation (script.js non gira in questa pagina) ──
   In index.html il logo parte nascosto e viene rivelato da JS.
   Qui mostriamo tutto immediatamente senza animazione. ── */
.logo-sub {
    opacity: 0.65 !important;
    transform: none !important;
}
.logo-letter {
    opacity: 1 !important;
    transform: none !important;
}
.logo-swoosh path {
    stroke-dashoffset: 0 !important;
    transition: none !important;
}

/* ========================================
   Gallery Hero
   ======================================== */
.gal-hero {
    padding-top: calc(72px + 4rem); /* navbar height + spacing */
    padding-bottom: 3.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Subtle radial glow behind the title */
.gal-hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse at center,
        rgba(196, 163, 90, 0.07) 0%,
        transparent 70%);
    pointer-events: none;
}

.gal-hero-inner {
    position: relative;
    z-index: 1;
}

.gal-eyebrow {
    display: block;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.80;
    margin-bottom: 1rem;
}

.gal-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(3.2rem, 9vw, 6.5rem);
    color: var(--text-primary);
    line-height: 1.05;
    letter-spacing: -0.01em;
    margin-bottom: 1.2rem;
}

.gal-title-rule {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        var(--gold) 30%,
        var(--gold-light) 50%,
        var(--gold) 70%,
        transparent
    );
    margin: 0 auto 1.2rem;
}

.gal-subtitle {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 300;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* Contattaci CTA button */
.gal-cta-btn {
    display: inline-flex;
    align-items: center;
    margin-top: 2rem;
    padding: 0.75rem 2rem;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: var(--gold);
    border: 1px solid rgba(196, 163, 90, 0.50);
    border-radius: 2px;
    text-decoration: none;
    background: rgba(196, 163, 90, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.gal-cta-btn:hover {
    background: rgba(196, 163, 90, 0.14);
    border-color: rgba(196, 163, 90, 0.80);
    color: var(--gold-light);
}

.gal-cta-btn:active {
    transform: scale(0.97);
}

@media (prefers-reduced-motion: no-preference) {
    .gal-cta-btn {
        animation: gal-cta-pulse 3.5s ease-in-out infinite;
    }
}

@keyframes gal-cta-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(196,163,90,0); }
    50%       { box-shadow: 0 0 18px 3px rgba(196,163,90,0.18); }
}

@media (prefers-reduced-motion: no-preference) {
    .gal-cta-btn {
        animation: gal-fade-up 0.7s ease 0.90s both;
    }
}

/* Animations — run once on page load */
@media (prefers-reduced-motion: no-preference) {
    .gal-eyebrow {
        animation: gal-fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
    }
    .gal-title {
        animation: gal-fade-up 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.30s both;
    }
    .gal-title-rule {
        animation: gal-rule-expand 0.8s ease 0.65s both;
    }
    .gal-subtitle {
        animation: gal-fade-up 0.7s ease 0.75s both;
    }
}

@keyframes gal-fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

@keyframes gal-rule-expand {
    from { width: 0; opacity: 0; }
    to   { width: 60px; opacity: 1; }
}

/* ========================================
   Notice
   ======================================== */
.gal-notice-wrap {
    display: flex;
    justify-content: center;
    padding: 0 var(--space-md) 3rem;
}

.gal-notice {
    margin: 0 !important; /* override about-media-note margin */
    max-width: 680px;
    width: 100%;
}

/* ========================================
   Main content
   ======================================== */
.gal-main {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 var(--space-md) 6rem;
}

/* ========================================
   Category sections
   ======================================== */
.gal-category {
    margin-bottom: 5rem;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
    scroll-margin-top: 90px;
}

.gal-category.revealed {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .gal-category {
        opacity: 1;
        transform: none;
    }
}

.gal-cat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.8rem;
    padding-bottom: 0.9rem;
    position: relative;
    /* linea animata via ::after, rimuoviamo quella statica */
}

/* Linea gold che si espande da sinistra quando la categoria è rivelata */
.gal-cat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(196, 163, 90, 0.18);
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

.gal-category.revealed .gal-cat-header::after {
    transform: scaleX(1);
    transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
}

@media (prefers-reduced-motion: reduce) {
    .gal-cat-header::after { transform: scaleX(1); }
}

.gal-cat-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.5rem, 3.5vw, 2.1rem);
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.gal-cat-count {
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.70;
    white-space: nowrap;
}

/* ========================================
   Video Grids
   ======================================== */
.gal-grid {
    display: grid;
    gap: 12px;
}

/* 3-column grid (6-video categories) */
.gal-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

/* 4-column grid (4-video categories) */
.gal-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Tablet */
@media (max-width: 900px) {
    .gal-grid--3,
    .gal-grid--4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .gal-grid--3,
    .gal-grid--4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .gal-grid--3,
    .gal-grid--4 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Video Card
   ======================================== */
.gal-item {
    position: relative;
    aspect-ratio: 9 / 16;
    border-radius: 6px;
    overflow: hidden;
    background: #0e0e0e;
    border: 1px solid rgba(196, 163, 90, 0.13);
    cursor: pointer;
    /* Stagger reveal via JS-set custom property */
    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Card reveal animation */
    opacity: 0;
    transform: scale(0.96);
}

.gal-item.card-revealed {
    opacity: 1;
    transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
    .gal-item {
        opacity: 1;
        transform: none;
    }
}

/* ── Cascata a onde — le card lampeggiano una dopo l'altra in loop veloce ──
   JS assegna --wave-delay a ogni card in base all'indice.
   gal-wave-glow  → su .gal-item       (border + box-shadow, no conflitto col reveal)
   gal-wave-scale → su .gal-item-thumb (scale interno, .gal-item rimane intatto)
   ── */
@media (prefers-reduced-motion: no-preference) {
    .gal-item {
        animation: gal-wave-glow 2.4s ease-in-out infinite;
        animation-delay: var(--wave-delay, 0s);
        animation-fill-mode: both;
    }
    .gal-item-thumb {
        will-change: transform;
        animation: gal-wave-scale 2.4s ease-in-out infinite;
        animation-delay: var(--wave-delay, 0s);
        animation-fill-mode: both;
    }
}

@keyframes gal-wave-glow {
    0%, 30%, 100% {
        border-color: rgba(196, 163, 90, 0.13);
        box-shadow: none;
    }
    10% {
        border-color: rgba(196, 163, 90, 1);
        box-shadow:
            0 0 22px rgba(196, 163, 90, 0.70),
            0 0 55px rgba(196, 163, 90, 0.32),
            inset 0 0 22px rgba(196, 163, 90, 0.20);
    }
}

@keyframes gal-wave-scale {
    0%, 30%, 100% { transform: scale(1);     }
    10%           { transform: scale(1.038); }
}

/* Hover: pausa l'onda così non combatte con il glow hover */
@media (hover: hover) {
    .gal-item:hover        { animation-play-state: paused; }
    .gal-item:hover .gal-item-thumb { animation-play-state: paused; }
}

/* Mobile: glow leggermente ridotto per non appesantire */
@media (max-width: 768px) {
    @keyframes gal-wave-glow {
        0%, 30%, 100% {
            border-color: rgba(196, 163, 90, 0.13);
            box-shadow: none;
        }
        10% {
            border-color: rgba(196, 163, 90, 0.90);
            box-shadow:
                0 0 16px rgba(196, 163, 90, 0.55),
                0 0 36px rgba(196, 163, 90, 0.22),
                inset 0 0 14px rgba(196, 163, 90, 0.14);
        }
    }
}

/* Shimmer sweep al reveal — solo su card con video */
@media (prefers-reduced-motion: no-preference) {
    .gal-item:not(.gal-item--empty)::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(
            108deg,
            transparent 25%,
            rgba(255, 255, 255, 0.07) 50%,
            transparent 75%
        );
        transform: translateX(-120%);
        pointer-events: none;
        z-index: 3;
    }
    .gal-item:not(.gal-item--empty).card-revealed::after {
        animation: gal-card-shimmer 0.75s cubic-bezier(0.4, 0, 0.2, 1) 0.15s both;
    }
}

@keyframes gal-card-shimmer {
    from { transform: translateX(-120%); }
    to   { transform: translateX(220%);  }
}

/* Empty state: no interaction */
.gal-item--empty {
    cursor: default;
}

/* Hover — only on non-empty, non-touch devices */
@media (hover: hover) {
    .gal-item:not(.gal-item--empty):hover {
        border-color: rgba(196, 163, 90, 0.38);
        box-shadow: 0 0 24px rgba(196, 163, 90, 0.12);
        transform: scale(1.02);
    }

    .gal-item:not(.gal-item--empty):hover .gal-item-overlay {
        opacity: 1;
    }
}

/* Touch active feedback */
.gal-item:not(.gal-item--empty):active {
    transform: scale(0.97);
}

/* ── Thumbnail ── */
.gal-item-thumb {
    position: absolute;
    inset: 0;
}

.gal-item-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Placeholder (shown when no video source) ── */
.gal-item-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    color: var(--text-tertiary);
    background: linear-gradient(
        160deg,
        #111111 0%,
        #0d0d0d 100%
    );
}

/* Hide placeholder when item has a video */
.gal-item:not(.gal-item--empty) .gal-item-placeholder {
    display: none;
}

.gal-item-placeholder svg {
    color: var(--gold);
    opacity: 0.35;
}

.gal-item-placeholder span {
    font-family: var(--font-body);
    font-size: 0.60rem;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    opacity: 0.60;
}

/* ── Play Overlay ── */
.gal-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Desktop: hidden until hover */
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Mobile: always show a subtle overlay so users know it's tappable */
@media (hover: none) {
    .gal-item:not(.gal-item--empty) .gal-item-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.28);
    }
}

/* Hide overlay on empty items always */
.gal-item--empty .gal-item-overlay {
    display: none;
}

.gal-play-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(196, 163, 90, 0.15);
    border: 1px solid rgba(196, 163, 90, 0.50);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
    .gal-item:not(.gal-item--empty):hover .gal-play-btn {
        background: rgba(196, 163, 90, 0.28);
        transform: scale(1.1);
    }
}

/* Smaller play button on mobile */
@media (max-width: 480px) {
    .gal-play-btn {
        width: 42px;
        height: 42px;
    }
    .gal-play-btn svg {
        width: 26px;
        height: 26px;
    }
}

/* ========================================
   Lightbox
   ======================================== */
.gal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gal-lightbox.lb-open {
    opacity: 1;
    visibility: visible;
}

.gal-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 4, 4, 0.96);
}

.gal-lb-box {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 1rem;
}

.gal-lb-video {
    display: block;
    max-height: 88vh;
    max-width: 90vw;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.80);
    /* Slide-up reveal */
    transform: scale(0.96) translateY(16px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.gal-lightbox.lb-open .gal-lb-video {
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .gal-lb-video {
        transform: none;
    }
}

/* ── Lightbox loader — gold spinner + slow-connection message ── */
.gal-lb-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gal-lb-loader.lb-loading {
    opacity: 1;
}

.gal-lb-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(196, 163, 90, 0.18);
    border-top-color: #c4a35a;
    animation: gal-lb-spin 0.75s linear infinite;
    flex-shrink: 0;
}

@keyframes gal-lb-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .gal-lb-spinner {
        animation: none;
        border-color: rgba(196, 163, 90, 0.55);
        border-top-color: #c4a35a;
    }
}

/* Fix 2 — slow-connection hint: hidden by default, revealed after 12s via JS class */
.gal-lb-slow-msg {
    font-family: var(--font-body);
    font-size: 0.70rem;
    font-weight: 300;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(196, 163, 90, 0.70);
    text-align: center;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}

.gal-lb-loader.lb-slow .gal-lb-slow-msg {
    opacity: 1;
    transform: none;
}

/* Close button */
.gal-lb-close {
    position: fixed;
    top: max(1.2rem, env(safe-area-inset-top, 1.2rem));
    right: 1.2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 2;
    font-size: 0; /* hide any leftover text */
}

.gal-lb-close:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: scale(1.1);
}

.gal-lb-close:active {
    transform: scale(0.93);
}

@media (min-width: 769px) {
    .gal-lb-close {
        width: 56px;
        height: 56px;
        top: 1.5rem;
        right: 1.5rem;
        color: #dfc78a;
        background: rgba(196, 163, 90, 0.15);
        border: 1.5px solid rgba(196, 163, 90, 0.55);
        box-shadow: 0 0 18px rgba(196, 163, 90, 0.25);
    }
    .gal-lb-close:hover {
        background: rgba(196, 163, 90, 0.28);
        border-color: rgba(196, 163, 90, 0.9);
        box-shadow: 0 0 28px rgba(196, 163, 90, 0.45);
        transform: scale(1.1);
    }
    .gal-lb-close svg {
        width: 22px;
        height: 22px;
        stroke-width: 2.5;
    }
}

/* ========================================
   Pulsante X menu mobile (gallery page)
   ======================================== */
.mno-close {
    position: fixed;
    top: 1rem;
    right: var(--space-md);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    z-index: 9300;
    transition: background 0.2s ease;
}
.mno-close:hover  { background: rgba(255,255,255,0.12); }
.mno-close:active { transform: scale(0.92); }

/* ========================================
   Ambient background orbs — floating light blobs
   Creati via JS e appesi al <body>
   ======================================== */
.gal-ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.gal-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    will-change: transform;
}

.gal-orb--1 {
    width: clamp(280px, 35vw, 480px);
    height: clamp(280px, 35vw, 480px);
    background: radial-gradient(circle, rgba(196,163,90,0.09) 0%, transparent 70%);
    top: 5%;
    left: -8%;
    animation: gal-orb-drift-a 28s ease-in-out infinite;
}
.gal-orb--2 {
    width: clamp(220px, 28vw, 380px);
    height: clamp(220px, 28vw, 380px);
    background: radial-gradient(circle, rgba(184,184,200,0.07) 0%, transparent 70%);
    top: 45%;
    right: -6%;
    animation: gal-orb-drift-b 22s ease-in-out infinite;
    animation-delay: -8s;
}
.gal-orb--3 {
    width: clamp(200px, 24vw, 340px);
    height: clamp(200px, 24vw, 340px);
    background: radial-gradient(circle, rgba(196,163,90,0.06) 0%, transparent 70%);
    bottom: 15%;
    left: 30%;
    animation: gal-orb-drift-a 32s ease-in-out infinite;
    animation-delay: -14s;
}
.gal-orb--4 {
    width: clamp(160px, 20vw, 280px);
    height: clamp(160px, 20vw, 280px);
    background: radial-gradient(circle, rgba(212,212,224,0.05) 0%, transparent 70%);
    top: 70%;
    left: -5%;
    animation: gal-orb-drift-b 18s ease-in-out infinite;
    animation-delay: -5s;
}

@keyframes gal-orb-drift-a {
    0%   { transform: translate(0,    0)    scale(1);    }
    33%  { transform: translate(40px, -35px) scale(1.06); }
    66%  { transform: translate(-25px, 45px) scale(0.94); }
    100% { transform: translate(0,    0)    scale(1);    }
}
@keyframes gal-orb-drift-b {
    0%   { transform: translate(0,     0)    scale(1);    }
    40%  { transform: translate(-30px, 30px) scale(1.05); }
    70%  { transform: translate(20px, -40px) scale(0.96); }
    100% { transform: translate(0,     0)    scale(1);    }
}

/* Mobile: orbs più piccoli e meno opachi */
@media (max-width: 768px) {
    .gal-orb--1 { opacity: 0.7; }
    .gal-orb--2 { opacity: 0.6; }
    .gal-orb--3 { opacity: 0.5; }
    .gal-orb--4 { display: none; }
}

/* ========================================
   Back button
   ======================================== */
.gal-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    position: absolute;
    top: calc(72px + 1.4rem);
    left: var(--space-md);
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s ease;
    z-index: 2;
}
.gal-back-btn:hover { color: var(--gold); }
.gal-back-btn svg   { flex-shrink: 0; }

@media (prefers-reduced-motion: no-preference) {
    .gal-back-btn svg {
        animation: gal-arrow-nudge 2.8s ease-in-out infinite;
    }
}
@keyframes gal-arrow-nudge {
    0%, 100% { transform: translateX(0);   }
    50%       { transform: translateX(-4px); }
}

@media (max-width: 768px) {
    .gal-back-btn { top: calc(64px + 1rem); }
}

/* ========================================
   Categoria toggle — freccia nel cat-header
   ======================================== */
.gal-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background: none;
    border: 1px solid rgba(196, 163, 90, 0.22);
    border-radius: 50%;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.gal-toggle-btn:hover  { color: var(--gold); border-color: rgba(196,163,90,0.55); }
.gal-toggle-btn:active { transform: scale(0.92); }

/* Collapsed grid — desktop: show first 3 */
.gal-grid--collapsed .gal-item:nth-child(n+4) { display: none; }

/* Mobile/tablet: show first 2 (one row of 2 columns) */
@media (max-width: 900px) {
    .gal-grid--collapsed .gal-item:nth-child(n+3) { display: none; }
}

/* ========================================
   Responsive adjustments
   ======================================== */
@media (max-width: 768px) {
    .gal-hero {
        padding-top: calc(64px + 2.5rem);
        padding-bottom: 2.5rem;
    }

    .gal-main {
        padding: 0 1rem 4rem;
    }

    .gal-cat-header {
        margin-bottom: 1.2rem;
    }

    .gal-category {
        margin-bottom: 3.5rem;
    }

    .gal-grid {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .gal-notice-wrap {
        padding: 0 1rem 2rem;
    }
}

/* Fix 3 — Portrait mobile lightbox: vertical videos fill the viewport
   without black bars.  width/height auto + max constraints let the
   browser respect the video's intrinsic 9:16 ratio naturally.
   object-fit is irrelevant here because we let the element size itself. */
@media (max-width: 768px) and (orientation: portrait) {
    .gal-lb-video {
        max-height: 92vh;
        max-width: 100vw;
        width: auto;
        height: auto;
        border-radius: 4px;
    }

    .gal-lb-box {
        padding: 0;
    }
}


