/*fond de notre page*/
body {
    margin: 0;
    background: #e9e2d6;
}
/* espace où se trouve le menu*/
.scene {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1200px;
}
/* couverture en cuir noir*/
.couverture {
    position: relative;
    width: min(75vw, 350px);
    aspect-ratio: 0.7;

    background: linear-gradient(
        120deg,
        #111111,
        #303030 55%,
        #171717
    );
    border: 2px solid #191919;
    border-radius: 5px 0px 0px 5px;
    overflow:visible;
    box-shadow: 12px 16px 25px
rgba(0, 0, 0, 0.3),
        inset -6px 0 10px
rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
}
/* texte doré*/
.texte {
    margin-top: 23%;
    text-align: center;
    color: #dfc58e;
    font-family: Georgia, serif;
    width: 100%;
    padding: 0 25px;
    box-sizing: border-box;
}

.texte h1 {
    font-size: clamp(24px, 6vw, 34px);
    font-style: italic;
    font-weight: normal;
    line-height: 1.05;
    margin: 0;
}

.ligne-doree {
    width: 200px;
    height: 1px;
    background: linear-gradient(to right, #b88a44, #efd79e, #b88a44);
    margin: 28px auto 0 auto;
}

.infos {
    margin-top: 34px;
}

.texte p {
    font-size: 18px;
    margin: 10px 0;
    font-weight: 600;
}

/*coins métalliques*/
.coin {
    position:absolute;
    right: 0;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #a47b39, #f1dda5, #b9904c);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 79% 100%, 79% 33%, 71% 22%, 0 22%);
    
}
.coin.haut {
    top: -3px;
    right: -3px;
}
.coin.bas {
    bottom: -3px;
    right: -3px;
    transform: scaleY(-1);
}

/*reliure du menu*/
.recto::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 12px;
    width: 7px;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.65) 0%,
        rgba(0,0,0,0.55) 40%,
        rgba(255, 255, 255, 0.25) 85%,
        transparent 100%
    );
    box-shadow: none;
    border: none;
}

/* structure du livre*/
.livre {
    position: relative;
    width: min(75vw, 350px, 58vh);
    aspect-ratio: 0.7;
}

/* couverture au premier plan*/
.livre .couverture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    z-index: 2;
}

/*animation 3D de la couverture*/
.couverture {
    transform-origin: left center;
    transition: transform 1.2s ease-in-out;
}
.couverture.ouverte {
    transform: rotateY(-170deg);
}

/*positionnement de l'intérieur*/
.scene {
    position: relative;
}

/*page intérieure*/
.interieur {
    position: absolute;
    top: 50%;
    left: calc(50% - 7px);
    transform : translate(-50%, -50%);
    width: calc(min(75vw, 350px) - 14px);
    aspect-ratio: 0.7;
    background: linear-gradient(
        120deg,
        #171717,
        #292929 55%,
        #171717
    );
    border: none;
    border-radius:5px;
    box-sizing: border-box;
    z-index: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: Georgia, serif;
    color: #614b33;
    text-align: center;
}
 
/*garder la couverture devant*/
.couverture {
    z-index: 1;
}
/*permet aux faces de rester en 3d*/
.couverture {
    transform-style: preserve-3d;
}
/*verso de la couverture*/
.verso {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg);
    backface-visibility: hidden;
    background: #202020;
    border: 2px solid #151515;
    border-radius: 5px;
    box-sizing: border-box;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #dfc58e;
    font-family: Georgia, serif;
}
/*la couverture devient le support des 2 faces*/
.couverture {
    background: #202020;
    border: none;
    box-shadow: none;
    overflow: visible;
    transform-style: preserve-3d;
}
/*face extérieure de la couverture*/
.recto {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        #111111,
        #303030 55%,
        #171717
    );
    border: 2px solid #191919;
    border-radius: 5px 0px 0px 5px;
    box-shadow: 12px 16px 25px
rgba(0, 0, 0, 0.3),
        inset -6px 0 10px
rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    backface-visibility: hidden;
    transform: translateZ(0.1px);
}
/*face intérieure de la couverture*/
.verso {
    backface-visibility: hidden;
    transform: rotateY(180deg) translateZ(0.1px); 
}
/*image canva à l'intèreieur du menu*/
.interieur img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.18);
}
/*structure des feuilles*/
.feuille {
    position: absolute;
    top: 50%;
    left: 0;
    width: calc(100% - 14px);
    aspect-ratio: 0.7;
    transform: translateY(-50%);
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform 1.8s ease-in-out; 
}
.feuille.souple {
    animation: soulever-feuille 1.8s ease-in-out;
}
@keyframes soulever-feuille {
    0%, 100% {
        rotate: y 0deg;
    }
    48% {
        rotate: y -4deg;
    }
}
/*ordre des feuilles*/
.feuille-1 {
    z-index: 4;
}
.feuille-2 {
    z-index: 3;
    transition: transform 1.8s ease-in-out, z-index 0s 1.8s;
}
/*faces de chaque feuille*/
.face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 4px;
    overflow: hidden;
    background: #c97a3d;
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.18);
    clip-path: polygon(0 0, 100% 0, 100% 10%, 100% 20%, 100% 30%, 100% 40%, 100% 50%, 100% 60%, 100% 70%, 100% 80%, 100% 90%, 100% 100%, 0 100%, 0 90%, 0 80%, 0 70%, 0 60%, 0 50%, 0 40%, 0 30%, 0 20%, 0 10%);
}
.feuille.souple .face-avant {
    animation: courber-feuille 1.8s ease-in-out;
}
.feuille.souple .face-arriere {
    animation: courber-verso 1.8s ease-in-out;
}
.face::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 0, 0, 0.12) 43%,
        rgba(255, 255, 255, 0.38) 48%,
        rgba(255, 255, 255, 0.12) 52%,
        rgba(0, 0, 0, 0.2) 57%,
        transparent 64%
    );
    background-size: 240% 100%;
    background-position: 0 0;
}
.feuille.souple .face::before {
    animation: reflet-feuille 1.8s ease-in-out;
}
@keyframes courber-feuille {
    0%, 100% {
        clip-path: polygon(0 0, 100% 0, 100% 10%, 100% 20%, 100% 30%, 100% 40%, 100% 50%, 100% 60%, 100% 70%, 100% 80%, 100% 90%, 100% 100%, 0 100%, 0 90%, 0 80%, 0 70%, 0 60%, 0 50%, 0 40%, 0 30%, 0 20%, 0 10%);
    }
    35%, 68% {
        clip-path: polygon(0 0, 100% 0, 99.5% 10%, 98% 20%, 96.5% 30%, 95.5% 40%, 95% 50%, 95.5% 60%, 96.5% 70%, 98% 80%, 99.5% 90%, 100% 100%, 0 100%, 0 90%, 0 80%, 0 70%, 0 60%, 0 50%, 0 40%, 0 30%, 0 20%, 0 10%);
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 99% 10%, 97% 20%, 95% 30%, 94% 40%, 93% 50%, 94% 60%, 95% 70%, 97% 80%, 99% 90%, 100% 100%, 0 100%, 0 90%, 0 80%, 0 70%, 0 60%, 0 50%, 0 40%, 0 30%, 0 20%, 0 10%);
    }
}
@keyframes courber-verso {
    0%, 100% {
        clip-path: polygon(0 0, 100% 0, 100% 10%, 100% 20%, 100% 30%, 100% 40%, 100% 50%, 100% 60%, 100% 70%, 100% 80%, 100% 90%, 100% 100%, 0 100%, 0 90%, 0 80%, 0 70%, 0 60%, 0 50%, 0 40%, 0 30%, 0 20%, 0 10%);
    }
    35%, 68% {
        clip-path: polygon(0 0, 100% 0, 100% 10%, 100% 20%, 100% 30%, 100% 40%, 100% 50%, 100% 60%, 100% 70%, 100% 80%, 100% 90%, 100% 100%, 0 100%, 0.5% 90%, 2% 80%, 3.5% 70%, 4.5% 60%, 5% 50%, 4.5% 40%, 3.5% 30%, 2% 20%, 0.5% 10%);
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 100% 10%, 100% 20%, 100% 30%, 100% 40%, 100% 50%, 100% 60%, 100% 70%, 100% 80%, 100% 90%, 100% 100%, 0 100%, 1% 90%, 3% 80%, 5% 70%, 6% 60%, 7% 50%, 6% 40%, 5% 30%, 3% 20%, 1% 10%);
    }
}
@keyframes reflet-feuille {
    0%, 100% {
        opacity: 0;
        background-position: 0 0;
    }
    25% {
        opacity: 0.22;
        background-position: 25% 0;
    }
    50% {
        opacity: 0.52;
        background-position: 50% 0;
    }
    75% {
        opacity: 0.22;
        background-position: 75% 0;
    }
}
/*images canva*/
.face img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
/*face arrière*/
.face-avant {
    transform: translateZ(0.1px);
}
.face-arriere {
    transform: rotateY(180deg) translateZ(0.1px);
}
/*couverture devant les feuilles*/
.livre .couverture {
    z-index: 10;
    transition: transform 1.2s ease-in-out;
}
/*animation de la première feuille*/
.feuille-1.tournee{
    transform: translateY(-50%) rotateY(-180deg); 
    z-index: 5;
}
/*La couverture ouverte reste derrière les feuilles*/
.livre .couverture.ouverte {
    z-index: 1;
    transition: transform 1.2s ease-in-out, z-index 0s 1.2s;
}
.livre .couverture.fermeture {
    z-index: 10;
    transform: rotateY(0deg);
    transition: transform 1.2s ease-in-out;
}
/*animation de la deuxième feuille*/
.feuille-2.tournee{
    transform: translateY(-50%) rotateY(-180deg); 
    z-index: 6;
    transition: transform 1.8s ease-in-out, z-index 0s;
}
/*Le fond intérieur appartient au livre*/
.livre {
    background: linear-gradient(
        120deg,
        #171717,
        #292929 55%,
        #171717
    );
    border-radius: 5px;
}

