/* ==========================================================================
   ASU Prospectus flipbook
   Page images are pre-rendered WebP; page-flip.browser.js drives the curl.
   ========================================================================== */

.fb {
    --fb-bg: #0e1a2b;
    --fb-bg-2: #16263d;
    --fb-bar: #0b1727;
    --fb-ink: #f2f5f9;
    --fb-muted: #93a4bd;
    --fb-gold: #e0a63c;
    --fb-line: rgba(255, 255, 255, .10);
    --fb-bar-h: 56px;

    position: relative;
    display: flex;
    flex-direction: column;
    height: 82vh;
    min-height: 520px;
    background: radial-gradient(ellipse at 50% 0%, var(--fb-bg-2) 0%, var(--fb-bg) 70%);
    color: var(--fb-ink);
    overflow: hidden;
    font-family: inherit;
    -webkit-user-select: none;
    user-select: none;
}

    .fb:fullscreen,
    .fb:-webkit-full-screen {
        height: 100vh;
        min-height: 100vh;
    }

/* ---------- stage ---------- */

.fb-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 62px;
}

.fb-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .22s ease;
    transform-origin: center center;
    will-change: transform;
}

/* page-flip reads this element's box to compute the spread size (stretch mode,
   which clamps to both width and height), so it must fill the viewport area. */
.fb-book {
    width: 100%;
    height: 100%;
}

.fb-page {
    background: #fff;
    overflow: hidden;
}

    .fb-page img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
        background: #fff;
        pointer-events: none;
    }

/* page not yet loaded */
.fb-page.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, #f4f6f9 30%, #e9edf3 50%, #f4f6f9 70%);
    background-size: 220% 100%;
    animation: fb-shimmer 1.1s linear infinite;
}

@keyframes fb-shimmer {
    to {
        background-position: -220% 0;
    }
}

/* hard covers get a subtle edge (page-flip adds .stf__item to these same nodes) */
.fb-page[data-density="hard"] {
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
}

/* ---------- side arrows ---------- */

.fb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 84px;
    border: 0;
    border-radius: 6px;
    background: rgba(255,255,255,.07);
    color: var(--fb-ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, opacity .15s;
    z-index: 5;
}

    .fb-nav:hover {
        background: rgba(255,255,255,.16);
    }

    .fb-nav[disabled] {
        opacity: .25;
        cursor: default;
    }

    .fb-nav.fb-prev {
        left: 8px;
    }

    .fb-nav.fb-next {
        right: 8px;
    }

    .fb-nav svg {
        width: 22px;
        height: 22px;
    }

/* ---------- toolbar ---------- */

.fb-toolbar {
    flex: 0 0 auto;
    height: var(--fb-bar-h);
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 8px;
    background: var(--fb-bar);
    border-top: 1px solid var(--fb-line);
    z-index: 20;
}

.fb-btn {
    position: relative;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--fb-ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
}

    .fb-btn:hover {
        background: rgba(255,255,255,.12);
    }

    .fb-btn.is-on {
        background: var(--fb-gold);
        color: #16263d;
    }

    .fb-btn svg {
        width: 20px;
        height: 20px;
        pointer-events: none;
    }

.fb-sep {
    width: 1px;
    height: 24px;
    margin: 0 6px;
    background: var(--fb-line);
    flex: 0 0 auto;
}

.fb-spacer {
    flex: 1 1 auto;
}

/* page counter */
.fb-counter {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--fb-muted);
    white-space: nowrap;
    padding: 0 4px;
}

.fb-jump {
    width: 52px;
    height: 30px;
    text-align: center;
    border: 1px solid var(--fb-line);
    border-radius: 5px;
    background: rgba(255,255,255,.06);
    color: var(--fb-ink);
    font-size: 13px;
    -moz-appearance: textfield;
}

    .fb-jump::-webkit-outer-spin-button,
    .fb-jump::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    .fb-jump:focus {
        outline: 2px solid var(--fb-gold);
        outline-offset: 0;
    }

/* tooltips */
.fb-btn[data-tip]:hover::after,
.fb-nav[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #000c;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    padding: 6px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 40;
}

.fb-nav[data-tip]:hover::after {
    bottom: auto;
    top: calc(100% + 8px);
}

/* ---------- panels (thumbnails / contents / search) ---------- */

.fb-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--fb-bar-h);
    max-height: 62%;
    background: rgba(11,23,39,.97);
    border-top: 1px solid var(--fb-line);
    /* the panel sits above the toolbar, so it must travel its own height *plus*
       the toolbar height to clear the container and be clipped by overflow */
    transform: translateY(calc(100% + var(--fb-bar-h)));
    transition: transform .25s ease;
    z-index: 15;
    display: flex;
    flex-direction: column;
}

    .fb-panel.is-open {
        transform: translateY(0);
    }

.fb-panel-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--fb-line);
    font-size: 14px;
    font-weight: 600;
}

.fb-panel-body {
    flex: 1 1 auto;
    overflow: auto;
    padding: 12px 14px;
}

.fb-panel-close {
    margin-inline-start: auto;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--fb-muted);
    cursor: pointer;
}

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

/* thumbnails */
.fb-thumbs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 12px;
}

