/*!
  Important comments included in optimized output.
*/
@font-face {
    font-family: 'arrows';
    src: url('../fonts/arrows/arrows.eot');
    src:
        url('../fonts/arrows/arrows.eot?#iefix') format('embedded-opentype'),
        url('../fonts/arrows/arrows.woff') format('woff'),
        url('../fonts/arrows/arrows.ttf') format('truetype'),
        url('../fonts/arrows/arrows.svg#arrows') format('svg');
    font-weight: normal;
    font-style: normal;
}

body {
    margin: 0;
    overflow: hidden;
}

.bb-bookblock {
    margin: 0 auto;
    position: relative;
    z-index: 100;
    perspective: 1300px;
    backface-visibility: hidden;

    &::after {
        content: '';
        position: absolute;
        border-right: 1px rgba(0, 0, 0, 0.05) solid;
        height: 100%;
        width: 100%;
        transform: translateX(-50%);
    }

    &.bb-dropshadow-effect {
        filter: drop-shadow(0 1.5em 0.5em #7d7d7d);
    }
    // &:hover {
    //     transform-style: preserve-3d;
    //     transform: translateX(-130px);
    //     transition: transform 350ms;
    // }
}

.bb-page {
    position: absolute;
    transform-style: preserve-3d;
    transition-property: transform;

    > div {
        position: absolute;
        height: 100%;
        width: 100%;
        top: 0;
        left: 0;
        backface-visibility: hidden;
        transform-style: preserve-3d;
    }
}

.bb-content {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    background: #fff;
}

.bb-front {
    transform-style: preserve-3d;
    filter: none;
}

.bb-horizontal {
    .bb-page {
        width: 100%;
        height: 50%;
        top: 50%;
        transform-origin: center top;
    }

    .bb-back {
        transform: rotateX(-180deg);
    }

    .bb-front {
        .bb-content {
            top: -100%;
        }
    }

    .bb-flip-next {
        transform: rotateX(180deg);
    }

    .bb-flip-initial {
        transform: rotateX(180deg);
    }

    .bb-flip-prev {
        transform: rotateX(0deg);
    }

    .bb-flip-next-end {
        transform: rotateX(15deg);
    }

    .bb-flip-prev-end {
        transform: rotateX(165deg);
    }
}

.bb-vertical {
    .bb-front {
        .bb-content {
            left: -100%;
        }
    }

    .bb-page {
        width: 50%;
        height: 100%;
        left: 50%;
        transform-origin: left center;
    }

    .bb-back {
        transform: rotateY(-180deg);
    }

    .bb-flip-next {
        transform: rotateY(-180deg);
    }

    .bb-flip-initial {
        transform: rotateY(-180deg);
    }

    .bb-flip-prev {
        transform: rotateY(0deg);
    }

    .bb-flip-next-end {
        transform: rotateY(-15deg);
    }

    .bb-flip-prev-end {
        transform: rotateY(-165deg);
    }
}

.bb-outer {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    overflow: hidden;
    z-index: 999;
}

.bb-inner {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    backface-visibility: hidden;
}

.bb-overlay {
    background-color: rgba(0, 0, 0, 0.7);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.bb-flipoverlay {
    background-color: rgba(0, 0, 0, 0.7);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.bb-bookblock.bb-horizontal {
    > div.bb-page {
        &:first-child {
            transform: rotateX(180deg);

            .bb-back {
                transform: rotateX(180deg);
            }
        }
    }
}

.bb-bookblock.bb-vertical {
    > div.bb-page {
        &:first-child {
            transform: rotateY(180deg);

            .bb-back {
                transform: rotateY(180deg);
            }
        }
    }
}

.bb-item {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    background: none;
}

.bb-item img {
    width: 100%;
    height: 100%;
}

.bb-bookblock img {
    opacity: 0;
    transition: opacity 0s linear 0s, opacity 400ms;
}

.bb-bookblock img.bb-fadeIn {
    opacity: 1;
}

.bb-nav-container {
    width: 100%;
    height: 30px;
    margin: 1em auto 0;
    position: relative;
    z-index: 0;
    text-align: center;

    a {
        display: inline-block;
        width: 30px;
        height: 30px;
        text-align: center;
        border-radius: 2px;
        background: #72b890;
        color: #fff;
        font-size: 0;
        margin: 2px;

        &:hover {
            opacity: 0.6;
        }
    }
}

.bb-icon::before {
    display: block;
    font-family: 'arrows', sans-serif;
    font-size: 20px;
    font-style: normal;
    font-variant: normal;
    font-weight: normal;
    line-height: 1;
    speak: none;
    text-transform: none;
    position: relative;
    top: 50%;
    cursor: pointer;
}

.bb-icon-first::before,
.bb-icon-last::before {
    content: "\e002";
}

.bb-icon-arrow-left::before,
.bb-icon-arrow-right::before {
    content: "\e003";
}

.bb-icon-arrow-left::before,
.bb-icon-first::before {
    transform: rotate(180deg) translateY(50%);
}

.bb-icon-last::before,
.bb-icon-arrow-right::before {
    transform: translateY(-50%);
}

// .bb-icon-arrow-left::before,
// .bb-icon-first::before {
//     transform: rotate(180deg) translateY(50%);
// }

// .bb-icon-first::before,
// .bb-icon-last::before {
//     transform: translateY(50%);
// }

.bb-paper-effect {
    background: #fff;
    box-shadow:
        /* The top layer shadow */
        0 0.063em 0.063em rgba(0, 0, 0, 0.15),
        /* The second layer */
        0 0.65em 0 -0.313em #d5d5d5,
        /* The second layer shadow */
        0 0.625em 0.063em -0.250em rgba(0, 0, 0, 0.15),
        /* The third layer */
        0 1.25em 0 -0.625em #c8c8c8,
        /* The third layer shadow */
        0 1.25em 0.063em -0.563em rgba(0, 0, 0, 0.15);
}

// .bb-shadow-effect {
//     box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
// }

$colours:
    "10" 110%,
    "20" 120%,
    "40" 140%,
    "100" 200%;

@each $i in $colours {
    .brighten-#{nth($i, 1)} {
        filter: brightness(nth($i, 2));
    }
}

$base-line-height: 24px;
$white: rgb(255, 255, 255);
$off-white: rgba($white, 0.2);
$spin-duration: 1s;
$pulse-duration: 750ms;

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    50% {
        background: $white;
    }
}

.bb-loading {
    left: calc(50% - 1.5rem);
    top: calc(50% - 1.5rem);
    position: relative;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    border: 0.25rem solid $off-white;
    border-top-color: $white;
    animation: spin $spin-duration infinite linear;
    z-index: 10000;

    &.bb-not-loading {
        display: none;
    }
}

.bb-loading-pulse {
    position: relative;
    top: 50%;
    left: 50%;
    width: ($base-line-height / 4);
    height: $base-line-height;
    background: $off-white;
    animation: pulse $pulse-duration infinite;
    animation-delay: ($pulse-duration / 3);
    z-index: 10000;

    &::before,
    &::after {
        content: '';
        position: absolute;
        display: block;
        height: ($base-line-height / 1.5);
        width: ($base-line-height / 4);
        background: $off-white;
        top: 50%;
        transform: translateY(-50%);
        animation: pulse $pulse-duration infinite;
    }

    &::before {
        left: -($base-line-height / 2);
    }

    &::after {
        left: ($base-line-height / 2);
        animation-delay: ($pulse-duration / 1.5);
    }

    &.bb-not-loading {
        display: none;
    }
}

.no-js {
    .bb-bookblock {
        width: auto;
        height: auto;
    }

    ul.bb-custom-grid {
        li {
            width: auto;
            height: auto;
        }
    }

    .bb-item {
        display: block;
        position: relative;
    }
}

.bright {
    filter: brightness(0%);
}
