/* HERO */
.gallery-hero {
    position: relative;
    height: 70vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.gallery-hero-bg {
    position: absolute;
    inset: 0;
    will-change: transform;
}
.gallery-hero-bg img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center 40%;
    transform: scale(1.08);
    transition: transform 8s ease;
}
.gallery-hero.loaded .gallery-hero-bg img { transform: scale(1); }

.gallery-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        rgba(0,0,0,0.88) 0%,
        rgba(0,0,0,0.55) 55%,
        rgba(0,0,0,0.25) 100%
    );
}
.gallery-hero-content {
    position: relative;
    z-index: 2;
    color: var(--white);
    max-width: 660px;
    padding-top: 80px;
}
.hero-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gold);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    margin-bottom: 18px;
    transition: gap 0.2s;
}
.hero-back-link:hover { gap: 12px; }

.gallery-hero-content .section-label { margin-bottom: 10px; }
.gallery-hero-content h1 {
    font-size: clamp(2.8rem, 6vw, 5rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.04;
    margin-bottom: 18px;
    animation: fadeInUp 0.9s cubic-bezier(0.4,0,0.2,1) 0.3s both;
}
.gallery-hero-content h1 span { color: var(--gold); font-style: italic; }

.gallery-hero-sub {
    font-size: 1rem;
    color: rgba(255,255,255,0.72);
    line-height: 1.8;
    margin-bottom: 36px;
    animation: fadeInUp 0.9s cubic-bezier(0.4,0,0.2,1) 0.5s both;
}

/* Hero stats */
.gallery-hero-stats {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(200,150,30,0.25);
    border-radius: 12px;
    padding: 16px 26px;
    width: fit-content;
    animation: fadeInUp 0.9s cubic-bezier(0.4,0,0.2,1) 0.7s both;
}
.hero-stat { text-align: center; padding: 0 22px; }
.hero-stat:first-child { padding-left: 0; }
.hero-stat:last-child  { padding-right: 0; }
.hero-stat-num {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
}
.hero-stat-label {
    display: block;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 4px;
}
.hero-stat-divider {
    width: 1px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    flex-shrink: 0;
}

/* WIDE CONTAINER */
.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

/* FILTER BAR */
.gallery-filter-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 48px;
}
.gallery-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 22px;
    background: var(--white);
    border: 1.5px solid #e0e0e0;
    border-radius: 40px;
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.25s;
}
.gallery-filter-btn i { font-size: 0.78rem; }
.gallery-filter-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: #fffbf0;
}
.gallery-filter-btn.active {
    background: var(--dark);
    border-color: var(--dark);
    color: var(--gold);
}

/* Count badge inside filter button */
.gal-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.08);
    color: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    line-height: 1;
    opacity: 0.7;
}
.gallery-filter-btn.active .gal-filter-count {
    background: rgba(200,150,30,0.2);
    opacity: 1;
}

/* MASONRY GRID */
.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 260px;
    gap: 12px;
}

/* Spanning helpers */
.gal-item.span-2   { grid-column: span 2; }
.gal-item.span-r-2 { grid-row: span 2; }
.gal-item.span-2.span-r-2 { grid-column: span 2; grid-row: span 2; }

/* GALLERY ITEM */
.gal-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #1a1a1a;
    cursor: pointer;
}
.gal-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
}
.gal-item .img-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 0;
    margin: 0;
}
.gal-item:hover img { transform: scale(1.07); }

/* Overlay */
.gal-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.80) 0%,
        rgba(0,0,0,0.15) 50%,
        transparent 100%
    );
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.gal-item:hover .gal-overlay { opacity: 1; }

.gal-caption {
    color: var(--white);
    flex: 1;
    padding-right: 10px;
}
.gal-cat-tag {
    display: inline-block;
    background: var(--gold);
    color: var(--dark);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 9px;
    border-radius: 20px;
    margin-bottom: 5px;
}
.gal-caption p {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.9);
    line-height: 1.4;
    margin: 0;
}

