html, body, main {
    overflow-x: clip;
    overscroll-behavior-x: none;
}

/* ── Scroll-snap photo viewer ─────────────────────────────── */

:root {
    --bleed-height: 80px;
    --min-title-space: 0px;
}

@media (max-width: 1023px) {
    :root {
        --bleed-height: 16px;
        --min-title-space: 4rem;
    }
}

.photo-scroll-container {
    scroll-snap-type: y mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.photo-scroll-container::-webkit-scrollbar {
    display: none;
}

.photo-slide {
    height: 100%;
    min-height: 100%;
    scroll-snap-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--bleed-height) 0.5rem;
    box-sizing: border-box;
    container-type: size;
}

.photo-slide-first {
    position: relative;
}

.gallery-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--bleed-height) + (100cqh - min(90cqw, 90cqh, calc(100cqh - 2 * var(--bleed-height) - 2 * var(--min-title-space)))) / 2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.75rem;
    text-align: center;
    pointer-events: none;
}

.photo-frame {
    --frame-size: min(90cqw, 90cqh, calc(100cqh - 2 * var(--bleed-height) - 2 * var(--min-title-space)));
    width: var(--frame-size);
    height: var(--frame-size);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 1024px) {
    .photo-frame {
        --frame-size: min(75cqw, 75cqh, calc(100cqh - 2 * var(--bleed-height) - 2 * var(--min-title-space)));
    }

    .photo-slide {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .gallery-title {
        font-size: 2rem;
        height: calc(var(--bleed-height) + (100cqh - min(75cqw, 75cqh, calc(100cqh - 2 * var(--bleed-height) - 2 * var(--min-title-space)))) / 2);
    }
}

.photo-frame img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* ── Lightbox ────────────────────────────────────────────── */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.lightbox-overlay.hidden {
    display: none;
}

.lightbox-img {
    max-height: 95vh;
    max-width: 95vw;
    object-fit: contain;
}

.photo-frame img {
    cursor: pointer;
}

/* ── Hide scrollbar utility ──────────────────────────────── */

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* ── Dot navigation ──────────────────────────────────────── */

#dot-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 6px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: #d1d5db;
    cursor: pointer;
    transition:
        height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.3s ease;
}

.dot:hover {
    background: #9ca3af;
}

.dot.active {
    height: 24px;
    border-radius: 3px;
}

/* ── Mobile drawer ───────────────────────────────────────── */

.mobile-content {
    height: 100%;
}

@media (max-width: 1023px) {
    .mobile-drawer {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 16rem;
        z-index: 1;
        background: #f5f5f5;
        padding: 2rem;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    .mobile-content {
        position: relative;
        z-index: 2;
        background: white;
        transition: transform 300ms ease, box-shadow 300ms ease;
    }

    .mobile-content.dragging {
        transition: none;
    }

    .mobile-content.drawer-open {
        transform: translateX(16rem);
        box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    }
}
