.collection-title {
    display: flex;
    width: 100%;
    align-self: center;
    justify-content: center;
    transition: opacity 0.6s ease;
}

.collection-prev,
.collection-next,
.read-story {
    opacity: 1;
    transition: opacity 0.6s ease;
    transition-delay: 0s;
}

.collection-nav.bottom .collection-prev,
.collection-nav.bottom .collection-next,
.collection-nav.bottom .read-story {
    transition-delay: 0.15s;
}

body.js-hidden .collection-title,
body.js-hidden .collection-prev,
body.js-hidden .collection-next,
body.js-hidden .read-story {
    opacity: 0;
}

.collection-nav {
    display: flex;
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    z-index: 4;
    padding: 1rem 2vh;
}

.collection-prev,
.collection-next,
.read-story {
    cursor: pointer;
}

.collection-prev {
    padding-right: 1.5rem;
}

.collection-next {
    padding-left: 1.5rem;
}

.collection-nav.top {
    border-top: 1px solid black;
}

.collection-nav.bottom {
    border-bottom: 1px solid black;
}

/*-------------- expandable description --------------*/
.collection-desc {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: left;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    padding: 0;
    font-size: 14px;
    transition: 
        max-height 0.5s ease,
        margin 0.5s ease,
        padding 0.5s ease,
        opacity 0.5s ease;
}

.collection-desc.show {
    margin-bottom: 4rem;
    opacity: 1;
    margin-top: 1rem;
    padding: 0.5rem 0;
}

/* scrollable image strip */
.scroll-container {
    width: 100%;
    height: 50%;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    align-self: flex-start;
    z-index: 2;

    cursor: grab; /* visual feedback for draggable container */
    user-select: none;
    -webkit-tap-highlight-color: transparent;

    background-color: black;
    padding: 1rem 0;
}

.scroll-container img {
    display: block; /* prevent inline gaps */
    height: 100%;
    pointer-events: auto;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.gallery-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    color: #fff;
    font-size: 14px;
    text-align: center;
    z-index: 3;
    pointer-events: none;
    opacity: 1;
}

.gallery-lightbox-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
}

.gallery-lightbox-image {
    max-width: 75%;
    max-height: 75%;
    cursor: zoom-out;
    user-select: none;
    -webkit-user-select: none;
}

/*-------------- desktop collection page scrolling/expanding --------------*/
@media screen and (min-width: 1025px) {
    body.collection-expanded {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    html.collection-expanded {
        overflow-y: auto;
    }

    body.collection-expanded::-webkit-scrollbar {
        width: 0;
        height: 0;
        display: none;
    }

    body.collection-expanded .header,
    body.collection-expanded .footer {
        position: relative;
        top: auto;
        bottom: auto;
        z-index: auto;
    }

    body.collection-expanded .main {
        flex: 1;
        height: auto;
        min-height: 0;
        align-items: flex-start;
        padding-top: 0;
        padding-bottom: 0;
    }

    body.collection-expanded .collection-content {
        height: auto;
        min-height: 0;
        margin-top: 1.5rem;
        padding-bottom: 1.5rem;
        transform: translateY(0);
    }

    body.collection-expanded .collection-desc.show {
        margin-bottom: 1rem;
    }

    .scroll-container {
        height: 30vh;
        flex-shrink: 0;
    }
}

/*-------------- tablet styles (≤1024px) --------------*/
@media screen and (max-width: 1024px) {
    .scroll-container {
        height: 30vh; /* smaller on mobile for better space usage */
    }

    .collection-desc.show {
        padding: 0.5rem 1rem;
    }
}

/*-------------- mobile styles (≤767px) --------------*/
@media screen and (max-width: 767px) {
    .collection-content {
        min-height: calc(100dvh - 11rem);
        justify-content: center;
    }

    .collection-desc {
        max-width: 300px; 
    }
}