/* flipbook.css */

.mini-flip-container {
    width: 100%;
    max-width: 100%; /* Garde la taille que tu aimes sur desktop */
    margin: 30px auto 50px;
    position: relative;
    perspective: 2000px;
}

/* Le conteneur de pages devient proportionnel */
.mini-flip-pages {
    width: 100%;
    min-height: 300px;
    /* Ratio A4 environ (1.41) : Hauteur = Largeur * 1.4 */
    /* On utilise aspect-ratio pour que la hauteur s'adapte à la largeur */
    aspect-ratio: 1 / 1.4; 
    position: relative;
    transform-style: preserve-3d;
    background: #CD7925;
    color: #fff;
    font-family: "sonar-sans", Sans-serif;
    font-size: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Fallback pour les vieux navigateurs qui ne gèrent pas aspect-ratio */
@supports not (aspect-ratio: 1/1.4) {
    .mini-flip-pages {
        height: 420px;
    }
}

.mini-page {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
    transform-origin: left center;
    background: #fff;
    z-index: 1;
    overflow: hidden; /* Évite que le canvas dépasse */
}

.mini-page canvas {
    width: 100% !important;
    height: 100% !important;
    /* On change 'cover' par 'contain' pour ne JAMAIS couper le PDF */
    /* object-fit: contain;  */
    background:#FFF7EF ;
    display: block;
}

.mini-page.flipped {
    transform: rotateY(-180deg);
}

/* NAVIGATION RESPONSIVE */
.nav-side {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 25zzpx;
    height: auto;
    cursor: pointer;
    z-index: 200;
    transition: all 0.2s ease;
}

.nav-side:hover {
    transform: translateY(-50%) scale(1.1);
}

.btn-prev { left: 5px; } /* On l'écarte un peu pour pas qu'il cache le texte */
.btn-next { right: 5px; }

.btn-fullscreen {
    position: absolute;
    bottom: -30px; /* Un peu plus bas pour laisser respirer */
    left: 50%;
    transform: translateX(-50%);
    width: 55px;
    height: auto;
    z-index: 210;
    transition: transform 0.2s;
}

.btn-fullscreen:hover {
    transform: translateX(-50%) scale(1.1);
}

.btn-fullscreen img {
    width: 100%;
    height: auto;
    display: block;
}

/* AJUSTEMENTS POUR TABLETTES ET MOBILES */
@media (max-width: 1024px) {
    .mini-flip-container {
        width: 260px; /* On réduit un peu la largeur globale */
    }
    
}

@media (max-width: 767px) {
    .mini-flip-container {
        width: 80%; /* Prend plus de place sur mobile */
    }
    .mini-flip-pages{
        min-height: 420px;
    }
}