/* ============================================
   GALLERY PAGE — Dark Luxury Teal Aesthetic
   ============================================ */

/* ——— HERO ——— */
.gallery-hero {
    position: relative;
    min-height: 540px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    padding-bottom: 0;
}

.gallery-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.gallery-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.04);
    animation: heroZoomGallery 14s ease-in-out infinite alternate;
}

@keyframes heroZoomGallery {
    from {
        transform: scale(1.04);
    }

    to {
        transform: scale(1.10);
    }
}

.gallery-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, rgba(10, 10, 10, 0.8) 0%, rgba(10, 10, 10, 0.1) 25%),
        linear-gradient(to top, rgba(10, 10, 10, 1) 0%, rgba(10, 10, 10, 0.7) 45%, rgba(10, 10, 10, 0.1) 100%);
}

.gallery-hero-content {
    position: relative;
    z-index: 1;
    padding-top: 140px;
    padding-bottom: 64px;
}

.gallery-hero-content h1 em {
    font-style: italic;
    color: var(--teal);
}

/* Stats row */
.gallery-stats {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 48px;
    flex-wrap: wrap;
}

.gstat {
    display: flex;
    flex-direction: column;
    padding: 0 32px 0 0;
}

.gstat-num {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--teal);
    line-height: 1;
}

.gstat-label {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 4px;
}

.gstat-div {
    width: 1px;
    height: 36px;
    background: var(--border);
    margin: 0 32px 0 0;
    flex-shrink: 0;
}

/* ——— FILTER BAR ——— */
.gallery-filter-bar {
    position: sticky;
    top: 72px;
    z-index: 100;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0;
}

.filter-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 14px 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-inner::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    flex-shrink: 0;
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: transparent;
    border: 1.5px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.filter-btn:hover {
    color: var(--white);
    border-color: var(--border);
}

.filter-btn.active {
    color: var(--black);
    background: var(--teal);
    border-color: var(--teal);
}

/* ——— GALLERY GRID ——— */
#gallery-main {
    background: var(--black);
    padding-top: 60px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* ——— GALLERY CARD ——— */
.gallery-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--dark-2);
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.4s ease;
}

.gallery-card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--border-gold);
    z-index: 2;
}

.gallery-card-img {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.gallery-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        filter 0.4s ease;
}

.gallery-card:hover .gallery-card-img img {
    transform: scale(1.08);
    filter: brightness(0.75);
}

/* ——— CARD OVERLAY ——— */
.gallery-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(10, 10, 10, 0.96) 0%,
            rgba(10, 10, 10, 0.6) 42%,
            rgba(10, 10, 10, 0.05) 100%);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.gallery-card:hover .gallery-card-overlay {
    opacity: 1;
}

.overlay-content {
    width: 100%;
}

.overlay-title {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 2px;
    line-height: 1.3;
}

.overlay-dest {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 14px;
}

.overlay-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.overlay-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 100px;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.view-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    backdrop-filter: blur(8px);
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
}

.download-btn {
    background: var(--teal);
    border: 1.5px solid var(--teal);
    color: var(--black);
}

.download-btn:hover {
    background: var(--teal-light);
    border-color: var(--teal-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(143, 191, 159, 0.4);
}

/* Hidden cards during filtering */
.gallery-card.hidden {
    display: none;
}

/* ——— NO RESULTS ——— */
.gallery-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 0;
    color: var(--text-muted);
}

.gallery-no-results span {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

.gallery-no-results p {
    font-size: 1rem;
}

/* ——— LIGHTBOX ——— */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.open {
    opacity: 1;
    pointer-events: all;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 5, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 28px;
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-close:hover {
    background: var(--dark-3);
    color: var(--white);
    border-color: var(--border-gold);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-nav:hover {
    background: var(--teal);
    border-color: var(--teal);
    color: var(--black);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-content {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
}

.lightbox-img-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 0;
}

#lightboxImg {
    max-width: 80vw;
    max-height: 72vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
    display: block;
    transition: opacity 0.25s ease;
}

/* Spinner */
.lightbox-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.lightbox-loader::after {
    content: '';
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    opacity: 0;
    transition: opacity 0.2s;
}

.lightbox.loading .lightbox-loader::after {
    opacity: 1;
}

.lightbox.loading #lightboxImg {
    opacity: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.lightbox-info {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
    max-width: 80vw;
    padding: 0 4px;
}

.lightbox-text {
    flex: 1;
    min-width: 0;
}

.lightbox-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 4px;
}

.lightbox-desc {
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 480px;
}

.lightbox-download {
    flex-shrink: 0;
}

.lightbox-counter {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    text-transform: uppercase;
}

/* ——— CTA STRIP ——— */
.gallery-cta-strip {
    background: var(--dark);
    border-top: 1px solid var(--border);
    padding: 64px 0;
}

.gcta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.gcta-inner h2 {
    margin-top: 8px;
}

/* ——— RESPONSIVE ——— */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-hero {
        min-height: 420px;
    }

    #lightboxImg {
        max-width: 95vw;
        max-height: 60vh;
    }

    .lightbox-info {
        max-width: 95vw;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }

    .gcta-inner {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .gstat-num {
        font-size: 1.5rem;
    }

    .gstat {
        padding-right: 20px;
    }

    .gstat-div {
        margin-right: 20px;
    }
}