/**
 * GenstarX — Galeri masonry (HP-style) dengan ukuran variatif
 */

.gx-gal-toolbar {
    margin-bottom: 28px;
    text-align: center;
}

.gx-gal-filters {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.gx-gal-filters a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.35s ease;
}

.gx-gal-filters a span {
    font-size: 11px;
    opacity: 0.6;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 20px;
}

.gx-gal-filters a:hover,
.gx-gal-filters a.active {
    color: #1e1e1e;
    background: linear-gradient(135deg, #e8a838, #f5c842);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(232, 168, 56, 0.35);
}

.gx-gal-filters a.active span {
    opacity: 0.85;
    background: rgba(0, 0, 0, 0.12);
}

/* Masonry grid — placement via JS (genstarx-gallery.js packGallery) */
.gx-gal-masonry {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 120px;
    grid-auto-flow: row;
    gap: 14px;
    text-align: left;
    padding-bottom: 40px;
}

.gx-gal-masonry:not(.gx-gal-packed) {
    visibility: hidden;
    min-height: 280px;
}

.gx-gal-masonry.gx-gal-packed {
    visibility: visible;
}

.gx-gal-tile {
    position: relative;
    min-height: 0;
    margin: 0;
}

.gx-gal-card {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: rgba(10, 10, 26, 0.6);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
    transition:
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.5s ease;
    animation: gxGalFloat 6s ease-in-out infinite;
    animation-delay: calc(var(--gal-i, 0) * -0.45s);
}

@keyframes gxGalFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.gx-gal-card:hover {
    animation: none;
    transform: scale(1.04) translateY(-8px);
    box-shadow:
        0 24px 50px rgba(0, 0, 0, 0.45),
        0 0 32px rgba(232, 168, 56, 0.25);
    z-index: 5;
}

.gx-gal-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
}

.gx-gal-card:hover img {
    transform: scale(1.12);
    filter: brightness(1.08) saturate(1.1);
}

.gx-gal-navbar-logo {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    display: flex;
    width: 54px;
    height: 54px;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border: 2px solid var(--gal-logo-border, #1677c8);
    border-radius: 50%;
    background: var(--gal-logo-background, #fff);
    box-shadow: 0 7px 18px rgba(0, 0, 0, .2);
    opacity: .95;
    transition: opacity .35s ease, transform .35s ease;
}

.gx-gal-navbar-logo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    transform: none !important;
    filter: none !important;
}

.gx-gal-card:hover .gx-gal-navbar-logo {
    opacity: .18;
    transform: scale(.9);
}

.gx-gal-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.12) 50%, transparent 60%);
    background-size: 200% 100%;
    animation: gxGalShimmer 4s ease-in-out infinite;
    animation-delay: calc(var(--gal-i, 0) * -0.3s);
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s;
}

.gx-gal-card:hover .gx-gal-shimmer {
    opacity: 1;
    animation-duration: 1.2s;
}

@keyframes gxGalShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.gx-gal-glow {
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    background: linear-gradient(135deg, #e8a838, #39ced6, #e8a838);
    background-size: 200% 200%;
    animation: gxGalGlowSpin 4s linear infinite;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s ease;
}

.gx-gal-card:hover .gx-gal-glow {
    opacity: 0.85;
}

@keyframes gxGalGlowSpin {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gx-gal-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 26, 0.92) 0%, rgba(10, 10, 26, 0.2) 45%, transparent 100%);
    display: flex;
    align-items: flex-end;
    padding: 18px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 3;
}

.gx-gal-card:hover .gx-gal-overlay {
    opacity: 1;
    transform: translateY(0);
}

.gx-gal-overlay-inner {
    width: 100%;
}

.gx-gal-cat {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #e8a838;
    margin-bottom: 6px;
}

.gx-gal-overlay h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #fff;
    line-height: 1.3;
}

.gx-gal-overlay p {
    font-size: 12px;
    opacity: 0.8;
    margin: 0 0 10px;
    line-height: 1.45;
}

.gx-gal-zoom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(232, 168, 56, 0.9);
    color: #1e1e1e;
    font-size: 14px;
    transform: scale(0.6);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.gx-gal-card:hover .gx-gal-zoom {
    transform: scale(1);
}

/* Reveal on scroll */
.gx-gal-reveal {
    opacity: 0;
    transform: translateY(28px) scale(0.96);
}

.gx-gal-reveal.animated {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Lightbox */
.gx-gal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.gx-gal-lightbox[hidden] {
    display: none !important;
}

.gx-gal-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 15, 0.92);
    backdrop-filter: blur(12px);
    animation: gxGalFadeIn 0.35s ease;
}

.gx-gal-lightbox-panel {
    position: relative;
    max-width: min(920px, 96vw);
    max-height: 90vh;
    z-index: 1;
    animation: gxGalPopIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes gxGalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes gxGalPopIn {
    from { opacity: 0; transform: scale(0.88); }
    to { opacity: 1; transform: scale(1); }
}

.gx-gal-lightbox-panel img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    display: block;
    margin: 0 auto;
}

.gx-gal-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #e8a838;
    color: #1e1e1e;
    font-size: 18px;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.gx-gal-lightbox-close:hover {
    transform: scale(1.1);
}

.gx-gal-lightbox-caption {
    text-align: center;
    margin-top: 16px;
    color: #fff;
}

.gx-gal-lightbox-caption h4 {
    font-size: 20px;
    margin-bottom: 6px;
}

.gx-gal-lightbox-caption p {
    opacity: 0.75;
    font-size: 14px;
    margin: 0;
}

@media (max-width: 991px) {
    .gx-gal-masonry {
        grid-auto-rows: 100px;
    }
}

@media (max-width: 767px) {
    .gx-gal-masonry {
        grid-auto-rows: 90px;
        gap: 10px;
        padding-bottom: 24px;
    }

    .gx-gal-card {
        border-radius: 12px;
    }

    .gx-gal-overlay {
        padding: 10px;
    }

    .gx-gal-cat {
        margin-bottom: 4px;
        font-size: 8px;
        letter-spacing: .7px;
    }

    .gx-gal-overlay h3 {
        font-family: "Space Grotesk", sans-serif;
        font-size: 12px;
        line-height: 1.25;
    }

    .gx-gal-zoom {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .gx-gal-card {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gx-gal-card,
    .gx-gal-shimmer,
    .gx-gal-glow {
        animation: none !important;
    }
}
