/* ==========================================================================
   Star Overseas Education Consultants — Dedicated Gallery Page Styles
   Editorial Bento/Masonry Grid, Scrollable Category Pills & Unified Lightbox
   ========================================================================== */

:root {
    --gl-blue: #0046ad;
    --gl-blue-dark: #003380;
    --gl-blue-soft: #eef4ff;
    --gl-ink: #0f172a;
    --gl-muted: #475569;
    --gl-border: #e2e8f0;
    --gl-surface: #f8fafc;
}

.gallery-page-main {
    background: #ffffff;
    overflow-x: clip;
}

/* ── Minimal Editorial Hero Banner ─────────────────────────────────────── */
.gl-hero {
    position: relative;
    background: linear-gradient(180deg, #f4f7fc 0%, #ffffff 100%);
    padding: 56px 5% 42px;
    border-bottom: 1px solid #edf2f7;
    overflow: hidden;
}

.gl-hero::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -80px;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(0, 70, 173, 0.08) 0%, rgba(0, 70, 173, 0) 70%);
    pointer-events: none;
}

.gl-hero-inner {
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.gl-hero-copy {
    max-width: 700px;
}

.gl-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: var(--gl-blue);
    border: 1px solid #dbeafe;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0, 70, 173, 0.06);
}

.gl-hero-title {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    color: var(--gl-ink);
    line-height: 1.14;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.gl-hero-title span {
    color: var(--gl-blue);
}

.gl-hero-subtitle {
    font-size: 16px;
    line-height: 1.6;
    color: var(--gl-muted);
    max-width: 620px;
}

.gl-hero-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.gl-stat-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid var(--gl-border);
    border-radius: 16px;
    padding: 12px 18px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

.gl-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--gl-blue-soft);
    color: var(--gl-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.gl-stat-pill strong {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: var(--gl-ink);
    line-height: 1.1;
}

.gl-stat-pill span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--gl-muted);
}

/* ── Sticky / Scrollable Filter Tabs Bar ───────────────────────────────── */
.gl-toolbar-section {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 5%;
}

.gl-toolbar-inner {
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.gl-filter-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0;
    flex: 1 1 auto;
    min-width: 0;
}

.gl-filter-tabs::-webkit-scrollbar {
    display: none;
}

.gl-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--gl-border);
    background: var(--gl-surface);
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, transform 0.18s ease;
}

.gl-filter-btn:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: var(--gl-blue);
}

.gl-filter-btn:focus-visible {
    outline: 2px solid var(--gl-blue);
    outline-offset: 2px;
}

.gl-filter-btn.active {
    background: var(--gl-blue);
    color: #ffffff;
    border-color: var(--gl-blue);
    box-shadow: 0 6px 16px rgba(0, 70, 173, 0.22);
}

.gl-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: inherit;
    font-size: 12px;
    font-weight: 700;
}

.gl-filter-btn.active .gl-tab-count {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.gl-showing-meta {
    font-size: 13px;
    font-weight: 600;
    color: var(--gl-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.gl-showing-meta strong {
    color: var(--gl-ink);
}

/* ── Editorial Bento / Masonry Grid ────────────────────────────────────── */
.gl-grid-section {
    padding: 34px 5% 88px;
    background: #ffffff;
}

.gl-grid-container {
    max-width: 1320px;
    margin: 0 auto;
}

.gl-bento-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 230px;
    grid-auto-flow: dense;
    gap: 18px;
    width: 100%;
}

.gl-card {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    border-radius: 18px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    text-align: left;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease, border-color 0.28s ease;
    animation: glFadeUp 0.35s ease both;
}

@keyframes glFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gl-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 38px rgba(0, 70, 173, 0.14);
    border-color: rgba(0, 70, 173, 0.3);
}

.gl-card:focus-visible {
    outline: 3px solid var(--gl-blue);
    outline-offset: 2px;
}

/* Desktop Bento Sizing Variants */
.gl-card--wide {
    grid-column: span 2;
}

.gl-card--tall {
    grid-row: span 2;
}

.gl-media-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #1e293b;
}

.gl-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 22%;
    display: block;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), filter 0.35s ease;
}

.gl-card:hover .gl-media {
    transform: scale(1.05);
}

/* Top Badges Row */
.gl-top-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    z-index: 3;
    pointer-events: none;
}

.gl-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    max-width: 72%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gl-type-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--gl-blue);
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
    flex-shrink: 0;
}

/* Video Play Button (High Contrast) */
.gl-play-overlay {
    position: absolute;
    top: 46%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #0046ad;
    border: 2px solid rgba(255, 255, 255, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 3;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.gl-play-overlay i {
    color: inherit;
    opacity: 1;
    margin-left: 3px;
    line-height: 1;
}

.gl-card:hover .gl-play-overlay {
    background: #0046ad;
    color: #ffffff;
    border-color: #0046ad;
    transform: translate(-50%, -50%) scale(1.08);
}

/* Bottom Gradient Caption Overlay */
.gl-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.08) 0%,
        rgba(15, 23, 42, 0.12) 45%,
        rgba(15, 23, 42, 0.88) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    z-index: 2;
    transition: background 0.25s ease;
}

