@import url('https://fonts.googleapis.com/css2?family=Cutive+Mono&family=Special+Elite&display=swap');

/* --- En-tête de page --- */
.page-header {
    height: 40vh;
    min-height: 350px;
    background-image: linear-gradient(rgba(15, 17, 21, 0.85), rgba(15, 17, 21, 1)), url('../images_site/image_3.png');
    background-size: cover;
    background-position: center;
    padding-top: 80px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.small-subtitle {
    font-size: 0.85rem;
    letter-spacing: 2px;
}

/* --- Menu des Chapitres --- */
.wiki-menu .list-group-item {
    background-color: transparent;
    border: 1px solid #1e291e;
    color: #9ca3af;
    font-family: 'Kanit', sans-serif;
    transition: all 0.3s;
}

.wiki-menu .list-group-item:hover, .wiki-menu .list-group-item.active {
    background-color: rgba(70, 50, 30, 0.1);
    color: #d97706;
    border-left: 4px solid #d97706;
}

/* --- Boutons Navigation --- */
.book-btn {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.book-btn:hover:not(:disabled) {
    transform: scale(1.1);
}
.book-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* --- LIVRE 3D --- */
.book {
    position: relative;
    width: 380px;
    height: 530px;
    perspective: 1800px;
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.paper {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform-style: preserve-3d;
    transform-origin: left center;
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.paper.flipped {
    transform: rotateY(-180deg);
}

.front, .back {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    overflow: hidden;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5), 2px 2px 10px rgba(0,0,0,0.6);
}

.front { border-radius: 2px 12px 12px 2px; }
.back { transform: rotateY(180deg); border-radius: 12px 2px 2px 12px; }

/* Classe générique d'arrière-plan pour toutes les images de pages */
.book-face {
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Couvertures */
.cover-page {
    padding: 25px 20px;
}

.cover-page h2 {
    font-family: 'Special Elite', cursive, sans-serif !important;
    color: #e2d7c5 !important;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 1.4rem;
    margin-bottom: 12px;
    word-break: break-word;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.7);
}

.cover-page p {
    font-family: 'Special Elite', cursive, sans-serif !important;
    color: #b5a895 !important;
    font-size: 0.88rem;
    line-height: 1.4;
    margin-top: 5px !important;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
}

.cover-badge {
    background-color: rgba(20, 15, 10, 0.85) !important;
    color: #d97706 !important;
    border: 1px solid #d97706 !important;
    font-family: 'Special Elite', cursive, sans-serif !important;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

/* --- Contenu intérieur des pages --- */
.page-content {
    padding: 30px 25px 40px 25px;
    font-family: 'Cutive Mono', monospace !important;
}

.page-content .title-page {
    border-bottom: 2px dashed rgba(92, 58, 33, 0.5);
    padding-bottom: 5px;
    margin-bottom: 10px;
    font-family: 'Cutive Mono', monospace !important;
    color: #2c1a0e !important;
    font-size: 1.2rem;
    font-weight: bold;
}

.page-content .desc-page {
    font-family: 'Cutive Mono', monospace !important;
    font-size: 0.85rem;
    line-height: 1.35;
    color: #1f140b !important;
    font-weight: 600;
}

.page-number {
    position: absolute;
    bottom: 12px;
    right: 22px;
    font-family: 'Cutive Mono', monospace !important;
    font-weight: bold;
    color: #4a301a;
    font-size: 1rem;
    opacity: 0.85;
}

.back .page-number { left: 22px; right: auto; }

/* Sommaire */
.sommaire-link {
    cursor: pointer;
    border-bottom: 1px dotted transparent;
    transition: 0.2s;
    font-family: 'Cutive Mono', monospace !important;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c1a0e;
}
.sommaire-link:hover {
    color: #d97706 !important;
    border-bottom: 1px dotted #d97706;
}

/* Polarisations / Photos */
.polaroid {
    padding: 4px;
    transform: rotate(-1deg);
    margin: 8px auto;
}
.polaroid img {
    max-height: 110px;
    object-fit: cover;
}

/* Crafts */
.recipe-section h6 {
    font-family: 'Cutive Mono', monospace !important;
}
.recipe-section img {
    max-height: 70px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* --- ADAPTATION RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    #zone-manuel .container {
        padding-left: 0;
        padding-right: 0;
    }

    .book-wrapper {
        min-height: 310px !important;
        overflow: visible !important;
        padding: 0 2px;
    }

    .book {
        width: 160px;
        height: 280px;
        margin: 0 auto;
    }

    /* Couvertures mobile */
    .cover-page {
        padding: 8px 6px !important;
    }
    .cover-page h2 {
        font-size: 0.70rem !important;
        margin-bottom: 4px !important;
        line-height: 1.15;
    }
    .cover-page p {
        font-size: 0.55rem !important;
        line-height: 1.15 !important;
        padding: 0 2px !important;
        margin-top: 2px !important;
    }
    .cover-page .badge {
        font-size: 0.50rem !important;
        padding: 2px 4px !important;
        margin-top: 4px !important;
    }

    /* Pages internes mobile */
    .page-content {
        padding: 8px 6px 14px 6px !important;
    }
    .page-content .title-page {
        font-size: 0.68rem !important;
        margin-bottom: 3px !important;
        padding-bottom: 2px !important;
        line-height: 1.15;
    }
    .page-content .desc-page {
        font-size: 0.56rem !important;
        line-height: 1.15 !important;
        word-break: break-word;
    }

    .sommaire-link {
        font-size: 0.58rem !important;
        margin-bottom: 2px !important;
    }
    .sommaire-link .small {
        font-size: 0.52rem !important;
    }

    .polaroid {
        margin: 3px auto !important;
        padding: 2px !important;
    }
    .polaroid img {
        max-height: 45px !important;
    }

    .recipe-section {
        margin-top: 2px !important;
        padding-top: 2px !important;
    }
    .recipe-section h6 {
        font-size: 0.55rem !important;
    }
    .recipe-section img {
        max-height: 30px !important;
    }

    .page-number {
        font-size: 0.58rem !important;
        bottom: 2px !important;
        right: 6px !important;
    }
    .back .page-number {
        left: 6px !important;
    }

    .book-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
    }

    #prev-btn { left: -6px !important; }
    #next-btn { right: -6px !important; }
}

html {
    scroll-behavior: auto !important;
}

#zone-manuel {
    scroll-margin-top: 40px;
}