
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


:root {

    --light-color: rgb(245, 245, 245);
    --light-hover: rgba(0, 0, 0, 0.1);

    --book-width: 298px;
    --book-height: 420px;
    --page-offset: 10px;
}


body {
    width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: monospace, sans-serif;
    font-size: 0.5rem;
    transition: background-color 0.3s;
    background-image: url('./assets/images/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}

input {
    display: none;
}

.text-container {
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    position: relative;
    transform: translateZ(1px);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    pointer-events: none;
}




.text-container {
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}


.page-title {
    font-size: 2rem;
    margin-bottom: 20px;
    color: rgb(255 255 255 / 0.8);
    text-transform: uppercase;
    font-family: 'Arvo', "Script MT Bold";
}


.page-text {
    font-size: 1.5rem;
    line-height: 1.6;
    color: #555;
}

#flip_book {
    width: var(--book-width);
    height: var(--book-height);
    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(./assets/images/flip_book_edge_shading.webp);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgb(72, 163, 98);
    background-image: url("assets/images/istockphoto-467429011-612x612.jpg");
    box-shadow: 0 0 5px 0 rgb(25, 25, 25, 0.25);
}

.front_cover {
    position: absolute;
    cursor: pointer;
    transform-origin: center left;
    transition: transform 0.5s;
    z-index: 99;
    will-change: transform;
    transform-style: preserve-3d;
}

.text-container {
    position: relative;
    transform: translateZ(1px);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    pointer-events: none;
}

.front_cover label {
    width: 100%;
    height: 100%;
    position: absolute;
    cursor: pointer;
}

.page {
    width: calc(var(--book-width) - 10px);
    height: calc(var(--book-height) - var(--page-offset) * 2);
    position: absolute;
    top: var(--page-offset);
    left: 1px;
    border-radius: 0 5px 5px 0;
    transform-origin: left;
    transform-style: preserve-3d;
    transform: rotateY(0deg);
    transition-duration: 0.5s;
    will-change: transform;
}

.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: calc(var(--book-width) - 10px);
    height: calc(var(--book-height) - var(--page-offset) * 2);
    position: absolute;
    z-index: 98;
}

.front_content {
    width: calc(var(--book-width) - 11px);
    height: calc(var(--book-height) - var(--page-offset) * 2 - 2px);
    position: absolute;
    top: 1px;
    border-radius: 0 5px 5px 0;
    z-index: 97;
}

.back_content {
    width: calc(var(--book-width) - 11px);
    height: calc(var(--book-height) - var(--page-offset) * 2 - 2px);
    position: absolute;
    top: 1px;
    left: 1px;
    border-radius: 5px 0 0 5px;
    z-index: 97;
}

.back_cover {
    position: relative;
    z-index: -1;
}


#page1 {
    z-index: 8;
}
#page2 {
    z-index: 5;
}
#page3 {
    z-index: 4;
}
#page4 {
    z-index: 3;
}



#cover_checkbox:checked ~ #flip_book {
    transform: translateX(calc(var(--book-width) / 2)) scale(1.7);
}

#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;
}

#page1_checkbox:checked ~ #flip_book #page1 {
    transform: rotateY(-180deg); z-index: 3;
}
#page2_checkbox:checked ~ #flip_book #page2 {
    transform: rotateY(-180deg); z-index: 4;
}
#page3_checkbox:checked ~ #flip_book #page3 {
    transform: rotateY(-180deg); z-index: 5;
}
#page4_checkbox:checked ~ #flip_book #page4 {
    transform: rotateY(-180deg); z-index: 6;
}


#description_panel {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 15vw;
    min-width: 220px;
    max-width: 400px;

    height: 80vh;
    overflow-y: auto;

    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;


    background-color: #c8935a;
    background-image: url('./assets/images/wooden-floor-background_53876-88628.jpg');
    background-size: cover;


    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);


    border: 6px solid #8B5E3C;
}

#description_panel.visible {
    opacity: 1;
}

#description_panel .d-latin {
    font-size: 20px;
    font-style: italic;
    color: #3a1f00;
    margin-bottom: 6px;
}

#description_panel .d-title {
    font-size: 28px;
    font-weight: bold;
    font-family: "Segoe Print";
    color: #1a0a00;
    margin-bottom: 12px;
}

#description_panel .d-label {
    color: #5a3010;
    min-width: 80px;
}

#description_panel .d-val {
    color: #2a1000;
}

#description_panel .d-text {
    font-family: "Segoe Print";
    font-size: 20px;
    line-height: 1.75;
    color: #2a1000;
}

#description_panel .d-divider {
    height: 1px;
    background: rgba(0,0,0,0.2);
    margin: 10px 0;
}

#description_panel .d-row {
    font-size: 15px;
    font-weight: bold;
}

#description_panel .d-latin,
#description_panel .d-title,
#description_panel .d-text,
#description_panel .d-label,
#description_panel .d-val {
    color: black;
    -webkit-text-stroke: 0.2px blue;
}


#description_panel .d-val {
    color: blue;
    -webkit-text-stroke: 0.2px black;
}

