/* Explain: Styles for the interactive club booklet, including page flip effects. */
/* ============================================================
   Livret feuilletable — CPCR 66
   Sur ordinateur : livre ouvert, deux pages côte à côte.
   Sur téléphone : une seule page à la fois, très légère.
   ============================================================ */

.livret-book {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 1080px;
    margin: 2.5rem auto 0;
}

.livret-book-viewport {
    perspective: 2600px;
    perspective-origin: 50% 50%;
}

.livret-book-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1.414 / 1;
    transform-style: preserve-3d;
}

.livret-book.is-single {
    max-width: 460px;
}

.livret-book.is-single .livret-book-stage {
    aspect-ratio: 0.707 / 1;
}

.livret-leaf {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform 900ms cubic-bezier(0.42, 0, 0.28, 1);
    will-change: transform;
}

.livret-book.is-single .livret-leaf {
    width: 100%;
}

.livret-leaf.is-flipped {
    transform: rotateY(-180deg);
}

.livret-face {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #ffffff;
    border-radius: 0.3rem;
    box-shadow: 0 18px 46px rgba(31, 46, 35, 0.22);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.livret-face--back {
    transform: rotateY(180deg);
}

.livret-face img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
}

/* Page unique (téléphone) : image posée, sans effets 3D lourds */
.livret-simple-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
    border-radius: 0.3rem;
    box-shadow: 0 18px 46px rgba(31, 46, 35, 0.22);
}

#livretPrev:disabled,
#livretNext:disabled {
    opacity: 0.42;
    cursor: default;
}

.livret-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.livret-loading.is-hidden {
    display: none;
}

.livret-error {
    display: none;
}

.livret-error.is-visible {
    display: block;
}

.livret-spinner {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent-color);
    animation: livret-spin 0.9s linear infinite;
}

@keyframes livret-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .livret-leaf {
        transition-duration: 1ms;
    }

    .livret-spinner {
        animation-duration: 2.6s;
    }
}

.livret-frame-wrap {
    position: relative;
    width: 100%;
    height: min(78vh, 820px);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 1.6rem;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.livret-frame-wrap iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 767px) {
    .livret-book {
        margin-top: 1.75rem;
    }

    .livret-frame-wrap {
        height: min(72vh, 640px);
        border-radius: 1.2rem;
    }
}