/*on masque l'ancien fonc indépendant*/
.interieur {
    background: transparent;
}
/*ombre près de la reliure des feuilles*/
.face-avant::after,
.face-arriere::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 18px;
    pointer-events: none;
    z-index: 10;
}
.face-avant::after {
    left: 0;
    background: linear-gradient( to right,
    rgba(0, 0, 0, 0.30),
    rgba(0, 0, 0, 0.16),
    rgba(0, 0, 0, 0)
    );
}
.face-arriere::after {
    right: 0;
    background: linear-gradient(to left,
    rgba(0, 0, 0, 0.30),
    rgba(0, 0, 0, 0.16),
    rgba(0, 0, 0, 0)
    );
}
/* intérieur de la couverture arrière*/
.fond-final{
    position: absolute;
    inset: 0;
    z-index: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
}
.fond-final .coin {
    visibility: hidden;
}
.livre.fond-final-visible .fond-final .coin {
    visibility: visible;
}
/*textes des couvertures intérieures*/
.texte-interieur{
    width: 80%;
    text-align: center;
    color: #dfc58e;
    font-family: Georgia, serif;
}
.texte-interieur p {
font-size: 22px;
font-style: italic;
line-height: 1.5;
}
/*coins dorés du verso de la couverture*/
.verso .coin{
    left: -3px;
    right: auto;
    clip-path: polygon(0 0, 100% 0, 100% 22%, 29% 22%, 21% 33%, 21% 100%, 0 100%);
}

/* Arrivée du porte-menu */

.scene {
    animation: depot-menu 1.9s ease-out both;
}

@keyframes depot-menu {

    0% {
        transform: translateY(-110vh)
                   rotate(-8deg)
                   scale(1.04);
    }

    65% {
        transform: translateY(4px)
                   rotate(0.3deg)
                   scale(1);
    }

    80% {
        transform: translateY(-2px)
                   rotate(-0.1deg)
                   scale(1);
    }

    92% {
        transform: translateY(1px)
                   rotate(0deg)
                   scale(1);
    }

    100% {
        transform: translateY(0)
                   rotate(0deg)
                   scale(1);
    }
}
/* Adaptation aux téléphones */

@media (max-width: 600px) {

    /* Dimensions du livret */

    .livre {
        width: min(42vw, 58vh);
        transition: translate 1.2s ease-in-out;
    }

    /* Centrage lorsque le livre s'ouvre */

    .scene:has(.couverture.ouverte) .livre {
        translate: 50% 0;
    }

    /* Zone de texte */

    .couverture .texte {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0 8px;
        text-align: center;
    }

    /* Titre */

    .couverture .texte h1 {
        font-size: clamp(12px, 3.7vw, 17px);
        line-height: 1.1;
        margin: 0;
    }

    /* Ligne dorée */

    .couverture .ligne-doree {
        width: 75%;
        max-width: none;
        margin: 16px auto 0;
    }

    /* Édition et saison */

    .couverture .infos {
        margin-top: 16px;
    }

    .couverture .texte p {
        font-size: clamp(9px, 2.6vw, 12px);
        margin: 5px 0;
        white-space: nowrap;
    }

    /* Textes intérieurs */

    .texte-interieur p {
        font-size: clamp(9px, 2.6vw, 14px);
        line-height: 1.35;
    }

}

@media (max-width: 1000px) and (max-height: 600px) {
    .livre {
        transition: translate 1.2s ease-in-out;
    }

    .scene:has(.couverture.ouverte) .livre {
        translate: 50% 0;
    }
}

/* Ajustement des coins arrière sur mobile */

.fond-final .coin {
    translate: -2px 0;
}

.fond-final .coin.haut {
    translate: -2px 2px;
}

.fond-final .coin.bas {
    translate: -2px -3px;
}

/* Zoom tactile des images Canva */
.zoom-image {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    touch-action: none;
    transition: opacity 450ms ease;
}

.zoom-image.ouvert {
    display: flex;
}

.zoom-image.visible {
    opacity: 1;
}

.zoom-image-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: top left;
    transition: transform 450ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.zoom-image-contenu {
    display: block;
    max-width: 94vw;
    max-height: 84vh;
    width: auto;
    height: auto;
    object-fit: contain;
    transform-origin: center;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
}

.face img {
    touch-action: manipulation;
}

.zoom-fermer {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    z-index: 1;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font: 32px/1 Arial, sans-serif;
}

/* Ajustements mobiles de la couverture */

@media (max-width: 600px) {

    .recto .texte h1 {
        font-size: clamp(11px, 3vw, 13px) !important;
        line-height: 1.15;
        white-space: normal;
    }

   
.couverture .coin,
.fond-final .coin {
    width: 16px !important;
    height: 16px !important;
}

}
/* supprimer les borduresdes faces sur mobile*/
@media (max-width: 600px) {
    .couverture .recto,
    .couverture .verso {
        border: none !important;
        outline: none !important;
    }
}
