/* ==========================================================================
   EL MANA · La carta — el libro real (turn.js) dentro de la página
   ========================================================================== */

/* ---------- el libro en la sección ---------- */
.libro-inline {
    position: relative;
    margin-top: clamp(1.8rem, 4vw, 3rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1.1rem, 2.2vw, 1.7rem);
    overflow-x: clip;
}

.libro-inline__luz {
    position: absolute;
    inset: -8% -2% -2%;
    background:
        radial-gradient(48% 44% at 50% 40%, rgba(185, 171, 146, 0.14), rgba(185, 171, 146, 0.03) 48%, transparent 72%);
    pointer-events: none;
}

/* turn.js centra el libro con márgenes propios: el marco debe medir
   exactamente lo que mide el libro */
.libro-inline__marco {
    position: relative;
    width: var(--book-w, 940px);
    max-width: 100%;
    margin: 0 auto;
}

/* ---------- flipbook: estructura que espera turn.js ---------- */
.flipbook {
    position: relative;
    margin: 0 auto;
    background: transparent;
}

.flipbook .page {
    background: #fff;
    overflow: hidden;
    box-shadow:
        0 40px 70px -46px rgba(0, 0, 0, 0.95),
        0 0 0 1px rgba(237, 231, 218, 0.07);
}

.flipbook .page-content {
    width: 100%;
    height: 100%;
    background: #fff;
}

.flipbook .page-content.has-photo {
    padding: 0;
    position: relative;
    overflow: hidden;
    background: #fff;
}

.flipbook .flipbook-photo-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    overflow: hidden;
}

.flipbook .flipbook-photo-layer img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

/* turn.js crea el wrapper de cada hoja: que no herede sombras del tema */
.flipbook .turn-page-wrapper {
    background: #fff;
}

/* ---------- controles ---------- */
.libro-inline__pie {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(1rem, 3vw, 2rem);
}

.libro-ctrl {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    color: var(--ink);
    background: transparent;
    transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease), opacity 0.3s ease;
}

.libro-ctrl:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(237, 231, 218, 0.32);
}

.libro-ctrl:disabled {
    opacity: 0.25;
    cursor: default;
}

.libro-ctrl svg {
    width: 13px;
    height: 13px;
}

.libro-inline__num {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    min-width: 84px;
    justify-content: center;
    font-family: var(--serif);
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.libro-inline__num i {
    font-style: normal;
    font-family: var(--sans);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: var(--stone-2);
}

.libro-inline__hint {
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--stone-2);
    text-align: center;
}

/* ---------- responsive ---------- */
@media (max-width: 820px) {
    .libro-inline {
        margin-top: 1.6rem;
    }

    .libro-inline__hint {
        display: none;
    }

    .libro-ctrl {
        width: 42px;
        height: 42px;
    }
}