/* =========================================================
   Airborne Risk Management - single-page flipbooks
   Independent from the existing Sonibike flipbook files.
   ========================================================= */

.arm-flipbooks {
    display: grid;
    gap: clamp(3rem, 7vw, 6rem);
    margin-top: clamp(3rem, 7vw, 6rem);
}

.arm-flipbook-section {
    min-width: 0;
}

.arm-flipbook-intro {
    max-width: 780px;
    margin-bottom: 1.4rem;
}

.arm-flipbook-intro h2 {
    margin-bottom: 0.65rem;
}

.arm-flipbook-intro p {
    margin: 0;
}

.arm-flipbook-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(122, 90, 29, 0.48);
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.055), transparent 42%),
        rgba(12, 13, 14, 0.98);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

.arm-flipbook-stage {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: clamp(300px, 58vw, 760px);
    padding: clamp(0.75rem, 2.5vw, 1.8rem);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.arm-flipbook-book-viewport {
    position: relative;
    flex: 0 0 auto;
    overflow: visible;
    transition: width 280ms ease, height 280ms ease;
}

.arm-flipbook-book-viewport.no-transition {
    transition: none;
}

.arm-flipbook-zoom-layer {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    transition: transform 280ms ease;
}

.arm-flipbook-book,
.arm-flipbook-book .stf__parent {
    width: 794px !important;
    height: 595px !important;
}

.arm-flipbook-book img {
    object-fit: contain;
    background: #fff;
}

.arm-flipbook-loader {
    position: absolute;
    z-index: 20;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(12, 13, 14, 0.86);
}

.arm-flipbook-loader[hidden] {
    display: none;
}

.arm-flipbook-loader-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-top-color: #b9934d;
    border-radius: 50%;
    animation: armFlipbookSpin 0.8s linear infinite;
}

@keyframes armFlipbookSpin {
    to { transform: rotate(360deg); }
}

.arm-flipbook-toolbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem clamp(0.85rem, 2vw, 1.4rem);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(5, 6, 7, 0.92);
}

.arm-flipbook-nav,
.arm-flipbook-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.arm-flipbook-actions {
    justify-content: flex-end;
}

.arm-flipbook-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 40px;
    padding: 0.55rem 0.78rem;
    border: 1px solid rgba(185, 147, 77, 0.46);
    border-radius: 9px;
    color: #f4eee2;
    background: rgba(255, 255, 255, 0.035);
    font: inherit;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.arm-flipbook-button:hover:not(:disabled),
.arm-flipbook-button:focus-visible {
    border-color: rgba(185, 147, 77, 0.9);
    background: rgba(185, 147, 77, 0.14);
    transform: translateY(-1px);
}

.arm-flipbook-button:disabled {
    opacity: 0.35;
    cursor: default;
}

.arm-flipbook-open-pdf {
    padding-inline: 1rem;
    white-space: nowrap;
}

.arm-flipbook-page-status {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
    text-align: center;
    white-space: nowrap;
}

.arm-flipbook-hint {
    margin: 0;
    padding: 0.78rem 1rem 1rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(5, 6, 7, 0.92);
    font-size: 0.82rem;
    text-align: center;
}

.arm-flipbook-shell:fullscreen {
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
    background: #090a0b;
}

.arm-flipbook-shell:fullscreen .arm-flipbook-stage {
    height: calc(100vh - 116px);
}

@media (max-width: 760px) {
    .arm-flipbook-stage {
        height: clamp(260px, 74vw, 510px);
        padding: 0.55rem;
    }

    .arm-flipbook-toolbar {
        grid-template-columns: 1fr auto;
        gap: 0.7rem;
    }

    .arm-flipbook-page-status {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .arm-flipbook-nav {
        grid-column: 1;
        grid-row: 2;
    }

    .arm-flipbook-actions {
        grid-column: 2;
        grid-row: 2;
    }

    .arm-flipbook-open-pdf {
        font-size: 0;
        min-width: 42px;
        padding-inline: 0.65rem;
    }

    .arm-flipbook-open-pdf::after {
        content: "PDF";
        font-size: 0.78rem;
        letter-spacing: 0.05em;
    }

    .arm-flipbook-hint {
        display: none;
    }
}

@media (max-width: 430px) {
    .arm-flipbook-button {
        min-width: 38px;
        min-height: 38px;
        padding: 0.45rem 0.62rem;
    }

    .arm-flipbook-actions,
    .arm-flipbook-nav {
        gap: 0.35rem;
    }
}
