/* Bookshelf Desktop/Tablet Styles - Pour écrans > 768px */
@media (min-width: 769px) {
    .bookshelf-section {
        position: relative;
        min-height: 320px; /* Valeur par défaut, remplacée par media queries */
        display: flex;
        align-items: flex-end;
        justify-content: center;
    }

    .bookshelf-wrapper {
        display: flex;
        align-items: flex-end;
        justify-content: center;
        min-height: 265px; /* Valeur par défaut, remplacée par media queries */
        position: relative;
        width: 100%;
    }

    /* Base styles for books (shared, sans animations) */
    .books {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 5%;
        width: 90%;
        margin: auto;
        transform: translateY(-100%);
        padding: 0 0 2px;
        z-index: 1;
        position: relative;
        top: 10px;
        justify-content: center; /* Centrage pour <4 livres */
    }

    .book {
        width: 100%;
        border-radius: 3px 0.5px 0.5px 3px;
        aspect-ratio: 115 / 180;
        position: relative;
        background: #ddd; /* Fallback */
        cursor: pointer;
    }

    /* Styles statiques pour livres (sans hover/transition) */
    .book::before,
    .book::after {
        position: absolute;
        width: 100%;
        display: block;
        content: " ";
        background: var(--bg-image, #ccc) center center/cover no-repeat, #f3f3f3;
    }

    .book::before {
        height: 100%;
        box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.25),
            inset 2px 0px 2px 1px rgba(29, 27, 27, 0.2);
    }

    .book::after {
        height: 102%;
        filter: blur(10px);
        z-index: -1;
        opacity: 1;
    }

    /* Varnished Wood Shelf */
    .bookshelf {
        max-width: 1500px;
        width: 90%;
        display: flex;
        justify-content: center;
        flex-shrink: 0;
        z-index: 0;
        position: relative;
        height: 0px;
        box-sizing: border-box;
        border-bottom: 20px solid #D2B48C; /* Base wood color for thickness */
        border-left: 25px solid transparent;
        border-right: 25px solid transparent;
        background-image: 
            linear-gradient(to bottom, rgba(210, 180, 140, 0.3) 0%, transparent 100%),
            url('../images/decorations/Light_wood_texture.jpg'); 

        background-size: 200% 100%, cover;
        background-repeat: repeat-x, repeat-x;
        background-position: center bottom;
        pointer-events: all;
    }

    .bookshelf::before {
        content: "";
        position: absolute;
        top: 20px;
        background: 
            linear-gradient(90deg, #F5F5DC 0%, #FAF0E6 50%, #F5F5DC 100%),
            url('../images/decorations/Light_wood_texture.jpg'); 

        background-blend-mode: multiply;
        background-size: 100% 100%, cover;
        background-repeat: no-repeat, repeat-x;
        background-position: center, center;
        height: 28px;
        width: calc(100% + 50px);
        box-shadow: 
            inset 0 0 20px rgba(255, 255, 255, 0.4), /* Varnish shine */
            inset -5px 0 10px rgba(0, 0, 0, 0.1), /* Depth */
            0px -1px 4px rgba(0, 0, 0, 0.05),
            0px 3px 12px rgba(0, 0, 0, 0.1);
        z-index: 2;
    }

    .bookshelf::after {
        content: "";
        height: 35px;
        width: calc(100% + 50px);
        position: absolute;
        top: 48px;
        display: block;
        background: linear-gradient(
            180deg,
            #f3f3f3 0%,
            rgba(255, 255, 255, 0) 100%
        );
        clip-path: polygon(0% 0%, 100% 0%, 97% 100%, 3% 100%);
        z-index: -1;
    }
}

/* Règles granulaires pour .bookshelf-section et .bookshelf-wrapper */
@media (min-width: 780px) and (max-width: 991px) {
    .bookshelf-section {
        min-height: 270px;
    }
    .bookshelf-wrapper {
        min-height: 215px;
    }
}

@media (min-width: 991px) and (max-width: 1200px) {
    .bookshelf-section {
        min-height: 305px;
    }
    .bookshelf-wrapper {
        min-height: 245px;
    }
}

@media (min-width: 1200px) and (max-width: 1400px) {
    .bookshelf-section {
        min-height: 370px;
    }
    .bookshelf-wrapper {
        min-height: 315px;
    }
}


@media (min-width: 1400px) {
    .bookshelf-section {
        min-height: 400px;
    }
    .bookshelf-wrapper {
        min-height: 345px;
    }
}
