
body {
    background: #1e222b;
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#canvas {
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* --- turn.js viewport & magazine --- */
.magazine-viewport {
    width: 1098px;       /* Changed from 1200px */
    height: 698px;       /* Changed from 700px */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: visible !important;
    margin: 0;
    padding: 0;
}

.container {
    width: 922px;        /* Changed from 1100px */
    height: 700px;       /* Changed from 700px */
    margin: 0;
    padding: 0;
    position: relative;
    overflow: visible !important;
}

.magazine {
    width: 922px;        /* Changed from 1100px */
    height: 700px;       /* Changed from 700px */
    position: relative;
    margin: 0;
    padding: 0;
    overflow: visible !important;
}

/* --- Page styling --- */
.magazine .page {
    background-color: #faf6ee;
    box-sizing: border-box;
    padding: 2px 4px;
    font-family: "Georgia", "Times New Roman", serif;
    color: #2b2b2b;
    position: absolute;
    width: 461px;        /* Changed from 550px (half of 922) */
    height: 700px;       /* Changed from 700px */
    overflow: hidden !important;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.04);
}

.magazine .even {
    background: linear-gradient(to right, #f2ece0 0%, #faf6ee 6%, #faf6ee 100%);
    left: 0;
}

.magazine .odd {
    background: linear-gradient(to left, #f2ece0 0%, #faf6ee 6%, #faf6ee 100%);
    left: 461px;         /* Changed from 550px */
}
/* --- Page numbers --- */
.page-number {
    position: absolute;
    bottom: 15px;          /* Changed from 24px to 15px */
    font-size: 13px;
    color: #8c8270;
    font-style: italic;
    letter-spacing: 0.5px;
    z-index: 10 !important;
    font-family: "Georgia", serif;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.magazine .page.even .page-number {
    left: 56px;
    right: auto;
}

.magazine .page.odd .page-number {
    right: 56px;
    left: auto;
}

/* --- Navigation buttons --- */
.next-button,
.previous-button {
    width: 44px;
    height: 700px;       /* Changed from 700px to match page height */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 3000 !important;
    opacity: 0.6;
    transition: opacity 0.3s, background 0.3s;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
    user-select: none;
    border-radius: 4px;
}

.next-button { 
    right: -22px;
}

.previous-button { 
    left: -22px;
}

/* Navigation buttons */
.next-button,
.previous-button {
    width: 44px;
    height: 700px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 3000 !important;
    opacity: 0.6;
    transition: opacity 0.3s, background 0.3s;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
    user-select: none;
    border-radius: 4px;
}

.next-button { 
    right: -22px;
}

.previous-button { 
    left: -22px;
}

.next-button:hover,
.previous-button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.25);
}

/* Cover styles */
.weave-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a3a2a;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0, 0, 0, 0.15) 3px, rgba(0, 0, 0, 0.15) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(0, 0, 0, 0.15) 3px, rgba(0, 0, 0, 0.15) 4px),
        repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(255, 255, 255, 0.03) 8px, rgba(255, 255, 255, 0.03) 9px),
        repeating-linear-gradient(-45deg, transparent, transparent 8px, rgba(255, 255, 255, 0.03) 8px, rgba(255, 255, 255, 0.03) 9px),
        linear-gradient(135deg, rgba(34, 68, 45, 0.4) 0%, rgba(26, 58, 42, 0.8) 50%, rgba(34, 68, 45, 0.4) 100%);
    z-index: 1;
}

.cover-image {
    position: absolute;
    top: 30px;
    left: 30px;
    width: calc(100% - 60px);
    height: calc(100% - 60px);
    z-index: 2;
    opacity: 0.75;
    background-image: url('../images/lions.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    mix-blend-mode: overlay;
}

.cover-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    padding: 48px 56px;
}

.cover-title {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 42px;
    font-weight: normal;
    color: #c9a84c;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 15px;
    text-shadow: -1px -1px 0px #e6c866, 2px 2px 4px rgba(0, 0, 0, 0.9), 1px 1px 0px #8b6914, 0 0 25px rgba(201, 168, 76, 0.3);
}

.cover-subtitle {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 18px;
    font-style: italic;
    color: #d4b96a;
    text-shadow: -1px -1px 0px #755f18, 2px 2px 3px rgba(0, 0, 0, 0.8), 1px 1px 0px #8b6914;
    letter-spacing: 2px;
    margin-bottom: 30px;
}

.cover-ornament {
    color: #c9a84c;
    font-size: 16px;
    text-shadow: -1px -1px 0px #e6c866, 2px 2px 3px rgba(0, 0, 0, 0.8), 1px 1px 0px #8b6914;
    letter-spacing: 4px;
}

.cover-border {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    border: 3px double #c9a84c;
    box-shadow: inset 0 0 0 1px rgba(201, 168, 76, 0.3), 0 0 0 1px rgba(201, 168, 76, 0.2);
    z-index: 4;
    pointer-events: none;
}

.corner-ornament {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    color: #c9a84c;
    font-size: 20px;
    text-shadow: -1px -1px 0px #e6c866, 2px 2px 3px rgba(0, 0, 0, 0.8), 1px 1px 0px #8b6914;
}

.corner-ornament.top-left { top: 28px; left: 28px; }
.corner-ornament.top-right { top: 28px; right: 28px; }
.corner-ornament.bottom-left { bottom: 28px; left: 28px; }
.corner-ornament.bottom-right { bottom: 28px; right: 28px; }

