/* ═══ Gallery — Simple & Reliable ═══ */

.gallery-page {
    min-height: calc(100dvh - 120px);
    padding: 1rem 1rem 1.5rem;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(74, 222, 128, 0.1), transparent 55%),
        linear-gradient(180deg, #04140a 0%, #020a05 100%);
    color: #fff;
}

.gallery-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.gallery-back {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.gallery-heading {
    text-align: center;
    flex: 1;
}

.gallery-badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.35);
    margin-bottom: 0.35rem;
}

.gallery-heading h1 {
    margin: 0;
    font-size: clamp(1.25rem, 3vw, 1.85rem);
}

.gallery-heading p {
    margin: 0.25rem 0 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.82rem;
}

.gallery-counter {
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #d4af37;
    font-weight: 800;
    font-size: 0.82rem;
    flex-shrink: 0;
}

/* ─── Main showcase ─── */
.gallery-showcase {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.gallery-main {
    position: relative;
    flex: 1;
    margin: 0;
    text-align: center;
    min-width: 0;
}

.gallery-frame {
    padding: 3px;
    border-radius: 18px;
    background: linear-gradient(135deg, #d4af37, #4ade80, #d4af37);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.gallery-frame img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 200px;
    max-height: min(58vh, 560px);
    object-fit: contain;
    border-radius: 15px;
    background: #0a1a10;
    cursor: zoom-in;
}

.gallery-main figcaption {
    margin-top: 0.65rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.92);
}

.gallery-fullscreen {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
}

.gallery-arrow {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.gallery-arrow:hover {
    background: rgba(212, 175, 55, 0.2);
}

/* ─── Dots ─── */
.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.gallery-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
}

.gallery-dot.is-active {
    width: 22px;
    border-radius: 999px;
    background: linear-gradient(90deg, #d4af37, #4ade80);
}

/* ─── Thumbs ─── */
.gallery-thumbs {
    display: flex;
    gap: 0.55rem;
    overflow-x: auto;
    padding: 0.35rem 0.25rem 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.gallery-thumb {
    flex: 0 0 auto;
    width: 84px;
    height: 64px;
    padding: 2px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    overflow: hidden;
    cursor: pointer;
    scroll-snap-align: center;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 7px;
}

.gallery-thumb.is-active {
    border-color: #d4af37;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.35);
}

/* ─── Empty ─── */
.gallery-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: rgba(255, 255, 255, 0.75);
}

/* ─── Lightbox ─── */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(2, 8, 4, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
}

.gallery-lightbox[hidden] {
    display: none !important;
}

.gallery-lightbox img {
    max-width: 96vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 12px;
}

.gallery-lightbox p {
    margin: 0;
    color: #fff;
    font-weight: 600;
}

.gallery-lightbox-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.gallery-lightbox-prev,
.gallery-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
}

.gallery-lightbox-prev { right: 1rem; }
.gallery-lightbox-next { left: 1rem; }

@media (max-width: 768px) {
    .gallery-page {
        padding: 0.75rem 0.65rem 1rem;
        min-height: calc(100dvh - 100px);
    }

    .gallery-header {
        flex-wrap: wrap;
    }

    .gallery-heading {
        order: 3;
        width: 100%;
    }

    .gallery-arrow {
        width: 38px;
        height: 38px;
        font-size: 1.25rem;
    }

    .gallery-frame img {
        max-height: 46vh;
        min-height: 160px;
    }

    .gallery-thumb {
        width: 72px;
        height: 54px;
    }

    .gallery-lightbox-prev,
    .gallery-lightbox-next {
        top: auto;
        bottom: 1rem;
        transform: none;
    }

    .gallery-lightbox-prev { right: calc(50% + 0.4rem); }
    .gallery-lightbox-next { left: calc(50% + 0.4rem); }
}
