/* Scoped to /gallery */
html:has(.gallery-page),
body:has(.gallery-page) {
    overflow-x: hidden;
}

.gallery-page {
    overflow-x: hidden;
    color: #0a0933;
}

.gallery-page .container-fluid {
    width: 100%;
    max-width: none;
    padding-left: clamp(12px, 3vw, 48px);
    padding-right: clamp(12px, 3vw, 48px);
}

.gallery-page img {
    max-width: 100%;
    height: auto;
}

.gallery-page a:focus-visible,
.gallery-page button:focus-visible {
    outline: 3px solid #00B4D8;
    outline-offset: 2px;
}

/* Hero */
.gallery-page .ga-hero {
    position: relative;
    isolation: isolate;
    background: linear-gradient(135deg, #0a0933 0%, #023e8a 52%, #00B4D8 100%);
    color: #fff;
    padding: 3rem 0 4rem;
    overflow: hidden;
}

.gallery-page .ga-hero::before {
    content: "";
    position: absolute;
    inset: -40% -20% auto auto;
    width: min(70vw, 520px);
    height: min(70vw, 520px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.28), transparent 68%);
    animation: ga-orb 12s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

.gallery-page .ga-hero::after {
    content: "";
    position: absolute;
    left: -120px;
    bottom: -140px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(0, 180, 216, 0.28);
    animation: ga-orb 9s ease-in-out infinite reverse;
    pointer-events: none;
    z-index: -1;
}

@keyframes ga-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(24px, -18px) scale(1.08); }
}

.gallery-page .ga-breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0 0 1rem;
    font-size: 0.9rem;
}

.gallery-page .ga-breadcrumb a {
    color: #d4af37;
}

.gallery-page .ga-breadcrumb .active,
.gallery-page .ga-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.7);
}

.gallery-page .ga-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: #fff;
}

.gallery-page .ga-hero .lead {
    max-width: 42rem;
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.05rem;
}

.gallery-page .ga-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.gallery-page .ga-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.7rem 1.4rem;
    border-radius: 30px;
    font-weight: 700;
    text-decoration: none;
    background: #d4af37;
    color: #0a0933;
    border: 0;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.gallery-page .ga-btn:hover,
.gallery-page .ga-btn:focus {
    background: #00B4D8;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
}

.gallery-page .ga-btn-ghost {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.gallery-page .ga-btn-ghost:hover,
.gallery-page .ga-btn-ghost:focus {
    background: #fff;
    color: #0a0933;
}

.gallery-page .ga-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-top: 1.75rem;
}

.gallery-page .ga-stat {
    min-width: 7rem;
}

.gallery-page .ga-stat strong {
    display: block;
    font-size: 1.6rem;
    color: #d4af37;
    line-height: 1.1;
}

.gallery-page .ga-stat span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Filters */
.gallery-page .ga-filters-wrap {
    padding: 2.25rem 0 0.5rem;
    background: #f6f8fb;
}

.gallery-page .ga-filters-wrap h2 {
    font-size: clamp(1.25rem, 2.4vw, 1.65rem);
    font-weight: 800;
    margin: 0 0 0.4rem;
}

.gallery-page .ga-filters-wrap > p {
    color: #445;
    margin-bottom: 1rem;
    max-width: 40rem;
}

.gallery-page .ga-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 100%;
}

.gallery-page .ga-filter {
    min-height: 40px;
    max-width: 100%;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    white-space: normal;
    text-align: left;
    border: 1px solid #cfd8e3;
    background: #fff;
    color: #0a0933;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.gallery-page .ga-filter:hover {
    border-color: #00B4D8;
    color: #023e8a;
}

.gallery-page .ga-filter.is-active {
    background: #0a0933;
    color: #fff;
    border-color: #0a0933;
    box-shadow: 0 0 0 4px rgba(0, 180, 216, 0.22);
    animation: ga-pulse 1.8s ease-in-out 1;
}

@keyframes ga-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 180, 216, 0.45); }
    100% { box-shadow: 0 0 0 10px rgba(0, 180, 216, 0); }
}

.gallery-page .ga-filter-count {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.75rem;
    opacity: 0.75;
}

