/* =========================================================
   PAINE COLLEGE FLIPDOC
   ========================================================= */

.paine-flipdoc {
    --pfd-purple: #4E008E;
    --pfd-gold: #CDA177;
    --pfd-dark: #17151b;
    --pfd-panel: #232027;
    --pfd-light: #ffffff;
    --pfd-muted: #aaa4b0;

    position: relative;
    width: 100%;
    background: var(--pfd-dark);
    color: var(--pfd-light);
    overflow: hidden;
    font-family: inherit;
}


/* =========================================================
   TOOLBAR
   ========================================================= */

.pfd-toolbar {
    min-height: 64px;

    display: grid;

    grid-template-columns:
        1fr
        auto
        1fr;

    align-items: center;

    gap: 20px;

    padding: 8px 18px;

    background:
        var(--pfd-purple);

    position: relative;

    z-index: 50;
}


.pfd-toolbar-left {
    display: flex;

    justify-content:
        flex-start;

    align-items: center;
}


.pfd-toolbar-right {
    display: flex;

    justify-content:
        flex-end;

    align-items: center;

    gap: 8px;
}


.pfd-title {
    font-weight: 700;

    text-align: center;

    font-size: 16px;

    line-height: 1.2;
}


.pfd-button {
    appearance: none;

    border: 0;

    background:
        rgba(
            255,
            255,
            255,
            .12
        );

    color: white;

    min-height: 40px;

    padding: 0 14px;

    border-radius: 4px;

    cursor: pointer;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 7px;

    text-decoration: none;

    font: inherit;

    line-height: 1;
}


.pfd-button:hover,
.pfd-button:focus {
    background:
        rgba(
            255,
            255,
            255,
            .23
        );

    color: #ffffff;
}


.pfd-button:focus-visible {
    outline:
        2px solid
        var(--pfd-gold);

    outline-offset: 2px;
}


/* =========================================================
   READER
   ========================================================= */

.pfd-reader {
    display: flex;

    position: relative;

    min-height: 720px;

    overflow: hidden;
}


.pfd-main {
    flex: 1;

    min-width: 0;

    min-height: 720px;

    position: relative;

    display: flex;

    justify-content: center;

    align-items: center;

    padding: 40px 70px;

    overflow: hidden;

    background:
        radial-gradient(
            circle at center,
            #363139 0%,
            #211e24 65%,
            #161418 100%
        );
}


/* =========================================================
   BOOK STAGE
   ========================================================= */

.pfd-stage {
    position: relative;

    width: 100%;

    max-width: 1200px;

    height: 620px;

    min-width: 0;

    display: flex;

    justify-content: center;

    align-items: center;

    overflow: visible;
}


.pfd-book {
    margin: 0 auto;

    position: relative;

    max-width: 100%;
}


.pfd-page {
    background: #ffffff;

    overflow: hidden;
}


.pfd-page-canvas {
    display: block;

    width: 100%;

    height: 100%;

    object-fit: contain;
}


/* =========================================================
   PAGE SHADOW / BOOK APPEARANCE
   ========================================================= */

.stf__parent {
    margin: 0 auto;
}


.stf__block {
    margin: 0 auto;
}


.pfd-book .stf__item {
    background: #ffffff;
}


/* =========================================================
   LOADING SCREEN
   ========================================================= */

.pfd-loading {
    position: absolute;

    inset: 0;

    z-index: 40;

    background:
        var(--pfd-dark);

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    gap: 12px;

    transition:
        opacity .3s ease,
        visibility .3s ease;
}


.pfd-loading-hidden {
    opacity: 0;

    visibility: hidden;

    pointer-events: none;
}


.pfd-spinner {
    width: 42px;

    height: 42px;

    border:
        4px solid
        rgba(
            255,
            255,
            255,
            .2
        );

    border-top-color:
        var(--pfd-gold);

    border-radius: 50%;

    animation:
        pfd-spin
        .8s
        linear
        infinite;
}


@keyframes pfd-spin {

    to {
        transform:
            rotate(360deg);
    }

}


.pfd-loading-message {
    font-weight: 600;

    text-align: center;

    padding: 0 20px;
}


.pfd-loading-progress {
    color:
        var(--pfd-muted);
}


/* =========================================================
   SIDE NAVIGATION ARROWS
   ========================================================= */

.pfd-arrow {
    position: absolute;

    top: 50%;

    transform:
        translateY(-50%);

    z-index: 25;

    width: 50px;

    height: 70px;

    border: 0;

    background:
        rgba(
            0,
            0,
            0,
            .35
        );

    color: white;

    font-size: 44px;

    font-weight: 200;

    line-height: 1;

    cursor: pointer;

    border-radius: 3px;
}


.pfd-arrow:hover,
.pfd-arrow:focus {
    background:
        var(--pfd-purple);
}


