/*
 * These rules stay as plain CSS (not Tailwind utility classes) because they're
 * tightly coupled to the 3D flip animation state machine driven by flipbook.js
 * (classList toggling of is-visible/is-folding, transitionend listeners, inline
 * style.transform mutations). Converting to utility classes applied via JS
 * className strings risks silently breaking the flip timing with no easy way
 * to visually verify it.
 */

.flipbook-stage {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 12rem;
    margin: 0 auto;
    perspective: 2200px;
    perspective-origin: 50% 50%;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0, transparent 12px),
        #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    outline: none;
    transform-style: preserve-3d;
}

.flipbook-back,
.flipbook-front {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.flipbook-back {
    z-index: 1;
}

.flipbook-front {
    z-index: 2;
    transform-origin: left center;
    transform-style: preserve-3d;
    transition:
        transform 0.7s cubic-bezier(0.33, 0.1, 0.25, 1),
        box-shadow 0.7s cubic-bezier(0.33, 0.1, 0.25, 1);
    will-change: transform;
    visibility: hidden;
    background: #fff;
}

.flipbook-front.is-visible {
    visibility: visible;
}

.flipbook-front.is-folding {
    box-shadow:
        8px 0 28px rgba(0, 0, 0, 0.22),
        -2px 0 8px rgba(0, 0, 0, 0.08);
}

.flipbook-front::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.12) 0%,
        rgba(0, 0, 0, 0) 18%,
        rgba(255, 255, 255, 0.08) 55%,
        rgba(0, 0, 0, 0.18) 100%
    );
    opacity: 0;
    transition: opacity 0.7s cubic-bezier(0.33, 0.1, 0.25, 1);
}

.flipbook-front.is-folding::after {
    opacity: 1;
}
