:root {
    --ink: #393939;
    --bottom-border: 2px;
}

/* Base style for mobile devices */
body {
    display: flex;
    flex-direction: column;
    height: 100dvh;       
    margin: 0px;
    padding: 24px;
    box-sizing: border-box;
    /* font-family: "Jim Nightshade", cursive; */
    font-family: "Quintessential", serif;
    color: #393939;
    white-space: pre-line;
    /* overflow: hidden; */
}

#loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    z-index: 3;
    background-color: white;
    font-size: 20px;
}


h1 {
    text-align: center;
    font-size: 2rem;
    filter: url(#text);
}

.content {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    /* overflow: hidden; */
    min-height: 0;
}

video {
    width: 100%;
    max-width: 300px;
    height: auto;
    opacity: 0;
    transition: opacity 1.5s linear;
}

.book-wrapper {
    /* overflow: hidden; */
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    width: 100%;
    max-width: 950px;
    gap: 16px;
}

#book {
    overflow: hidden;
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    opacity: 0;
    transition: opacity 2.5s linear;
    transform: translateY(500px);
    transition: transform 1s ease-out;
}


.book-border {
    position: absolute;
    width: 100%;
    height: 100%;
    inset: 0;
    pointer-events: none;
    filter: url(#pencil);
}

path {
    stroke: #393939;
    stroke-width: 2;
    /* fill: url(#paper); */
    fill: none;
}

#page {
    /* flex: 1; */
    min-height: 0;
    overflow-y: auto;
    /* max-height: 100%; */
    height: 100%;
    /* box-sizing: border-box; */
    margin: 24px 12px;
    padding: 24px 24px;
    z-index: 2;
    font-size: 1.25rem;
    filter: url(#text);
    transition: opacity .6s ease-in-out;
    /* background-color: blue; */
}

.tooltiptext {
    visibility: hidden;
    font-size: 16px;
    color: white;
    background-color: var(--ink);
    text-align: center;
    padding: 6px 12px;
    border-radius: 4px;
    position: absolute;
    top: -42px;
    width: 60px;
}

#prev .tooltiptext {
    left: -15px;
}

#menu .tooltiptext, #shuffle .tooltiptext   {
    left: -30px;
}

#next .tooltiptext {
    left: -60px;
}

.footer {
    display: flex; 
    flex-direction: row;
    gap: 16px;
    justify-content: space-between;
    padding-bottom: 8px;
}

.footer-center {
    display: flex;
    flex-direction: row;
    gap: 16px;
}

button {
    position: relative;
    font-family: "Felipa";
    font-size: 1.25rem;
    color: #393939;
    background: transparent;
    border: none;
    height: 40px;
    width: 40px;
    opacity: 0;
    transition: opacity .5s linear;
    transform: translateY(48px);
    transition: transform .5s ease-out;
}

button::before {
    content:"";
    position: absolute;
    inset: 0;
    border: 2px solid var(--ink);
    border-bottom: var(--bottom-border) solid var(--ink);
    filter: url(#pencil);
}

button:hover {
    cursor: pointer;
}

button:active {
    background-color:  #3939391d;
}

button span {
    filter: url(#text);
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
}

ul {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

li:hover {
    text-decoration: underline;
    cursor: pointer;
}


/* For devices with a minimum width of 768px (Medium) */
@media screen and (min-width: 768px) {
    body {
        padding: 40px 80px;
    }

    .title {
        font-size: 2.5rem;
    }

    video {
        max-width: 450px;
        height: auto;
    }
}


/* For devices with a minimum width of 1400px (Large) */
@media screen and (min-width: 1400px) {
    .content {
        flex-flow: row; 
        justify-content: center;
        flex-direction: row-reverse;
        gap: 80px;
    }

    h1 {
        font-size: 3rem;
    }

    video {
        max-width: 500px;
    }

    .book-wrapper {
        height: 100%;
        max-width: 500px;
        max-height: 650px;
    }

    video {
        max-width: 700px;
        height: auto;
    }
}


/* only display tooltips on hover devices */
@media (hover: hover) {
    button:hover .tooltiptext {
        visibility: visible;
    }

    button:hover::before {
        content:"";
        border-bottom-width: 4px;
    }
}





