
@import url('https://fonts.googleapis.com/css2?family=Doto:wght@100..900&family=Special+Elite&display=swap');

:root {
    --sprite-image: url('/assets/book.webp');
    --page-font-color: #4a3a2c;
    --book-bg-color: #242424;
    --bg-pos: 0% 0%;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    height: 100vh;
    width: 100vw;
    background-color: var(--book-bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
      font-family: "Special Elite", system-ui;
     font-weight: 400;
    color: var(--page-font-color);
    padding: 20px;
}

.book-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1100px;
}

.book {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.page-spread {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    padding: 11vh 4vw 10vh 2vw;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.2s ease-in-out;
}

.page-spread::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--sprite-image);
    background-repeat: no-repeat;
    background-size: 500% 200%;
    background-position: var(--bg-pos);
    transform: scale(1.35) translate(-1.0%, 0.0%);
    z-index: -1;
}

.page-spread.active-page {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.page-spread.animating::before {
    z-index: 3;
}

.page {
    width: 50%;
    height: 100%;
    overflow-y: auto;
    padding: 0 1em;
}

.page::-webkit-scrollbar {
    display: none;
}

.page {
    scrollbar-width: none;
}

.left-page {
    padding-right: 3.5%;
}

.right-page {
    padding-left: 2.5%;
}

.cover-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.cover-title h1 {
    font-size: 2.5em;
    margin: 0;
}

.cover-title p {
    font-size: 1.2em;
}

.page-inner-content {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    font-size: 16px;
}

.text-fade-out {
    opacity: 0;
}

.page-inner-content h2 {
    margin-top: 0;
}

.post-date {
    margin-top: -1em;
    margin-bottom: 2em;
    opacity: 0.8;
}

.post-content {
    line-height: 1.6;
}

.navigation-ui {
    width: 100%;
    max-width: 600px;
    display: grid;
    grid-template-columns: 64px 1fr 64px;
    align-items: center;
    gap: 1rem;
    z-index: 20;
    position: absolute;
    bottom: 0;
}

.nav-btn {
    display: flex;
    width: 64px;
    height: 48px;
    border: 0;
    background-color: transparent;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.1s ease, filter 0.2s ease;
    color: #E2D7C7;
    font-size: xx-large;
}

.nav-btn:hover {
    filter: drop-shadow(0 0 5px white);
}

.nav-btn:active {
    transform: scale(0.9);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: none;
    transform: none;
}

.nav-btn.prev {
    rotate: 180deg;
}

.progress-bar-container {
    border: 1px solid #000;
    background: #444;
    padding: 2px;
    height: 12px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: #f1e2b2;
    transition: width 0.3s ease;
}

.page-spread.animating {
    z-index: 3;
}

.sticker {
    position: relative !important;
    max-width: 120px;
    width: 48px;
    height: 48px;
    filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s ease-in-out;
}

.sticker:not(.no-border) img,
.sticker:not(.no-border) svg {
    display: block;
    width: 100%;
    height: auto;
    -webkit-filter: drop-shadow(1px 1px 0 white) drop-shadow(0px 3px 0 white) drop-shadow(2px -1px 0 white) drop-shadow(-2px -2px 0 white);
    filter: drop-shadow(1px 1px 0 white) drop-shadow(0px 3px 0 white) drop-shadow(2px -1px 0 white) drop-shadow(-2px -2px 0 white)
}

.sticker img,
.sticker svg {
    display: block;
    width: 100%;
    height: auto;
}

.sticker-right {
    float: right;
    margin-left: 10px;
        margin-right: 10px;

    transform: rotate(7deg);
    shape-outside: inset(0 round 10px);
    shape-margin: 10px;
}

.sticker-left {
    float: left;
    margin-right: 10px;
    transform: rotate(-8deg);
    shape-outside: inset(0 round 10px);
    shape-margin: 10px;
}

.sticker-center {
    display: block;
    margin: 20px auto;
    transform: rotate(2deg);
}

.sticker.large {
    width: 120px;
    height: 135px;
}

.sticker.large.sticker-left {
    margin-right: 25px;
    margin-bottom: 26px;
}

.sticker.large.sticker-right {
    margin-left: 25px;
    margin-bottom: 26px;
}


@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .book-wrapper {
        max-width: 100vw;
        height: 90vh;
        margin-bottom: 40px;
    }

    .book {
        height: 100%;
    }

    .page-spread::before {
        transform: scale(1.5) translate(-26%, 0%);
        width: 130vw;
    }

    .page-spread {
        padding: 6vh 8vw;
        display: block;
    }

    .mobile-view .page {
        width: 100%;
        height: 100%;
        padding: 0 14% !important;
    }

    .navigation-ui {
        max-width: 100%;
        grid-template-columns: 50px 1fr 50px;
        bottom: 10px;
    }

    .nav-btn {
        width: 50px;
    }

    .page-inner-content {
        font-size: 16px;
    }

    .post-content {
        line-height: 1.4;
    }

    .cover-title h1 {
        font-size: 1.8em;
    }
}

@media (max-width: 560px) {
    .page-spread::before {
        width: 168vw;
        transform: scale(1.5) translate(-32%, 0%);
    }

    .mobile-view .page {
        padding: 0 3% !important;
    }
}