/* Grid */
.gallery-page .ga-grid-wrap {
    padding: 1.5rem 0 3rem;
    background: #f6f8fb;
}

.gallery-page .ga-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 576px) {
    .gallery-page .ga-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .gallery-page .ga-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .gallery-page .ga-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.gallery-page .ga-card {
    min-width: 0;
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 24px rgba(10, 9, 51, 0.08);
    opacity: 0;
    transform: translateY(22px) scale(0.98);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.25s ease;
}

.gallery-page .ga-card.is-in {
    opacity: 1;
    transform: none;
}

.gallery-page .ga-card.is-hidden {
    display: none;
}

.gallery-page .ga-card-link {
    display: block;
    position: relative;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
}

.gallery-page .ga-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    transform: scale(1.02);
    transition: transform 0.7s ease;
}

.gallery-page .ga-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
    transform: translateX(-120%);
    pointer-events: none;
}

.gallery-page .ga-card:hover,
.gallery-page .ga-card:focus-within {
    box-shadow: 0 16px 36px rgba(10, 9, 51, 0.16);
}

.gallery-page .ga-card:hover img,
.gallery-page .ga-card:focus-within img {
    transform: scale(1.08);
}

.gallery-page .ga-card:hover .ga-card-link::after,
.gallery-page .ga-card:focus-within .ga-card-link::after {
    animation: ga-shine 0.85s ease;
}

@keyframes ga-shine {
    to { transform: translateX(120%); }
}

.gallery-page .ga-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2.2rem 0.9rem 0.85rem;
    background: linear-gradient(transparent, rgba(10, 9, 51, 0.88));
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
}

.gallery-page .ga-empty {
    grid-column: 1 / -1;
    text-align: center;
    background: #fff;
    border-radius: 14px;
    padding: 2.5rem 1.25rem;
    color: #445;
}

.gallery-page .ga-filter-empty {
    margin-bottom: 1rem;
}

.gallery-page .ga-filter-empty.is-hidden {
    display: none;
}

/* CTA */
.gallery-page .ga-cta {
    background: #0a0933;
    color: #fff;
    padding: 3rem 0;
}

.gallery-page .ga-cta h2 {
    font-size: clamp(1.3rem, 2.5vw, 1.85rem);
    font-weight: 800;
    margin-bottom: 0.6rem;
    color: #fff;
}

.gallery-page .ga-cta p {
    max-width: 38rem;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 1.25rem;
}

/* Lightbox */
.gallery-page .ga-lightbox {
    border: 0;
    padding: 0;
    background: transparent;
    max-width: none;
    width: auto;
    margin: 0;
}

.gallery-page .ga-lightbox[open] {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: transparent;
}

.gallery-page .ga-lightbox::backdrop {
    background: rgba(10, 9, 51, 0.82);
}

.gallery-page .ga-lightbox-inner {
    position: relative;
    width: min(92vw, 1040px);
    max-height: 90vh;
    background: #0a0933;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    animation: ga-pop 0.28s ease;
}

@keyframes ga-pop {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: none; }
}

.gallery-page .ga-lightbox img {
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
    background: #000;
    display: block;
}

.gallery-page .ga-lightbox figcaption {
    padding: 0.85rem 1rem 1rem;
    color: #fff;
    font-weight: 600;
}

.gallery-page .ga-lightbox-close,
.gallery-page .ga-lightbox-nav {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #0a0933;
    cursor: pointer;
}

.gallery-page .ga-lightbox-close {
    top: 10px;
    right: 10px;
}

.gallery-page .ga-lightbox-prev {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-page .ga-lightbox-next {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 575.98px) {
    .gallery-page .ga-hero,
    .gallery-page .ga-cta {
        padding: 2.25rem 0;
    }

    .gallery-page .ga-lightbox-prev,
    .gallery-page .ga-lightbox-next {
        top: auto;
        bottom: 58px;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-page .ga-hero::before,
    .gallery-page .ga-hero::after,
    .gallery-page .ga-card,
    .gallery-page .ga-card img,
    .gallery-page .ga-btn,
    .gallery-page .ga-filter,
    .gallery-page .ga-lightbox-inner {
        animation: none !important;
        transition: none !important;
    }

    .gallery-page .ga-card {
        opacity: 1;
        transform: none;
    }
}
