/*
 * Phase 20 Homepage Layout
 * Consolidated hero and Rare & Notable Editions layout.
 */

/* HERO
   Do not size the banner according to viewport height.
*/
.hero.phase15-hero {
    width: 100%;
    min-height: 380px !important;
    height: auto !important;
    padding:
        58px
        clamp(24px, 7vw, 110px) !important;

    display: flex;
    align-items: center;
}

.hero.phase15-hero > div {
    width: 100%;
    max-width: 760px;
}

.hero.phase15-hero h1 {
    margin-top: 0;
}

@media (max-width: 700px) {
    .hero.phase15-hero {
        min-height: 340px !important;
        padding:
            44px
            22px !important;
    }
}


/* RARE AND NOTABLE EDITIONS
   Full-bleed section across the browser width.
*/
.collection-showcase {
    box-sizing: border-box;

    width: 100vw !important;
    max-width: none !important;

    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;

    padding:
        48px
        clamp(24px, 5vw, 72px) !important;

    overflow: hidden;
}


/* Section heading */
.collection-showcase-heading {
    width: 100%;
    max-width: none;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 24px;
    margin: 0 0 24px;
}

.collection-showcase-heading h2 {
    margin: 4px 0 0;
}


/* Carousel shell */
.collection-shelf-wrap {
    width: 100%;
    min-width: 0;

    display: grid;
    grid-template-columns:
        46px
        minmax(0, 1fr)
        46px;

    align-items: center;
    gap: 14px;
}


/* Horizontal carousel track */
.collection-shelf {
    display: flex !important;

    width: 100%;
    min-width: 0;

    gap: 22px;

    overflow-x: auto !important;
    overflow-y: hidden;

    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;

    padding:
        8px
        2px
        18px;
}

.collection-shelf::-webkit-scrollbar {
    display: none;
}


/* Individual books */
.shelf-book {
    display: block;

    flex:
        0
        0
        180px !important;

    width: 180px !important;
    min-width: 180px;

    color: inherit;
    text-decoration: none;

    scroll-snap-align: start;
}


/* Fixed visual cover area */
.shelf-cover-stage {
    width: 180px !important;
    height: 270px !important;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 10px;

    overflow: hidden;
}

.shelf-cover-stage img {
    display: block;

    width: 100% !important;
    height: 100% !important;

    max-width: 180px !important;
    max-height: 270px !important;

    object-fit: contain !important;
}

.shelf-book strong {
    display: block;

    line-height: 1.2;
    margin-bottom: 4px;
}

.shelf-book > span {
    display: block;

    color: #6b6459;
    font-size: .78rem;
}


/* Carousel controls */
.shelf-control {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 56px;

    padding: 0;

    border: 1px solid #cfc7b9;
    border-radius: 5px;

    background: #fff;
    color: #0b223b;

    font-size: 30px;
    line-height: 1;

    cursor: pointer;
}

.shelf-control:disabled {
    opacity: .3;
    cursor: default;
}


/* Responsive carousel */
@media (max-width: 700px) {
    .collection-showcase {
        padding:
            36px
            16px !important;
    }

    .collection-showcase-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .collection-shelf-wrap {
        grid-template-columns:
            34px
            minmax(0, 1fr)
            34px;

        gap: 6px;
    }

    .shelf-control {
        width: 32px;
        height: 48px;
    }

    .shelf-book {
        flex-basis: 145px !important;

        width: 145px !important;
        min-width: 145px;
    }

    .shelf-cover-stage {
        width: 145px !important;
        height: 218px !important;
    }

    .shelf-cover-stage img {
        max-width: 145px !important;
        max-height: 218px !important;
    }
}


/* =========================================================
   Phase 20.3 Carousel Layout Correction
   Restore absolute navigation controls with full-width track.
   ========================================================= */

.collection-shelf-wrap {
    position: relative !important;

    display: block !important;

    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;
}


/* The carousel track must consume the full row */
.collection-shelf {
    display: flex !important;

    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;

    box-sizing: border-box;

    overflow-x: auto !important;
    overflow-y: hidden !important;

    padding:
        18px
        58px
        30px !important;

    gap: 22px !important;
}


/* Keep each book at a consistent carousel size */
.shelf-book {
    flex:
        0
        0
        180px !important;

    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
}


/* Navigation arrows float over the left/right edges */
.shelf-control {
    position: absolute !important;

    z-index: 5;

    top: 135px !important;

    width: 46px !important;
    height: 64px !important;

    transform: translateY(-50%) !important;

    display: flex !important;
    align-items: center;
    justify-content: center;

    padding: 0 !important;

    border: 0 !important;
    border-radius: 6px !important;

    background: rgba(7, 21, 34, .92) !important;
    color: #fff !important;

    font-size: 2rem !important;
    line-height: 1 !important;

    cursor: pointer;
}

.shelf-control.previous {
    left: 0 !important;
    right: auto !important;
}

.shelf-control.next {
    right: 0 !important;
    left: auto !important;
}

.shelf-control:disabled {
    opacity: .3;
}


/* Mobile keeps native swipe scrolling */
@media (max-width: 700px) {

    .collection-shelf {
        padding:
            12px
            6px
            24px !important;

        gap: 16px !important;
    }

    .shelf-book {
        flex-basis: 145px !important;

        width: 145px !important;
        min-width: 145px !important;
        max-width: 145px !important;
    }

    .shelf-control {
        display: none !important;
    }
}

/* =========================================================
   Phase 20.4 Full-Width Rare and Notable Editions
   ========================================================= */

#main {
    width: 100% !important;
    max-width: none !important;
}

.collection-showcase {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.collection-showcase-heading {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.collection-shelf-wrap {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.collection-shelf {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

@media (min-width: 701px) {
    .collection-showcase {
        padding-left: 28px !important;
        padding-right: 28px !important;
    }
}