.gl-card:hover .gl-card-overlay {
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.12) 0%,
        rgba(15, 23, 42, 0.22) 40%,
        rgba(15, 23, 42, 0.94) 100%
    );
}

.gl-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gl-card-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.gl-card-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gl-view-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    transition: background-color 0.22s ease;
}

.gl-card:hover .gl-view-chip {
    background: var(--gl-blue);
}

/* ── Bottom Enquiry Banner CTA ─────────────────────────────────────────── */
.gl-cta-band {
    margin-top: 44px;
    padding: 32px 36px;
    border-radius: 22px;
    background: linear-gradient(135deg, #0046ad 0%, #0a2d6e 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    box-shadow: 0 16px 40px rgba(0, 70, 173, 0.2);
}

.gl-cta-copy h2 {
    font-size: clamp(20px, 2.5vw, 26px);
    font-weight: 800;
    margin-bottom: 6px;
}

.gl-cta-copy p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.86);
}

.gl-cta-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.gl-cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 24px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--gl-blue);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gl-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.gl-cta-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.gl-cta-whatsapp:hover {
    background: rgba(255, 255, 255, 0.24);
}

/* ── Unified Full-Screen Dark Frosted Lightbox ─────────────────────────── */
body.gl-lightbox-open #floatingCounselBar,
body.gl-lightbox-open .floating-counsel-bar,
body.gl-lightbox-open .floating-counsel-bar.show-bar {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transform: translateX(-50%) translateY(140px) !important;
}

.gl-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.gl-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.gl-lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 15, 30, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.gl-lightbox-shell {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1040px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    padding-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gl-lightbox-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #ffffff;
}

.gl-lightbox-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gl-lb-badge {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

.gl-lb-counter {
    font-size: 13px;
    font-weight: 700;
    color: #cbd5e1;
}

.gl-lb-close {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.gl-lb-close:hover {
    background: #ffffff;
    color: var(--gl-ink);
    transform: rotate(90deg);
}

.gl-lightbox-stage-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.gl-lb-stage {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    max-height: min(68vh, calc(100vh - 200px));
    max-height: min(68dvh, calc(100dvh - 200px));
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gl-lb-media {
    max-width: 100%;
    max-height: min(68vh, calc(100vh - 200px));
    max-height: min(68dvh, calc(100dvh - 200px));
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.gl-lb-media[hidden] {
    display: none !important;
}

.gl-lb-nav {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.gl-lb-nav:hover {
    background: var(--gl-blue);
    border-color: var(--gl-blue);
    transform: scale(1.06);
}

.gl-lightbox-caption {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 14px 18px;
    color: #ffffff;
}

.gl-lightbox-caption h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #ffffff;
}

.gl-lightbox-caption p {
    font-size: 13px;
    line-height: 1.5;
    color: #cbd5e1;
}

.gl-lb-mobile-nav {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.gl-lb-swipe-hint {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
}

/* ── Responsive Breakpoints ────────────────────────────────────────────── */
@media (max-width: 1279px) {
    .gl-bento-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: 220px;
    }
}

@media (max-width: 991px) {
    .gl-hero {
        padding: 36px 5% 30px;
    }

    .gl-bento-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 230px;
        gap: 14px;
    }

    .gl-card--wide,
    .gl-card--tall {
        grid-column: span 1;
        grid-row: span 1;
    }

    .gl-toolbar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .gl-showing-meta {
        font-size: 12px;
    }
}

@media (max-width: 640px) {
    .gl-lightbox-stage-row .gl-lb-nav {
        display: none;
    }

    .gl-lb-mobile-nav {
        display: flex;
    }

    .gl-lb-mobile-nav .gl-lb-nav {
        width: 44px;
        height: 44px;
    }

    .gl-lb-stage {
        max-height: min(56vh, calc(100vh - 260px));
        max-height: min(56dvh, calc(100dvh - 260px));
    }

    .gl-lb-media {
        max-height: min(56vh, calc(100vh - 260px));
        max-height: min(56dvh, calc(100dvh - 260px));
    }

    .gl-cta-band {
        padding: 24px 20px;
    }
}

@media (max-width: 520px) {
    .gl-bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 260px;
        gap: 14px;
    }

    .gl-hero-stats {
        width: 100%;
    }

    .gl-stat-pill {
        flex: 1 1 calc(33.33% - 8px);
        min-width: 110px;
        padding: 10px 12px;
    }

    .gl-grid-section {
        padding: 24px 5% 110px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gl-card,
    .gl-media,
    .gl-play-overlay,
    .gl-filter-btn,
    .gl-lightbox {
        transition: none !important;
        animation: none !important;
    }
}