.gal-zoom {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
}
.gal-item:hover .gal-zoom {
    background: var(--gold);
    color: var(--dark);
    border-color: var(--gold);
    transform: scale(1.1);
}

/* Reveal animation for items */
.gal-item {
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.45s ease, transform 0.45s ease;
}
.gal-item.visible {
    opacity: 1;
    transform: scale(1);
}
.gal-item.hidden-filter {
    display: none;
}

/* EMPTY STATE */
.gallery-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}
.gallery-empty i {
    font-size: 3.5rem;
    color: #ccc;
    margin-bottom: 16px;
    display: block;
}
.gallery-empty p { font-size: 1rem; }

/* LIGHTBOX */
.gal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.gal-lightbox.active {
    opacity: 1;
    pointer-events: all;
}
.gal-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.95);
    cursor: pointer;
}
.gal-lb-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}
.gal-lb-img-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 78vh;
    min-width: 300px;
    min-height: 200px;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
}
#galLbImg {
    max-width: 88vw;
    max-height: 78vh;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    transition: opacity 0.25s ease;
}
#galLbImg.loading { opacity: 0; }

/* Placeholder inside lightbox when image is missing */
.gal-lb-placeholder {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 60px 80px;
    color: rgba(255,255,255,0.35);
}
.gal-lb-placeholder i { font-size: 3rem; }
.gal-lb-placeholder span { font-size: 0.9rem; letter-spacing: 0.05em; }
.gal-lb-placeholder.show { display: flex; }

.gal-lb-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 4px 0;
    gap: 20px;
}
.gal-lb-caption {
    color: rgba(255,255,255,0.7);
    font-size: 0.88rem;
    margin: 0;
    flex: 1;
}
.gal-lb-counter {
    color: var(--gold);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    font-family: var(--font-heading);
}

/* Controls */
.gal-lb-close,
.gal-lb-prev,
.gal-lb-next {
    position: fixed;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--white);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
}
.gal-lb-close:hover,
.gal-lb-prev:hover,
.gal-lb-next:hover {
    background: var(--gold);
    color: var(--dark);
    border-color: var(--gold);
}

.gal-lb-close {
    top: 20px; right: 20px;
    width: 44px; height: 44px;
    border-radius: 50%;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
}
.gal-lb-prev,
.gal-lb-next {
    top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px;
    border-radius: 50%;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
}
.gal-lb-prev { left: 20px; }
.gal-lb-next { right: 20px; }
.gal-lb-prev:hover { transform: translateY(-50%) translateX(-2px); }
.gal-lb-next:hover { transform: translateY(-50%) translateX(2px); }

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

@media (max-width: 1024px) {
    .gallery-masonry {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 220px;
    }
    .container-wide { padding: 0 20px; }
}

@media (max-width: 768px) {
    .gallery-hero {
        height: auto;
        min-height: 80vh;
        padding-top: 120px;
        padding-bottom: 50px;
        align-items: flex-start;
    }
    .gallery-masonry {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
    }
    /* Disable span on small screens for uniform grid */
    .gal-item.span-2,
    .gal-item.span-r-2,
    .gal-item.span-2.span-r-2 {
        grid-column: span 1;
        grid-row: span 1;
    }
    .gal-lb-prev { left: 10px; }
    .gal-lb-next { right: 10px; }
}

@media (max-width: 480px) {
    .gallery-masonry {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 160px;
        gap: 8px;
    }
    .gallery-filter-bar { gap: 7px; }
    .gallery-filter-btn { padding: 8px 14px; font-size: 0.78rem; }
    .gallery-hero-stats { padding: 12px 16px; }
    .hero-stat { padding: 0 14px; }
    .hero-stat-num { font-size: 1.2rem; }
    .gal-overlay { opacity: 1; }
}

@media (max-width: 360px) {
    .gallery-masonry {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 130px;
        gap: 6px;
    }
    .gallery-filter-btn { padding: 7px 10px; font-size: 0.72rem; }
    .gal-lb-prev { left: 6px; }
    .gal-lb-next { right: 6px; }
}