.pfd-arrow:focus-visible {
    outline:
        2px solid
        var(--pfd-gold);
}


.pfd-prev {
    left: 10px;
}


.pfd-next {
    right: 10px;
}


/* =========================================================
   THUMBNAIL SIDEBAR
   ========================================================= */

.pfd-sidebar {
    width: 0;

    flex:
        0
        0
        0;

    overflow: hidden;

    background:
        #1b191d;

    position: relative;

    z-index: 55;

    transition:
        width .25s ease,
        flex-basis .25s ease;
}


.pfd-sidebar-open
.pfd-sidebar {
    width: 220px;

    flex-basis: 220px;
}


.pfd-sidebar-heading {
    height: 54px;

    padding: 0 13px;

    display: flex;

    align-items: center;

    justify-content:
        space-between;

    border-bottom:
        1px solid
        rgba(
            255,
            255,
            255,
            .1
        );
}


.pfd-sidebar-close {
    border: 0;

    background: transparent;

    color: white;

    font-size: 26px;

    cursor: pointer;

    line-height: 1;
}


.pfd-thumbnails {
    padding: 15px;

    height: 666px;

    overflow-y: auto;

    overscroll-behavior:
        contain;
}


.pfd-thumbnail {
    display: block;

    width: 100%;

    border:
        2px solid
        transparent;

    padding: 7px;

    margin:
        0
        0
        14px;

    background:
        transparent;

    color: white;

    cursor: pointer;

    border-radius: 3px;
}


.pfd-thumbnail:hover {
    border-color:
        rgba(
            205,
            161,
            119,
            .5
        );
}


.pfd-thumbnail.active {
    border-color:
        var(--pfd-gold);
}


.pfd-thumbnail canvas {
    display: block;

    width: 100%;

    height: auto;

    background: white;

    box-shadow:
        0
        5px
        18px
        rgba(
            0,
            0,
            0,
            .4
        );
}


.pfd-thumbnail span {
    display: block;

    text-align: center;

    font-size: 12px;

    margin-top: 6px;
}


/* =========================================================
   FOOTER
   ========================================================= */

.pfd-footer {
    min-height: 60px;

    padding: 8px 18px;

    background:
        var(--pfd-panel);

    display: flex;

    align-items: center;

    justify-content:
        space-between;

    gap: 20px;

    position: relative;

    z-index: 50;
}


.pfd-footer-button {
    appearance: none;

    border: 0;

    background: transparent;

    color: white;

    cursor: pointer;

    min-height: 40px;

    padding: 0 10px;

    font: inherit;
}


.pfd-footer-button:hover,
.pfd-footer-button:focus {
    color:
        var(--pfd-gold);
}


.pfd-page-counter {
    display: flex;

    align-items: center;

    gap: 8px;

    font-size: 14px;
}


.pfd-page-counter label {
    display: flex;

    align-items: center;

    gap: 7px;
}


.pfd-page-input {
    width: 60px;

    padding: 6px;

    text-align: center;

    border:
        1px solid
        #59535e;

    border-radius: 3px;

    background:
        #151317;

    color: white;
}


/* Hide browser number arrows where possible */

.pfd-page-input::-webkit-inner-spin-button,
.pfd-page-input::-webkit-outer-spin-button {
    opacity: .6;
}


/* =========================================================
   NATIVE FULLSCREEN
   ========================================================= */

.paine-flipdoc:fullscreen {
    width: 100vw;

    height: 100vh;

    display: flex;

    flex-direction: column;

    background:
        var(--pfd-dark);
}


.paine-flipdoc:-webkit-full-screen {
    width: 100vw;

    height: 100vh;

    display: flex;

    flex-direction: column;

    background:
        var(--pfd-dark);
}


.paine-flipdoc:fullscreen
.pfd-reader,
.paine-flipdoc:-webkit-full-screen
.pfd-reader {
    flex: 1;

    min-height: 0;
}


.paine-flipdoc:fullscreen
.pfd-main,
.paine-flipdoc:-webkit-full-screen
.pfd-main {
    flex: 1;

    min-height: 0;
}


.paine-flipdoc:fullscreen
.pfd-stage,
.paine-flipdoc:-webkit-full-screen
.pfd-stage {
    height:
        calc(
            100vh - 145px
        );

    max-height:
        calc(
            100vh - 145px
        );
}


/* =========================================================
   CSS FULLSCREEN FALLBACK
   FOR iPHONE / MOBILE SAFARI
   ========================================================= */

html.pfd-fullscreen-lock,
body.pfd-fullscreen-lock {
    overflow: hidden !important;

    overscroll-behavior:
        none;

    touch-action:
        none;
}


