/* ══════════════════════════════════════════════════════════════
   Custom Shower Glass Doors — Gallery Page Styles
   Page-specific rules only. All tokens via navy.css + styles.css.
   ══════════════════════════════════════════════════════════════ */

/* ── GALLERY FILTER BAR ─────────────────────────────────────── */

.gallery-filter-bar {
    background: var(--brand-bg);
    border-bottom: 1px solid var(--brand-divider);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.gallery-filter-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.625rem 1rem;
}

.gallery-filter-label {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 0;
    white-space: nowrap;
}

.gallery-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
}

.gallery-pill {
    background: transparent;
    color: var(--brand-text-muted);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-full);
    padding: 0.375rem 1rem;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    white-space: nowrap;
    line-height: 1.4;
}

.gallery-pill:hover {
    background: var(--brand-glass);
    color: var(--brand-primary);
    border-color: var(--brand-glass-deep);
}

.gallery-pill.active {
    background: var(--brand-primary);
    color: var(--brand-text-light);
    border-color: var(--brand-primary);
}

.gallery-filter-count {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    color: var(--brand-text-muted);
    margin: 0;
    white-space: nowrap;
    margin-left: auto;
}

/* ── LEAD STRIP ─────────────────────────────────────────────── */

.gallery-lead-section {
    background: var(--brand-bg-alt);
    border-bottom: 1px solid var(--brand-divider);
    padding: 2.5rem 0;
}

.gallery-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 3rem;
    margin-top: 1.5rem;
}

.gallery-stat {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.gallery-stat-number {
    font-family: var(--font-heading);
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--brand-primary);
    line-height: 1;
}

.gallery-stat-label {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    color: var(--brand-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

/* ── MASONRY GRID ───────────────────────────────────────────── */

.gallery-grid-section {
    padding: 3rem 0 var(--section-py);
    overflow:hidden;
}

/* Isotope container */
.gallery-grid {
    margin: 0 -6px;       /* compensate gutter half-width */
}

/* Sizing helpers for Packery */
.grid-sizer,
.gallery-item {
    width: calc(33.333% - 12px);   /* 3 columns, minus gutter */
    margin: 6px;
}

.gutter-sizer {
    width: 12px;
}

/* Landscape items stay in a single column (uniform 3-up grid) */
.gallery-item--wide {
    width: calc(33.333% - 12px);
}

/* ── GALLERY ITEM FIGURE ─────────────────────────────────────── */

.gallery-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-slow), transform var(--transition-slow);
    display: block;         /* figure is block; img fills it */
}

.gallery-item:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px);
}

.gallery-item:focus-visible {
    outline: 3px solid var(--brand-accent);
    outline-offset: 2px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
    border-radius: var(--radius-lg);
}

.gallery-item:hover img {
    transform: scale(1.04);
}

/* Hover overlay */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: var(--brand-bg-overlay);
    border-radius: var(--radius-lg);
    opacity: 0;
    transition: opacity var(--transition-slow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem;
    text-align: center;
}

.gallery-item:hover .gallery-overlay,
.gallery-item:focus-visible .gallery-overlay {
    opacity: 1;
}

.gallery-overlay-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.gallery-item:hover .gallery-overlay-icon {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.75);
}

.gallery-overlay-icon i {
    font-size: 1.125rem;
    color: #fff;
}

.gallery-overlay-type {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand-accent-light);
}

.gallery-overlay-caption {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.85);
    line-height: 1.4;
}

/* ── ISOTOPE ANIMATION STATES ──────────────────────────────── */

.gallery-item.is-hidden {
    display: none;
}

/* ── GALLERY LOADING STATE ───────────────────────────────────── */

.gallery-grid-loading {
    text-align: center;
    padding: 3rem 0;
    color: var(--brand-text-muted);
    font-family: var(--font-body);
}

/* ── LIGHTBOX ────────────────────────────────────────────────── */

.lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 40, 0.94);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.lightbox-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.lightbox-inner {
    position: relative;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 32px 64px rgba(0,0,0,0.5);
    display: block;
}

.lightbox-caption {
    margin-top: 1rem;
    text-align: center;
}

.lightbox-caption-type {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand-accent-light);
    margin-bottom: 0.25rem;
}

.lightbox-caption-text {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.8);
}

.lightbox-close {
    position: absolute;
    top: -3rem;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

.lightbox-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
    z-index: 2001;
}

.lightbox-nav-btn:hover { background: rgba(255,255,255,0.18); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */

/* 2 columns at tablet */
@media (max-width: 991.98px) {
    .grid-sizer,
    .gallery-item,
    .gallery-item--wide {
        width: calc(50% - 12px);
    }

    .gallery-stats-row {
        gap: 1rem 2rem;
    }
}

/* 2 columns on mobile */
@media (max-width: 575.98px) {
    .grid-sizer,
    .gallery-item {
        width: calc(50% - 8px);
    }

    .gallery-item--wide {
        width: calc(100% - 8px);
    }

    .gutter-sizer { width: 8px; }

    .gallery-grid { margin: 0 -4px; }

    .gallery-filter-bar { position: static; }

    .lightbox-nav-btn { width: 38px; height: 38px; font-size: 0.875rem; }
    .lightbox-prev { left: 0.25rem; }
    .lightbox-next { right: 0.25rem; }
}
