/* ============================================
   Lennard O. Asher - Photograph gallery
   ============================================ */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.gallery-hero {
    background-color: var(--navy);
    color: var(--white);
    padding: 8.5rem 0 4rem;
}

.gallery-hero-content {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.gallery-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.25rem;
}

.gallery-hero-eyebrow::before {
    content: '';
    width: 28px;
    height: 1px;
    background-color: var(--red-bright);
}

.gallery-hero h1 {
    font-size: var(--text-2xl);
    color: var(--white);
    margin-bottom: 0.75rem;
}

.gallery-hero p {
    font-size: var(--text-md);
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
    max-width: 620px;
}

/* ========== FILTERS ========== */
.gallery-filters {
    position: sticky;
    top: var(--nav-height, 65px);
    z-index: 100;
    background-color: var(--paper);
    border-bottom: var(--border);
    padding: 1rem 0;
}

.gallery-filters-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    background-color: var(--white);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--body);
    cursor: pointer;
    transition: var(--transition);
}

.filter-tab:hover {
    border-color: var(--navy);
    color: var(--navy);
}

.filter-tab.active {
    background-color: var(--navy);
    border-color: var(--navy);
    color: var(--white);
}

.filter-count {
    margin-left: 0.4rem;
    font-size: var(--text-xs);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
}

.filter-tab.active .filter-count {
    opacity: 0.9;
}

.filter-summary {
    font-size: var(--text-sm);
    color: var(--muted);
}

.filter-summary strong {
    color: var(--navy);
    font-weight: 600;
}

/* ========== PHOTO GRID ========== */
.photo-gallery-section {
    padding: 2.5rem 0 4.5rem;
    background-color: var(--white);
}

.photo-gallery-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.photo-item {
    position: relative;
    margin: 0;
    border: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background-color: var(--paper-deep);
    aspect-ratio: 4 / 3;
}

.photo-item.hidden {
    display: none;
}

.photo-anchor {
    display: block;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
}

.photo-anchor:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: -2px;
}

.photo-anchor img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 200ms ease;
}

.photo-anchor:hover img {
    opacity: 0.9;
}

/* ========== LIGHTBOX OVERRIDES (PhotoSwipe) ========== */
.pswp__bg {
    background-color: rgba(15, 28, 43, 0.97) !important;
}

.pswp__counter {
    font-family: var(--font-body) !important;
    font-size: var(--text-sm) !important;
    font-weight: 500 !important;
}

.pswp__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    background-color: rgba(15, 28, 43, 0.92);
    pointer-events: none;
}

.pswp__caption[hidden] {
    display: none;
}

.pswp__caption__center {
    font-family: var(--font-body) !important;
    max-width: 720px !important;
    margin: 0 auto !important;
    font-size: var(--text-sm) !important;
    line-height: 1.6 !important;
    padding: 1rem 1.25rem 1.25rem !important;
    text-align: center !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.pswp__caption__center strong {
    color: var(--white) !important;
    font-weight: 600 !important;
}

.pswp__button {
    color: var(--white) !important;
}

/* ========== GALLERY CTA ========== */
.gallery-cta-section {
    background-color: var(--navy);
    padding: 3rem 0;
}

.gallery-cta-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.gallery-cta-text h2 {
    font-size: var(--text-lg);
    color: var(--white);
    margin-bottom: 0.4rem;
}

.gallery-cta-text p {
    font-size: var(--text-body);
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.gallery-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

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

@media (max-width: 768px) {
    .gallery-hero {
        padding: 7rem 0 3rem;
    }

    .gallery-filters {
        top: var(--nav-height, 65px);
    }

    .gallery-filters-inner {
        justify-content: flex-start;
    }

    .filter-tab {
        font-size: var(--text-sm);
    }

    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .gallery-cta-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .photo-item {
        aspect-ratio: 1;
    }

    .gallery-cta-actions {
        width: 100%;
    }
}
