/* DAISYUI */
@plugin "daisyui" {
    themes: light --default, black;
}

:root:has(input.theme-controller[value="black"]:checked) .tooltip,
:root:has(input.theme-controller[value="black"]:checked) .tooltip::before {
    border-radius: 0.25rem !important;
}

.tooltip::after {
    display: none !important;
}

/* GENERAL */
body {
    width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

input {
    display: none;
}

/* FLIP BOOK */
#flip_book {
    width: 298px;
    height: 420px;
    position: relative;
    transition-duration: 1s;
    perspective: 2000px;
}

.front_cover,
.back_cover {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 2.5px 5px 5px 2.5px;
    background-image: url(./images/flip_book_edge_shading.webp);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgb(220, 20, 60);
    box-shadow: 0 0 5px 0 rgb(25, 25, 25, 0.25);
}

/* मूल creative_coding-flip_book रिपोको जस्तै: एउटै सिंगो प्लेन, कुनै blur/preserve-3d/backface split छैन।
   कभर-आर्ट (भए) र edge-shading grafic लाई एउटै background मा तह लगाइन्छ (JS ले coverStyle मार्फत),
   ताकि रातो + edge shading सधैं देखियोस्, अनि फ्लिप animation रिपो जस्तै रहोस्। */
.front_cover {
    position: absolute;
    cursor: pointer;
    transform-origin: center left;
    transition: transform 0.5s;
    z-index: 99;
}

.front_cover label {
    width: 100%;
    height: 100%;
    position: absolute;
    cursor: pointer;
}

.page {
    width: 288px;
    height: 400px;
    position: absolute;
    top: 10px;
    left: 1px;
    border-radius: 0 5px 5px 0;
    background-color: white;
    transform-origin: left;
    transform-style: preserve-3d;
    transform: rotateY(0deg);
    transition-duration: 0.5s;
}

.front_page {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
}

.front_page label {
    width: 100%;
    height: 100%;
    position: absolute;
    cursor: pointer;
    z-index: 100;
}

.back_page {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    transform: rotateY(180deg);
    z-index: 100;
}

.back_page label {
    width: 100%;
    height: 100%;
    position: absolute;
    cursor: pointer;
    z-index: 100;
}

.edge_shading {
    width: 288px;
    height: 400px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 98;
}

.front_content {
    width: 287px;
    height: 398px;
    position: absolute;
    top: 1px;
    left: 0;
    border-radius: 0 5px 5px 0;
    z-index: 97;
}

.back_content {
    width: 287px;
    height: 398px;
    position: absolute;
    top: 1px;
    left: 1px;
    border-radius: 5px 0 0 5px;
    z-index: 97;
}

.back_cover {
    position: relative;
    z-index: -1;
}

#cover_checkbox:checked~#flip_book {
    transform: translateX(144px)
}

#cover_checkbox:checked~#flip_book .front_cover {
    transform: rotateY(-180deg);
    transition: transform 1.5s, z-index 0.5s 0.5s;
    z-index: 1;
}
#cover_checkbox:checked~#flip_book #cover {
    width: 80%;
    height: 80%;
    position: absolute;
}

/* पाना-अनुसारको z-index (#pageN { z-index: ... } र #pageN_checkbox:checked~#flip_book #pageN { transform:...; z-index:...; })
   book.html को JS ले content को मात्रा अनुसार गतिशील रूपमा <style> मा जोड्छ, किनभने पानाको संख्या स्थिर छैन। */

/* TEXT PAGE CONTENT (फोटो/लेख भएको पाना) */
.book-page-text {
    width: 287px;
    height: 398px;
    position: absolute;
    top: 1px;
    left: 0;
    background: #fdfaf5;
    box-sizing: border-box;
    padding: 22px 16px;
    overflow: hidden;
    font-family: 'Khand', 'Noto Sans Devanagari', sans-serif;
    font-size: 0.56rem;
    line-height: 1.4;
    text-align: justify;
    color: #1a1a1a;
    z-index: 97;
}

.book-page-text.book-front {
    border-radius: 0 5px 5px 0;
}

.book-page-text.book-back {
    left: 1px;
    border-radius: 5px 0 0 5px;
}

.book-page-text img {
    max-width: 100%;
    border-radius: 6px;
    display: block;
    margin: 6px 0;
}

.book-page-text p {
    margin: 0 0 0.6em;
}

.book-cover-title {
    color: #fff;
    font-family: 'Noto Serif Devanagari', serif;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    padding: 0 16px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}