/* ---------------------------------------------------------------------------
   The "More Info" viewer: a PDF read as a book, or a single image.
   Paired with assets/js/doc-flipbook.js.
   --------------------------------------------------------------------------- */

.fb-body {
    background: #2b2a29;
    padding: 18px;
    border-radius: 0 0 14px 14px;
}

/* ---- the book ---- */

.fb-book {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    perspective: 2200px;
    min-height: 320px;
}

.fb-side {
    flex: 1 1 50%;
    background: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    min-height: 320px;
    overflow: hidden;
    transform-origin: center;
}

.fb-left {
    border-radius: 6px 0 0 6px;
    box-shadow: inset -14px 0 22px -18px rgba(0, 0, 0, .55);
}

.fb-right {
    border-radius: 0 6px 6px 0;
    box-shadow: inset 14px 0 22px -18px rgba(0, 0, 0, .55);
}

/* A page that does not exist - the back of the last leaf - is left as paper
   rather than a gap, so the book keeps its shape at the ends. */
.fb-blank {
    background: #f4f2ee;
}

.fb-spine {
    width: 2px;
    background: linear-gradient(to right, rgba(0, 0, 0, .28), rgba(0, 0, 0, .10));
    flex: 0 0 2px;
}

.fb-canvas {
    width: 100%;
    height: auto;
    display: block;
}

.fb-page-number {
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-size: 11px;
    color: #8a8a8a;
    background: rgba(255, 255, 255, .85);
    border-radius: 3px;
    padding: 0 5px;
}

.fb-left .fb-page-number {
    right: auto;
    left: 10px;
}

/* ---- turning ----
   The leaf lifts off the spine and swings across, which reads as a page turn
   without needing a real peel. Kept short: a slow flip is charming once and
   tiresome by page four. */

.fb-turn-next .fb-right {
    animation: fbTurnNext .32s ease-in;
}

.fb-turn-prev .fb-left {
    animation: fbTurnPrev .32s ease-in;
}

@keyframes fbTurnNext {
    from { transform: rotateY(0deg); transform-origin: left center; opacity: 1; }
    to   { transform: rotateY(-88deg); transform-origin: left center; opacity: .35; }
}

@keyframes fbTurnPrev {
    from { transform: rotateY(0deg); transform-origin: right center; opacity: 1; }
    to   { transform: rotateY(88deg); transform-origin: right center; opacity: .35; }
}

@media (prefers-reduced-motion: reduce) {
    .fb-turn-next .fb-right,
    .fb-turn-prev .fb-left {
        animation: none;
    }
}

/* ---- controls ---- */

.fb-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.fb-btn {
    background: #eb1c24;
    border: 1px solid #eb1c24;
    color: #fff;
    border-radius: 40px;
    padding: 7px 20px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
}

    .fb-btn:hover {
        background: #c9161d;
        color: #fff;
    }

    .fb-btn:disabled {
        opacity: .4;
        cursor: not-allowed;
    }

.fb-download {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, .45);
}

    .fb-download:hover {
        background: rgba(255, 255, 255, .12);
        color: #fff;
    }

.fb-counter {
    color: #fff;
    font-size: 13.5px;
    min-width: 110px;
    text-align: center;
}

/* ---- image ---- */

.fb-image-wrap {
    text-align: center;
    background: #fff;
    border-radius: 6px;
    padding: 10px;
}

.fb-image {
    max-width: 100%;
    max-height: 70vh;
    cursor: zoom-in;
    display: inline-block;
}

.fb-hint {
    color: rgba(255, 255, 255, .7);
    font-size: 13px;
    text-align: center;
    margin: 12px 0 0;
}

    .fb-hint a {
        color: #fff;
        text-decoration: underline;
    }

/* ---- a single page on a narrow screen ----
   Two A4 pages side by side on a phone are unreadable, so the left page is
   dropped and the book becomes one page wide. The page numbering still runs
   in pairs, which is what the counter reports. */

@media (max-width: 767px) {
    .fb-left, .fb-spine {
        display: none;
    }

    .fb-right {
        border-radius: 6px;
        box-shadow: none;
    }
}
