/* book-style.css */
body {
    background: #fdfbf7; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: #4a3e3d;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.topnav {
    width: 100%;
    max-width: 460px;
    margin-bottom: 20px;
    text-align: center;
}
.topnav a {
    color: #8c6239;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
}

h1 {
    color: #8c6239;
    margin: 0 0 20px 0;
    font-size: 1.8rem;
    text-shadow: 1px 1px 0px #fff;
    text-align: center;
}

.book {
    width: 95%;
    max-width: 460px; 
    height: 550px; 
    perspective: 2000px;
    position: relative;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
}

.page {
    grid-area: 1 / 1 / 2 / 2; 
    position: relative;       
    width: 100%;
    height: 100%;             
    padding: 25px 20px;
    box-sizing: border-box;
    background: radial-gradient(circle at 75% 50%, #f7f3e8 0%, #f3ede0 60%, #e8dec9 100%);
    box-shadow: 
        inset 0 0 20px rgba(139, 90, 43, 0.08),
        inset -5px 0 10px rgba(0, 0, 0, 0.02),
        0 6px 20px rgba(139, 90, 43, 0.15);
    border-radius: 8px; 
    transform-origin: left center;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s;
    backface-visibility: hidden;
    overflow-y: auto; 
    overflow-x: hidden;
}

.page::-webkit-scrollbar {
    width: 8px;
}
.page::-webkit-scrollbar-track {
    background: #f1ebd9;
    border-radius: 4px;
}
.page::-webkit-scrollbar-thumb {
    background: #dcd0b4;
    border-radius: 4px;
    border: 1px solid #f1ebd9;
}
.page::-webkit-scrollbar-thumb:hover {
    background: #bfae8f;
}

.page::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 14px;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none; 
}

.page h2 {
    font-size: 1.4rem;
    border-bottom: 2px solid #e5d9be;
    padding-bottom: 8px;
    margin-top: 0;
    color: #8c6239;
    position: sticky;
    top: -25px;
    background: #f6f2e7;
    padding-top: 5px;
    z-index: 10;
}

.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 5px;
}

.polaroid {
    background: white;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 2px;
    margin-bottom: 10px;
}
.polaroid img {
    width: 100%;
    height: auto;
    border-radius: 2px;
}
.container {
    padding: 10px 0 0 0;
    text-align: center;
    font-size: 0.9rem;
}

.page.flipped {
    transform: rotateY(-180deg) scale(0.96);
    opacity: 0; 
    visibility: hidden;
    transition: transform 0.6s, opacity 0.4s, visibility 0.6s;
}

.controls {
    margin-top: 25px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 15px;
    z-index: 100;
}

button {
    padding: 12px 26px;
    font-size: 1rem;
    cursor: pointer;
    background: #e8dec9;
    border: 1px solid #d4c4a8;
    color: #5c4a37;
    font-weight: bold;
    border-radius: 6px;
    transition: background 0.2s;
}
button:active {
    background: #fdfbf7;
}