.paine-flipdoc.pfd-mobile-fullscreen {
    position: fixed !important;

    top: 0 !important;

    right: 0 !important;

    bottom: 0 !important;

    left: 0 !important;

    width: 100vw !important;

    height: 100vh !important;

    max-width: none !important;

    margin: 0 !important;

    padding: 0 !important;

    z-index: 2147483000 !important;

    display: flex;

    flex-direction: column;

    background:
        var(--pfd-dark);
}


@supports (
    height: 100dvh
) {

    .paine-flipdoc.pfd-mobile-fullscreen {
        height:
            100dvh !important;
    }

}


.paine-flipdoc.pfd-mobile-fullscreen
.pfd-toolbar {
    flex:
        0
        0
        auto;
}


.paine-flipdoc.pfd-mobile-fullscreen
.pfd-reader {
    flex: 1;

    min-height: 0;

    height: auto;

    overflow: hidden;
}


.paine-flipdoc.pfd-mobile-fullscreen
.pfd-main {
    flex: 1;

    min-height: 0;

    height: auto;

    padding-top: 15px;

    padding-bottom: 15px;
}


.paine-flipdoc.pfd-mobile-fullscreen
.pfd-stage {
    flex: 1;

    height: auto;

    min-height: 0;

    max-height:
        calc(
            100vh - 125px
        );
}


@supports (
    height: 100dvh
) {

    .paine-flipdoc.pfd-mobile-fullscreen
    .pfd-stage {
        max-height:
            calc(
                100dvh - 125px
            );
    }

}


.paine-flipdoc.pfd-mobile-fullscreen
.pfd-footer {
    flex:
        0
        0
        auto;
}


/* =========================================================
   SINGLE FLIPDOC PAGE
   ========================================================= */

.paine-flipdoc-page {
    margin: 0;

    padding: 0;

    max-width: none;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (
    max-width: 900px
) {

    .pfd-reader,
    .pfd-main {
        min-height: 620px;
    }


    .pfd-stage {
        height: 550px;
    }


    .pfd-main {
        padding:
            30px
            45px;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (
    max-width: 600px
) {

    .pfd-toolbar {
        min-height: 56px;

        padding:
            7px
            10px;

        grid-template-columns:
            auto
            minmax(0, 1fr)
            auto;

        gap: 8px;
    }


    .pfd-title {
        font-size: 13px;

        overflow: hidden;

        text-overflow:
            ellipsis;

        white-space:
            nowrap;

        min-width: 0;
    }


    .pfd-button {
        padding:
            0
            10px;

        min-height: 38px;
    }


    .pfd-button-label {
        display: none;
    }


    .pfd-reader,
    .pfd-main {
        min-height: 540px;
    }


    .pfd-main {
        padding:
            20px
            32px;
    }


    .pfd-stage {
        height: 500px;

        max-width: 100%;
    }


    /*
     * StPageFlip automatically changes
     * to portrait/single-page mode.
     */
    .pfd-book {
        max-width: 100%;
    }


    .pfd-arrow {
        width: 36px;

        height: 60px;

        font-size: 36px;

        border-radius: 0;
    }


    .pfd-prev {
        left: 0;
    }


    .pfd-next {
        right: 0;
    }


    /*
     * Sidebar becomes an overlay on mobile.
     */
    .pfd-sidebar {
        position: absolute;

        left: 0;

        top: 0;

        bottom: 0;

        z-index: 60;

        width: 0;

        max-width: 80vw;

        flex-basis: auto;

        box-shadow:
            8px
            0
            30px
            rgba(
                0,
                0,
                0,
                .4
            );
    }


    .pfd-sidebar-open
    .pfd-sidebar {
        width: 210px;

        flex-basis: auto;
    }


    .pfd-thumbnails {
        height:
            calc(
                100% - 54px
            );
    }


    .pfd-footer {
        min-height: 56px;

        padding:
            6px
            8px;

        gap: 8px;
    }


    .pfd-footer-button span {
        display: none;
    }


    .pfd-page-counter {
        font-size: 12px;

        gap: 5px;
    }


    .pfd-page-input {
        width: 50px;
    }


    /*
     * Fullscreen mobile reader gets more
     * usable page area.
     */
    .paine-flipdoc.pfd-mobile-fullscreen
    .pfd-main {
        min-height: 0;

        padding:
            8px
            30px;
    }


    .paine-flipdoc.pfd-mobile-fullscreen
    .pfd-stage {
        height: auto;

        min-height: 0;

        max-height:
            calc(
                100vh - 112px
            );
    }


    @supports (
        height: 100dvh
    ) {

        .paine-flipdoc.pfd-mobile-fullscreen
        .pfd-stage {
            max-height:
                calc(
                    100dvh - 112px
                );
        }

    }

}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (
    max-width: 380px
) {

    .pfd-main {
        padding:
            15px
            27px;
    }


    .pfd-stage {
        height: 455px;
    }


    .pfd-arrow {
        width: 30px;

        font-size: 32px;
    }


    .pfd-page-counter label {
        gap: 4px;
    }

}