.fb-thumb {
    border: 0;
    padding: 0;
    background: none;
    cursor: pointer;
    text-align: center;
}

    .fb-thumb img {
        display: block;
        width: 100%;
        aspect-ratio: 595 / 842;
        object-fit: cover;
        background: #26364f;
        border: 2px solid transparent;
        border-radius: 3px;
        transition: border-color .15s, transform .15s;
    }

    .fb-thumb:hover img {
        transform: translateY(-2px);
        border-color: rgba(255,255,255,.4);
    }

    .fb-thumb.is-current img {
        border-color: var(--fb-gold);
    }

    .fb-thumb span {
        display: block;
        margin-top: 4px;
        font-size: 11px;
        color: var(--fb-muted);
    }

    .fb-thumb.is-current span {
        color: var(--fb-gold);
    }

/* contents */
.fb-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 720px;
}

    .fb-toc-list li + li {
        margin-top: 2px;
    }

.fb-toc-item {
    width: 100%;
    display: flex;
    align-items: baseline;
    gap: 10px;
    border: 0;
    background: transparent;
    color: var(--fb-ink);
    text-align: start;
    padding: 9px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

    .fb-toc-item:hover {
        background: rgba(255,255,255,.09);
    }

    .fb-toc-item .fb-dots {
        flex: 1 1 auto;
        border-bottom: 1px dotted rgba(255,255,255,.25);
        transform: translateY(-4px);
    }

    .fb-toc-item .fb-pg {
        color: var(--fb-gold);
        font-variant-numeric: tabular-nums;
    }

/* search */
.fb-search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    max-width: 520px;
}

.fb-search-input {
    flex: 1 1 auto;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--fb-line);
    border-radius: 6px;
    background: rgba(255,255,255,.06);
    color: var(--fb-ink);
    font-size: 14px;
}

    .fb-search-input:focus {
        outline: 2px solid var(--fb-gold);
    }

.fb-result {
    width: 100%;
    display: block;
    text-align: start;
    border: 0;
    background: transparent;
    color: var(--fb-ink);
    padding: 9px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
}

    .fb-result:hover {
        background: rgba(255,255,255,.09);
    }

    .fb-result b {
        color: var(--fb-gold);
        font-weight: 600;
    }

    .fb-result .fb-pg {
        color: var(--fb-muted);
        font-size: 11px;
        display: block;
        margin-bottom: 2px;
    }

.fb-empty {
    color: var(--fb-muted);
    font-size: 13px;
    padding: 6px 10px;
}

/* ---------- share menu ---------- */

.fb-share {
    position: absolute;
    bottom: calc(var(--fb-bar-h) + 8px);
    inset-inline-end: 10px;
    background: #16263d;
    border: 1px solid var(--fb-line);
    border-radius: 8px;
    padding: 6px;
    display: none;
    flex-direction: column;
    min-width: 190px;
    box-shadow: 0 12px 32px rgba(0,0,0,.45);
    z-index: 25;
}

    .fb-share.is-open {
        display: flex;
    }

    .fb-share a,
    .fb-share button {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 9px 10px;
        border: 0;
        border-radius: 5px;
        background: transparent;
        color: var(--fb-ink);
        font-size: 13px;
        text-decoration: none;
        cursor: pointer;
        text-align: start;
    }

        .fb-share a:hover,
        .fb-share button:hover {
            background: rgba(255,255,255,.1);
        }

    .fb-share svg {
        width: 16px;
        height: 16px;
        flex: 0 0 auto;
    }

/* ---------- zoom / pan ---------- */

.fb.is-zoomed .fb-viewport {
    cursor: grab;
}

.fb.is-zoomed.is-panning .fb-viewport {
    cursor: grabbing;
    transition: none;
}

/* ---------- loading overlay ---------- */

.fb-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    background: var(--fb-bg);
    z-index: 30;
    transition: opacity .4s;
}

    .fb-loader.is-done {
        opacity: 0;
        pointer-events: none;
    }

.fb-loader-book {
    width: 42px;
    height: 52px;
    border: 3px solid var(--fb-gold);
    border-radius: 2px;
    animation: fb-flip 1.2s infinite ease-in-out;
    transform-style: preserve-3d;
}

@keyframes fb-flip {
    0% {
        transform: rotateY(0);
    }

    100% {
        transform: rotateY(-180deg);
    }
}

.fb-loader span {
    font-size: 13px;
    color: var(--fb-muted);
}

/* ---------- no-JS / fallback ---------- */

/* belt and braces: nothing but the stage and toolbar may take a flex row */
.fb > noscript {
    display: none;
}

.fb-fallback {
    padding: 40px 16px;
    text-align: center;
}

    .fb-fallback img {
        max-width: 420px;
        width: 100%;
        margin-bottom: 20px;
    }

/* ---------- responsive ---------- */

@media (max-width: 991px) {
    .fb-stage {
        padding: 12px 48px;
    }

    .fb-nav {
        width: 38px;
        height: 68px;
    }
}

@media (max-width: 767px) {
    .fb {
        height: 78vh;
        min-height: 460px;
        --fb-bar-h: 52px;
    }

    .fb-stage {
        padding: 8px 6px;
    }

    .fb-nav {
        display: none;
    }

    .fb-toolbar {
        gap: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

        .fb-toolbar::-webkit-scrollbar {
            display: none;
        }

    .fb-btn {
        width: 38px;
        height: 38px;
    }

    .fb-panel {
        max-height: 70%;
    }

    .fb-thumbs-grid {
        grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
        gap: 9px;
    }

    .fb-hide-sm {
        display: none !important;
    }
}
