/* Base styles */
body {
    background-image: url("../images/background.jpg");
    font-family: serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-size: 17px; /* Base font size */
    line-height: 1.6;
    overflow: visible!important;
}

/* Adjust text scaling */
h2 {
    font-size: clamp(0.9rem, 2.5vw, 1.5rem);
    margin-top: clamp(8px, 1.5vw, 20px);
    margin-bottom: clamp(8px, 1.5vw, 15px);
}

p {
    font-size: clamp(0.9rem, 1.5vw, 1.4rem);
    line-height: 1.2;
    margin-bottom: clamp(5px, 1.1vw, 11px);
}

ul li {
    line-height: 1.4;
    font-size: clamp(0.85rem, 1.4vw, 1.2rem);
}


/* Flipbook Container */
#flipbook {
    position: relative;
    width: 100%; /* Increased from 95% */
    height: 95vh; /* Increased from 85vh */
    margin: 5px auto; /* Reduced from 10px */
    box-sizing: border-box;
    transition: all 0.3s ease;
    max-width: 2000px;
}


#flipbook .turn-page {
    background-color: rgba(255,255,255,0);
}

/* Page Styles */
.cover, .left-page, .right-page {
    position: relative;
    overflow: auto;

}

.cover-title {
    color:#fbd36b;
}

.left-page,
.right-page {
    width: 50%;
}

.page-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: fill; /* Makes images cover their container */
    object-position: center; /* Centers the image within its container */

}

/* Overlay Content */
.cover-overlay-content,
.left-overlay-content,
.right-overlay-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 100%; /* Ensure it takes up at least full height */
    z-index: 20;
    padding: 3% 5%;
    box-sizing: border-box;
    pointer-events: auto;
    overflow-y: auto; /* Allow scrolling if needed */
}

/* Overlay Content */
.cover-overlay-content h2,
.left-overlay-content h2,
.right-overlay-content h2 {
    text-align: center;
    line-height: 1.2em;
}

/* Page Content */
.left-page ul {
    width: 90%;
    padding: 0 5%;
    margin: 0;
}

.right-page ul {
    width: 90%;
    padding: 0 5%;
    margin: 0;
}

.cover h1 {
    position: relative;
    margin: 85% auto 0 auto;
    text-align: center;
    font-weight: 300;
    z-index: 20;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    padding-left:10%;
}

.profile {
    max-width: clamp(90px, 20vw, 180px);
    height: auto;
    border-radius: 5px;
    display: block;
    margin: 5% auto 0 auto;
}

.large-profile {
    max-width: clamp(200px, 50vw, 300px);
    height: auto;
    border-radius: 5px;
    display: block;
    margin: 0 auto;
}
.right-text {
    margin-top: 25%;
}

.inner-page {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.7);
    padding: clamp(8px, 1.5vw, 15px);
    border-radius: 10px;
    margin: clamp(5px, 1vw, 10px);
    /* Adjust font size range for better readability at small sizes */
    font-size: clamp(0.75rem, 1.2vw, 1rem);
    height: auto; /* Allow height to adjust to content */
    min-height: calc(100% - 20px); /* Minimum height accounting for margins */
    max-height: none; /* Remove max-height restriction */
    overflow-y: auto;
    box-sizing: border-box;
}

    /* Back Cover */
    #back-cover {
        background: url("../images/book-back.png");
        background-size: 100% 100%; /* Stretches image to fill exactly */
        background-repeat: no-repeat;
        background-position: center;
        width: 100%;
        height: 100%;

    }

    /* Button Controls */
    .button-wrapper {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: clamp(5px, 1vw, 10px);
        padding: 10px;
    }

    .button-wrapper button {
        padding: clamp(8px, 2vw, 10px) clamp(15px, 3vw, 20px);
        margin: clamp(5px, 1vw, 10px);
        background-color: #4a200f;
        color: #fbd36b;
        border: none;
        border-radius: 5px;
        font-size: clamp(14px, 1vw, 16px);
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .button-wrapper button:hover {
        opacity: 0.9;
        transform: scale(1.05);
    }

    .description-ul {
        list-style-type: none;
    }
    /* List Styles */
    .name-list {
        padding-left: clamp(10%, 15%, 20%) !important;
    }

    ul.name-list li a {
        font-size: clamp(12px, 1.1vw, 22px);
        line-height: 2.2;
        text-decoration: none;
    }


    .name-list a {
        text-decoration: none;
        color: black;
        transition: all 0.3s ease;
        pointer-events: auto; /* Explicitly enable pointer events for links */
        cursor: pointer; /* Add cursor pointer for better UX */
        pointer-events: auto;
        position: relative;
        z-index: 30;

    }


    .name-list li a:visited,
    .name-list li a:link {
        text-decoration: none;
        color: black;
    }

    .name-list li a:hover {

    }

    .center-date {
        text-align: center;
        font-weight: 600;
        margin: 0;
        padding: 0;
        font-size: 1rem;
    }
