/* ============================================================
   gallery.css — Gallery page styles for Brown Phoenix Productions
   ============================================================ */

/* ---- Hero ---- */
.gallery-hero {
    padding: clamp(5rem, 10vw, 8rem) 0 clamp(2.5rem, 5vw, 4rem);
    background: var(--phoenix-cream);
    border-bottom: 1px solid var(--phoenix-line);
}
.gallery-hero-heading {
    margin-top: .75rem;
}
.gallery-hero-intro {
    max-width: 560px;
    margin-top: 1.25rem;
    color: var(--phoenix-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ---- Filter bar ---- */
.gallery-filters-wrap {
    position: sticky;
    top: 84px; /* sits just below the sticky site-header */
    z-index: 90;
    background: rgba(254, 251, 245, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--phoenix-line);
    padding: .75rem 0;
}
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.gallery-filter-btn {
    display: inline-flex;
    align-items: center;
    padding: .45rem 1.05rem;
    border: 1px solid var(--phoenix-line);
    background: transparent;
    color: var(--phoenix-muted);
    font-family: "Manrope", Arial, sans-serif;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .22s ease, color .22s ease, border-color .22s ease;
}
.gallery-filter-btn:hover {
    border-color: var(--phoenix-gold);
    color: var(--phoenix-brown);
}
.gallery-filter-btn.is-active {
    background: var(--phoenix-brown);
    border-color: var(--phoenix-brown);
    color: var(--phoenix-paper);
}

/* ---- Gallery section ---- */
.gallery-section {
    padding: clamp(3rem, 6vw, 5.5rem) 0 clamp(4rem, 8vw, 7rem);
    background: var(--phoenix-ink);
}

/* ---- Masonry-style CSS grid ---- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 280px;
    gap: 6px;
}

/* Wide item spans 2 cols */
.gallery-item--wide {
    grid-column: span 2;
}

/* Tall item spans 2 rows */
.gallery-item--tall {
    grid-row: span 2;
}

/* ---- Individual item ---- */
.gallery-item {
    position: relative;
    overflow: hidden;
    background: var(--phoenix-brown);
    cursor: pointer;
}
/* Hidden by filter */
.gallery-item.is-hidden {
    display: none;
}

.gallery-item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1);
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: brightness(0.88);
}
.gallery-item:hover img {
    transform: scale(1.06);
    filter: brightness(0.72);
}

/* Overlay */
.gallery-item-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.4rem 1.2rem 1.2rem;
    background: linear-gradient(to top, rgba(30, 17, 7, 0.78) 0%, rgba(30, 17, 7, 0.12) 55%, transparent 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
}
.gallery-item:hover .gallery-item-overlay,
.gallery-item:focus-within .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-meta {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.gallery-item-label {
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--phoenix-gold);
}
.gallery-item-title {
    font-family: "Cinzel", Georgia, serif;
    font-size: clamp(.75rem, 1.2vw, 1rem);
    font-weight: 600;
    color: var(--phoenix-paper);
    line-height: 1.25;
}

/* Zoom button */
.gallery-zoom-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(247, 241, 232, 0.4);
    border-radius: 50%;
    background: rgba(30, 17, 7, 0.5);
    color: var(--phoenix-paper);
    font-size: .75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, border-color .2s ease;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
}
.gallery-item:hover .gallery-zoom-btn,
.gallery-item:focus-within .gallery-zoom-btn {
    opacity: 1;
    transform: scale(1);
}
.gallery-zoom-btn:hover {
    background: var(--phoenix-gold);
    border-color: var(--phoenix-gold);
}

/* ---- Gold divider accent between grid sections ---- */
.gallery-grid::before {
    display: none; /* decorative — removed */
}

/* ---- Empty state ---- */
.gallery-empty {
    text-align: center;
    padding: 5rem 1rem;
    color: rgba(247, 241, 232, .35);
}
.gallery-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    color: rgba(198, 149, 52, .3);
}
.gallery-empty p {
    font-size: .9rem;
    letter-spacing: .08em;
}

/* ============================================================
   Lightbox
   ============================================================ */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(12, 6, 1, 0.97);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: lb-in 0.22s ease;
}
.gallery-lightbox[hidden] {
    display: none !important;
}
@keyframes lb-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-stage {
    position: relative;
    max-width: min(92vw, 1100px);
    max-height: 82vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.lightbox-img {
    max-width: 100%;
    max-height: 76vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
    animation: lb-img-in 0.3s ease;
}
@keyframes lb-img-in {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.lightbox-caption {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: 1.1rem;
}
.lightbox-label {
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--phoenix-gold);
}
.lightbox-label:empty {
    display: none;
}
.lightbox-title {
    font-family: "Cinzel", Georgia, serif;
    font-size: .92rem;
    color: var(--phoenix-paper);
}

/* Lightbox controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    border: 1px solid rgba(247, 241, 232, .2);
    border-radius: 50%;
    background: rgba(30, 17, 7, .65);
    color: var(--phoenix-paper);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
    backdrop-filter: blur(6px);
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--phoenix-brown);
    border-color: var(--phoenix-gold);
    transform: scale(1.08);
}

.lightbox-close {
    top: 1.25rem;
    right: 1.25rem;
    width: 44px;
    height: 44px;
}
.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
}
.lightbox-prev { left: 1.25rem; }
.lightbox-next { right: 1.25rem; }
.lightbox-prev:hover,
.lightbox-next:hover { transform: translateY(-50%) scale(1.08); }

.lightbox-counter {
    position: fixed;
    bottom: 1.4rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .12em;
    color: rgba(247, 241, 232, .45);
    text-transform: uppercase;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 991.98px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 240px;
    }
    .gallery-item--wide { grid-column: span 2; }
    .gallery-item--tall { grid-row: span 1; }
}

@media (max-width: 575.98px) {
    .gallery-filters-wrap { top: 72px; }

    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 240px;
        gap: 4px;
    }
    .gallery-item--wide,
    .gallery-item--tall {
        grid-column: span 1;
        grid-row: span 1;
    }

    .lightbox-prev { left: .5rem; }
    .lightbox-next { right: .5rem; }
    .lightbox-prev,
    .lightbox-next { width: 40px; height: 40px; }
}

