/* Virat Group — gallery.css | Gallery page: filter bar, photo/video grid, lightbox */

/* ── Hero buttons ── */
.gl-hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

/* ── Section + filter bar ── */
/* scroll-margin keeps the filter chips clear of the fixed header when jumping to #events / #videos */
.gl-section { background: var(--v4-ivory); padding: 72px 0 100px; scroll-margin-top: 40px; }

.gl-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.gl-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.gl-filter {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 20px;
    border: 1.5px solid var(--v4-line); border-radius: 999px; background: #fff;
    font-size: 14px; font-weight: 600; color: var(--v4-navy-900); cursor: pointer;
    transition: background 0.25s var(--v4-ease), color 0.25s var(--v4-ease), border-color 0.25s var(--v4-ease);
}
.gl-filter:hover { border-color: var(--v4-gold); }
.gl-filter.is-active { background: var(--v4-navy-900); border-color: var(--v4-navy-900); color: #fff; }
.gl-filter-count {
    min-width: 24px; padding: 2px 7px; border-radius: 999px; background: var(--v4-gold-soft);
    font-size: 12px; color: var(--v4-gold-dark); text-align: center;
}
.gl-filter.is-active .gl-filter-count { background: rgba(255, 255, 255, 0.14); color: var(--v4-gold-light); }
.gl-status { font-size: 14px; color: var(--v4-ink-soft); white-space: nowrap; }

/* ── Grid ── */
/* gallery.js places every tile explicitly so filtered views have no holes; dense flow is the no-JS fallback */
.gl-section > .container { container-type: inline-size; }
.gl-grid {
    --gl-cols: 4; --gl-gap: 14px;
    --gl-ratio: 1.5; /* a single tile is 3:2, the shape of most renders and event photos */
    display: grid; grid-template-columns: repeat(var(--gl-cols), minmax(0, 1fr));
    grid-auto-rows: 220px;
    grid-auto-rows: calc((100cqi - (var(--gl-cols) - 1) * var(--gl-gap)) / var(--gl-cols) / var(--gl-ratio));
    grid-auto-flow: dense; gap: var(--gl-gap);
}
.gl-item {
    position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0;
    border-radius: var(--v4-radius-sm); overflow: hidden; background: var(--v4-navy-900); cursor: zoom-in;
    animation: gl-fade-in 0.4s var(--v4-ease);
}
.gl-item.is-wide { grid-column: span 2; }
.gl-item.is-tall { grid-row: span 2; }
.gl-item.is-big { grid-column: span 2; grid-row: span 2; }
.gl-item.is-hidden { display: none; }
.gl-item[hidden], .gl-filter[hidden], .gl-hero-actions [hidden] { display: none; }
.gl-item img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.6s var(--v4-ease);
}
.gl-item::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to top, rgba(7, 13, 27, 0.78) 0%, rgba(7, 13, 27, 0) 45%);
}
.gl-item-cap {
    position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 1;
    font-size: 13.5px; font-weight: 600; color: #fff; text-align: left; line-height: 1.35;
}
.gl-item-cap small {
    display: block; margin-bottom: 2px; font-size: 11px; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--v4-gold-light);
}
.gl-item:focus-visible { outline: 3px solid var(--v4-gold); outline-offset: 3px; }

.gl-item-video { cursor: pointer; }
.gl-play {
    position: absolute; top: 50%; left: 50%; z-index: 1; transform: translate(-50%, -50%);
    width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: rgba(201, 161, 92, 0.92); color: var(--v4-navy-950); font-size: 18px;
    box-shadow: 0 0 0 8px rgba(201, 161, 92, 0.22);
    transition: transform 0.3s var(--v4-ease);
}
.gl-play i { margin-left: 3px; } /* optical centring of the triangle */

@media (hover: hover) and (pointer: fine) {
    .gl-item:hover img { transform: scale(1.05); }
    .gl-item-video:hover .gl-play { transform: translate(-50%, -50%) scale(1.1); }
}

.gl-note { margin-top: 28px; font-size: 13px; color: var(--v4-ink-soft); text-align: center; }

@keyframes gl-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Lightbox: top bar, stage, caption, thumbnail strip ── */
.gl-lightbox {
    position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column;
    height: 100vh; height: 100dvh; padding-bottom: 16px; background: var(--v4-navy-950);
}
.gl-lightbox[hidden] { display: none; }
.gl-lb-top { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; }
.gl-lb-count { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; color: var(--v4-gold-light); }

