/* ── Gallery hero ─────────────────────────────────────────── */
.gallery-hero {
    background-color: var(--bg-base);
    padding: 80px 0 40px;
}

.gallery-filters {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
    margin-bottom: -4px;
    scroll-snap-type: x mandatory;
}
.gallery-filters::-webkit-scrollbar { display: none; }

.gallery-filter {
    background: transparent;
    border: 1px solid rgba(190, 170, 120, 0.25);
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 18px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-radius: 2px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
    scroll-snap-align: start;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

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

.gallery-filter.is-active {
    color: white;
    border-color: var(--copper);
    background-color: rgba(190, 170, 120, 0.08);
}

.gallery-filter-count {
    font-size: 0.7rem;
    color: var(--copper);
    font-weight: 400;
    letter-spacing: 0.08em;
}

/* ── Gallery grid ─────────────────────────────────────────── */
.gallery-section {
    background-color: var(--bg-base);
    padding: 0 0 96px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 360px;
    gap: 12px;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        grid-auto-rows: 260px;
        gap: 8px;
    }
    .gallery-hero { padding: 56px 0 32px; }
    .gallery-hero h1 { font-size: 2.2rem !important; }
}

.gallery-tile {
    position: relative;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    display: block;
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease, border-color 0.3s ease;
}

.gallery-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.gallery-tile:hover {
    border-color: rgba(190, 170, 120, 0.4);
}

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

.gallery-tile:focus-visible {
    outline: 2px solid var(--copper);
    outline-offset: 2px;
}

.gallery-tile-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 24px 20px 16px;
    font-size: 0.78rem;
    color: white;
    letter-spacing: 0.06em;
    text-align: left;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-tile:hover .gallery-tile-caption,
.gallery-tile:focus-visible .gallery-tile-caption {
    opacity: 1;
}

@media (hover: none) {
    .gallery-tile-caption { opacity: 1; }
}

.gallery-empty {
    text-align: center;
    color: var(--copper);
    font-style: italic;
    padding: 80px 0;
    margin: 0;
}

/* ── Lightbox modal overrides ─────────────────────────────── */
.gallery-modal .modal-content {
    background-color: rgba(8, 8, 10, 0.97);
    border: none;
    border-radius: 0;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    position: relative;
}

.gallery-modal .modal-dialog {
    margin: 0;
}

.gallery-modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: color 0.2s ease;
}

.gallery-modal-close:hover { color: var(--copper); }
.gallery-modal-close:focus-visible {
    outline: 1px solid var(--copper);
    outline-offset: 4px;
}

.gallery-modal-counter {
    position: absolute;
    top: 28px;
    left: 32px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.16em;
    z-index: 10;
}

.gallery-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.gallery-modal-nav:hover {
    background: rgba(190, 170, 120, 0.15);
    color: var(--copper);
    border-color: var(--copper);
}

.gallery-modal-nav:focus-visible {
    outline: 1px solid var(--copper);
    outline-offset: 4px;
}

.gallery-modal-prev { left: 24px; }
.gallery-modal-next { right: 24px; }

@media (max-width: 768px) {
    .gallery-modal-nav { display: none; }
    .gallery-modal-counter { top: 16px; left: 16px; font-size: 0.7rem; }
    .gallery-modal-close { top: 12px; right: 12px; }
}

.gallery-modal-stage {
    width: 100%;
    height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px 0;
    overflow: hidden;
}

@media (max-width: 768px) {
    .gallery-modal-stage { padding: 40px 12px 0; height: calc(100vh - 100px); }
}

.gallery-modal-stage img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    transition: opacity 0.25s ease;
}

.gallery-modal-stage.is-loading img { opacity: 0.4; }

.gallery-modal-caption {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    max-width: min(80ch, 90vw);
    text-align: center;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.04em;
    margin: 0;
    padding: 0 16px;
}

.gallery-modal-caption:empty { display: none; }

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .gallery-tile,
    .gallery-tile img,
    .gallery-tile-caption,
    .gallery-filter,
    .gallery-modal-nav,
    .gallery-modal-close,
    .gallery-modal-stage img {
        transition: none;
    }
    .gallery-tile:hover img { transform: none; }
    .modal.fade .modal-dialog,
    .modal.fade { transition: none; }
}
