/* Past editions — stage + thumbs + lightbox */
.heritage-gallery__title {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.heritage-gallery__counter-badge {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--oya-brand-light, #fef2f2);
    color: var(--oya-brand-dark, #7f1d1d);
    white-space: nowrap;
}

html.night-mode .heritage-gallery__counter-badge {
    background: var(--oya-brand-light);
    color: #fecaca;
}

.heritage-gallery__stage {
    position: relative;
    margin-top: 1rem;
    border-radius: var(--oya-radius-lg, 16px);
    overflow: hidden;
    background: #0a0a0a;
    box-shadow: var(--oya-shadow-lg);
    aspect-ratio: 16 / 10;
    max-height: min(72vh, 520px);
}

.heritage-gallery__viewport {
    position: absolute;
    inset: 0;
    outline: none;
}

.heritage-gallery__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.45s;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
}

.heritage-gallery__slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.heritage-gallery__image,
.heritage-gallery__video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
}

.heritage-gallery__video-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.heritage-gallery__video-label {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    pointer-events: none;
    z-index: 2;
}

.heritage-gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--oya-ink, #0a0a0a);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.heritage-gallery__nav:hover {
    transform: translateY(-50%) scale(1.06);
    background: #fff;
    color: var(--oya-brand, #991b1b);
}

.heritage-gallery__nav--prev {
    left: 0.75rem;
}

.heritage-gallery__nav--next {
    right: 0.75rem;
}

.heritage-gallery__expand {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    z-index: 5;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 0.2s ease, transform 0.2s ease;
}

.heritage-gallery__expand:hover {
    background: var(--oya-brand, #991b1b);
    transform: scale(1.05);
}

.heritage-gallery__thumbs-wrap {
    margin-top: 0.85rem;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
}

.heritage-gallery__thumbs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.25rem 0.25rem 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--oya-brand-muted, #b45353) transparent;
}

.heritage-gallery__thumbs::-webkit-scrollbar {
    height: 6px;
}

.heritage-gallery__thumbs::-webkit-scrollbar-thumb {
    background: var(--oya-brand-muted, #b45353);
    border-radius: 3px;
}

.heritage-gallery__thumb {
    flex: 0 0 auto;
    width: 5.5rem;
    height: 3.5rem;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: var(--oya-border, #e8e4df);
    scroll-snap-align: start;
    position: relative;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.heritage-gallery__thumb img,
.heritage-gallery__thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.heritage-gallery__thumb.is-active {
    border-color: var(--oya-brand, #991b1b);
    box-shadow: 0 0 0 1px var(--oya-brand, #991b1b);
    transform: translateY(-2px);
}

.heritage-gallery__thumb-video-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 1;
}

/* Lightbox */
.heritage-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.heritage-lightbox[hidden] {
    display: none !important;
}

.heritage-lightbox:not([hidden]) {
    animation: heritageLbIn 0.28s ease;
}

@keyframes heritageLbIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.heritage-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

.heritage-lightbox__dialog {
    position: relative;
    z-index: 1;
    width: min(96vw, 1200px);
    height: min(88vh, 800px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.heritage-lightbox__content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.heritage-lightbox__content img,
.heritage-lightbox__content video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.heritage-lightbox__close {
    position: absolute;
    top: -2.75rem;
    right: 0;
    z-index: 3;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    font-size: 1.25rem;
    transition: background 0.2s ease;
}

.heritage-lightbox__close:hover {
    background: var(--oya-brand, #991b1b);
}

.heritage-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 3rem;
    height: 3rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.heritage-lightbox__nav:hover {
    background: var(--oya-brand, #991b1b);
    transform: translateY(-50%) scale(1.05);
}

.heritage-lightbox__nav--prev {
    left: -3.5rem;
}

.heritage-lightbox__nav--next {
    right: -3.5rem;
}

.heritage-lightbox__counter {
    position: absolute;
    bottom: -2.25rem;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.875rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .heritage-gallery__stage {
        aspect-ratio: 4 / 3;
        max-height: 55vh;
    }

    .heritage-gallery__nav {
        width: 2.25rem;
        height: 2.25rem;
    }

    .heritage-gallery__nav--prev {
        left: 0.5rem;
    }

    .heritage-gallery__nav--next {
        right: 0.5rem;
    }

    .heritage-gallery__thumb {
        width: 4.5rem;
        height: 3rem;
    }

    .heritage-lightbox__nav--prev {
        left: 0.25rem;
    }

    .heritage-lightbox__nav--next {
        right: 0.25rem;
    }

    .heritage-lightbox__close {
        top: 0.5rem;
        right: 0.5rem;
        background: rgba(0, 0, 0, 0.5);
    }

    .heritage-lightbox__counter {
        bottom: 0.75rem;
    }
}