.gl-lb-main { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; gap: 16px; padding: 0 18px; }
.gl-lb-stage {
    position: relative; flex: 1 1 auto; align-self: stretch; margin: 0;
    touch-action: pinch-zoom; transition: transform 0.25s var(--v4-ease), opacity 0.25s var(--v4-ease);
}
.gl-lb-stage.is-dragging { transition: none; }
.gl-lb-img, .gl-lb-video {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
    transition: opacity 0.25s var(--v4-ease);
}
.gl-lb-img[hidden], .gl-lb-video[hidden] { display: none; }
.gl-lb-stage.is-loading .gl-lb-img { opacity: 0; }
.gl-lb-stage.is-loading::after {
    content: ''; position: absolute; top: 50%; left: 50%; width: 64px; aspect-ratio: 103 / 94;
    transform: translate(-50%, -50%); background: url('../assets/loader-logo.svg') center / contain no-repeat;
}

.gl-lb-btn {
    flex: none; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.25s var(--v4-ease), color 0.25s var(--v4-ease);
}
.gl-lb-btn:hover, .gl-lb-btn:focus-visible { background: var(--v4-gold); color: var(--v4-navy-950); }
.gl-lb-close { font-size: 26px; }

.gl-lb-caption { flex: none; margin: 14px 18px 0; text-align: center; color: #fff; font-size: 16px; font-weight: 600; }
.gl-lb-label {
    display: block; margin-bottom: 3px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--v4-gold-light);
}

.gl-lb-thumbs {
    position: relative; /* offset parent for centring the active thumb */
    flex: none; display: flex; gap: 8px; overflow-x: auto; padding: 14px 18px 2px;
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
/* auto margins centre a short strip but still let a long one scroll from its first thumb */
.gl-lb-thumb:first-child { margin-left: auto; }
.gl-lb-thumb:last-child { margin-right: auto; }
.gl-lb-thumb {
    position: relative; flex: 0 0 auto; width: 76px; height: 52px; padding: 0; border: 2px solid transparent;
    border-radius: 6px; overflow: hidden; background: var(--v4-navy-900); cursor: pointer; opacity: 0.5;
    transition: opacity 0.2s var(--v4-ease), border-color 0.2s var(--v4-ease);
}
.gl-lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gl-lb-thumb.is-active { opacity: 1; border-color: var(--v4-gold); }
.gl-lb-thumb:focus-visible { outline: 2px solid #fff; outline-offset: 1px; opacity: 1; }
.gl-lb-thumb.is-video::after {
    content: ''; position: absolute; right: 5px; bottom: 5px;
    border-left: 9px solid #fff; border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}

@media (hover: hover) and (pointer: fine) {
    .gl-lb-thumb:hover { opacity: 0.85; }
}

body.gl-locked { overflow: hidden; }


/* ── Responsive ── */
@media (max-width: 1080px) {
    .gl-grid { --gl-cols: 3; }
}

@media (max-width: 760px) {
    .gl-section { padding: 48px 0 72px; }
    .gl-hero-actions .btn { flex: 1 1 100%; }
    .gl-toolbar { flex-direction: column; align-items: stretch; }
    /* One swipeable row of chips instead of three wrapped lines on phones */
    .gl-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; }
    .gl-filters::-webkit-scrollbar { display: none; }
    .gl-filter { flex: 0 0 auto; }
    .gl-status { white-space: normal; }
    /* taller 6:5 tiles on phones so two columns don't shrink into strips */
    .gl-grid { --gl-cols: 2; --gl-gap: 10px; --gl-ratio: 1.2; }
    .gl-item-cap { left: 10px; right: 10px; bottom: 8px; font-size: 12px; }
    .gl-item-cap small { font-size: 10px; }
    .gl-play { width: 44px; height: 44px; font-size: 15px; }

    /* edge-to-edge photo; arrows float over it, since swiping is the main gesture here */
    .gl-lb-top { padding: 8px 12px; }
    .gl-lb-main { padding: 0; }
    .gl-lb-prev, .gl-lb-next {
        position: absolute; top: 50%; z-index: 1; width: 40px; height: 40px; margin-top: -20px; font-size: 15px;
        background: rgba(7, 13, 27, 0.55);
    }
    .gl-lb-prev { left: 8px; }
    .gl-lb-next { right: 8px; }
    .gl-lb-caption { margin: 12px 16px 0; font-size: 15px; }
    .gl-lb-thumbs { gap: 6px; padding: 12px 12px 2px; }
    .gl-lb-thumb { width: 58px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
    .gl-item { animation: none; }
    .gl-item img, .gl-play, .gl-lb-stage, .gl-lb-img { transition: none; }
}