/* Back cover */
.weave-pattern-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a3a2a;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0, 0, 0, 0.15) 3px, rgba(0, 0, 0, 0.15) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(0, 0, 0, 0.15) 3px, rgba(0, 0, 0, 0.15) 4px),
        repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(255, 255, 255, 0.03) 8px, rgba(255, 255, 255, 0.03) 9px),
        repeating-linear-gradient(-45deg, transparent, transparent 8px, rgba(255, 255, 255, 0.03) 8px, rgba(255, 255, 255, 0.03) 9px),
        linear-gradient(135deg, rgba(34, 68, 45, 0.4) 0%, rgba(26, 58, 42, 0.8) 50%, rgba(34, 68, 45, 0.4) 100%);
    z-index: 1;
}

.back-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    padding: 40px;
}

.gold-text {
    font-family: "Georgia", serif;
    color: #c9a84c;
    text-shadow: -1px -1px 0px #e6c866, 2px 2px 3px rgba(0, 0, 0, 0.5), 1px 1px 0px #8b6914;
    letter-spacing: 2px;
}

/* Poem pages */
.poem-title {
    font-size: 22px;          /* Slightly smaller */
    font-weight: normal;
    font-style: italic;
    margin-left: 48px;
    margin-bottom: 10px;      /* Less bottom margin */
    color: #111;
    border-bottom: 1px solid #e3dac9;
    padding-bottom: 6px;      /* Less padding */
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

.poem-image-wrapper-first {
    width: 100%;
    height: 80%;              /* More height for image */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.poem-image-wrapper {
    width: 100%;
    height: 90%;
    display: flex;
    opacity: 1.0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.poem-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Title page */
.title-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 60px 40px;
}

.title-page-main {
    font-size: 38px;
    font-weight: normal;
    letter-spacing: 2px;
    margin-bottom: 15px;
    color: #2b2b2b;
}

.title-page-sub {
    font-size: 18px;
    font-weight: normal;
    font-style: italic;
    color: #666;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.title-page-divider {
    color: #c9a84c;
    font-size: 16px;
    letter-spacing: 4px;
    margin: 20px 0;
}

.title-page-publisher {
    font-size: 14px;
    color: #8c8270;
    letter-spacing: 1px;
}

/* Index page */
.index-page {
    padding: 40px 50px;
}

.index-title {
    font-size: 24px;
    font-weight: normal;
    text-align: center;
    letter-spacing: 2px;
    margin-top: 30px;
    margin-bottom: 30px;
    color: #2b2b2b;
    border-bottom: 1px solid #e3dac9;
    padding-bottom: 15px;
}

.index-list {
    list-style: none;
    padding: 10px;
    margin: 10px;
}

.index-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dotted #e3dac9;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.index-item:hover {
    background: rgba(201, 168, 76, 0.1);
    padding-left: 10px;
}

.index-item.active {
    background: rgba(201, 168, 76, 0.15);
    font-weight: bold;
}

.index-title-text {
    color: #2b2b2b;
}

.index-page-number {
    color: #8c8270;
    font-style: italic;
}

/* Dedication */
.dedication-text {
    margin-top: 160px;
    font-style: italic;
    color: #666;
    text-align: center;
    font-size: 18px;
    letter-spacing: 0.8px;
}

/* --- Inside Cover --- */
.inside-cover {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 60px 40px;
    background: #faf6ee;
}

.inside-cover-title {
    font-size: 36px;
    font-weight: normal;
    letter-spacing: 2px;
    margin-bottom: 15px;
    color: #2b2b2b;
}

.inside-cover-subtitle {
    font-size: 18px;
    font-weight: normal;
    font-style: italic;
    color: #666;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.inside-cover-divider {
    color: #c9a84c;
    font-size: 16px;
    letter-spacing: 4px;
    margin: 20px 0;
}

.inside-cover-publisher {
    font-size: 14px;
    color: #8c8270;
    letter-spacing: 1px;
}


/* --- Artist Signature --- */
.signature-container {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.artist-signature {
    max-width: 150px;
    height: auto;
    opacity: 0.8;
    filter: sepia(0.3);
    transition: opacity 0.3s ease;
}

.artist-signature:hover {
    opacity: 1;
}
.dedication-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 40px;
    position: relative;
}

.publisher-imprint {
    position: absolute;
    
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    display: flex;
    flex-direction: column;  /* Stack items vertically */
    align-items: center;
    justify-content: center;
}

.imprint-label {
    font-size: 11px;
    color: #8c8270;
    letter-spacing: 2px;
    font-style: italic;
    margin: 0 0 10px 0;  /* Space between text and image */
    text-transform: uppercase;
    opacity: 0.6;
}

.imprint-image {
    width: 60%;
    max-width: 120px;
    height: auto;
    opacity: 1;
}
.exit-message {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-family: "Georgia", serif;
    font-size: 14px;
    z-index: 10000;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Error message */
.error-message {
    padding: 60px;
    text-align: center;
    font-family: "Georgia", serif;
    color: #666;
    background: #faf6ee;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide scrollbars */
::-webkit-scrollbar {
    display: none;
}

/* Responsive */
@media (max-width: 1100px) {
    .magazine-viewport {
        transform: scale(0.85);
        transform-origin: top center;
    }
}

@media (max-width: 800px) {
    .magazine-viewport {
        transform: scale(0.65);
        transform-origin: top center;
    }
}

@media (max-width: 600px) {
    .magazine-viewport {
        transform: scale(0.45);
        transform-origin: top center;
    }
}