/* ==========================================================================
   Core Values High-Fidelity HTML Book Replica Stylesheet
   ========================================================================== */

/* Layout & Viewport Reset */
body#page-core-values-replica {
    overflow: hidden !important;
    background-color: #f1f5f9;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 0 !important;
}

.core-values-viewport {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 85px);
    margin-top: 85px;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

@media (min-width: 992px) {
    .core-values-viewport {
        height: calc(100vh - 90px);
        margin-top: 90px;
    }
}

/* Book Viewer Section */
.book-viewer-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background-color: #cbd5e1;
    /* Dark slate to separate A4 pages */
    position: relative;
}

/* Controls Toolbar */
.book-toolbar {
    height: 52px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid #94a3b8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 5;
    flex-shrink: 0;
}

.toolbar-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
    letter-spacing: 0.5px;
}

.toolbar-center,
.toolbar-right {
    display: flex;
    align-items: center;
}

.toolbar-text {
    font-family: 'Roboto', sans-serif;
    font-size: 0.85rem;
    color: #475569;
    font-weight: 500;
    margin: 0 10px;
    min-width: 45px;
    text-align: center;
}

#page-num-indicator {
    min-width: 80px;
}

.toolbar-btn {
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s ease;
    outline: none;
    margin: 0 2px;
}

.toolbar-btn:hover {
    background-color: #f1f5f9;
    color: #007aff;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.toolbar-btn:active {
    transform: translateY(0);
    background-color: #e2e8f0;
}

#mobile-toc-toggle {
    width: auto;
    height: 34px;
    padding: 0 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-color: #007aff;
    color: #007aff;
    gap: 6px;
}

#mobile-toc-toggle:hover {
    background-color: #007aff;
    color: #fff;
}

/* Book Pages Scroll Container */
.book-scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    scroll-behavior: auto;
}

/* High-Fidelity A4 Page Styling */
.book-page-wrapper {
    /* Height is managed dynamically by JS (scaledPageHeight + margin).
       Default height at 100% scale = 1130px + 30px margin. */
    height: 1160px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    overflow: visible; /* Allow scaled content to be visible outside natural bounds */
    flex-shrink: 0;   /* Prevent flex container from squishing pages */
}

.book-page {
    width: 800px;
    height: 1130px;
    background-color: #ffffff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    padding: 80px 90px;
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Clip content to A4 boundary */
    flex-shrink: 0;  /* Never let flexbox shrink the page */
    /* transform and transform-origin are set dynamically by JS */
    transform-origin: top center;
    /* Default theme variables */
    --lens-primary: #7c3aed;
    --lens-secondary: #f5f3ff;
    --lens-text: #4c1d95;
    --lens-border: #ddd6fe;
}

/* Page Header & Footer */
.book-page-header {
    font-family: 'Raleway', sans-serif;
    font-size: 0.72rem;
    color: #94a3b8;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 700;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
}

.book-page-footer {
    font-family: 'Raleway', sans-serif;
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 700;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
    margin-top: auto;
    display: flex;
    justify-content: center;
}

.book-page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Book Cover Page Styling */
.book-page.cover-page {
    background: radial-gradient(circle at 30% 20%, #1e3a8a 0%, #0f172a 100%);
    color: #ffffff;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    padding: 80px 60px;
    display: flex;
    flex-direction: column;
}

.cover-logo-container {
    margin-top: 40px;
    margin-bottom: 80px;
}

.om-logo-cover {
    height: 90px;
    width: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.cover-title {
    font-family: 'Volkhov', Georgia, serif;
    font-size: 3.6rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
}

.cover-diamonds {
    font-size: 1.4rem;
    color: #ffffff;
    margin-bottom: 80px;
    letter-spacing: 12px;
}

.cover-footer-text {
    margin-top: auto;
    font-family: 'Volkhov', Georgia, serif;
    font-size: 1.25rem;
    color: #ffffff;
    font-style: italic;
    margin-bottom: 40px;
    letter-spacing: 0.5px;
}

/* Page Header & Footer Custom Layouts */
.header-logo-centered {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.om-logo-header {
    height: 32px;
    width: auto;
}

.book-page-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Raleway', sans-serif;
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 700;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    margin-top: auto;
}

.footer-left {
    color: #006fc0;
    letter-spacing: 1px;
}

.footer-right {
    color: #3b82f6;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
}

.footer-logo {
    height: 1.2em;
    width: auto;
    margin-right: 6px;
    vertical-align: middle;
}

/* Page 2: Plural Sight Styling */
.plural-sight-content {
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.plural-sight-title {
    font-family: 'Volkhov', Georgia, serif;
    font-size: 2.2rem;
    font-style: italic;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 30px;
    text-align: center;
}

.plural-sight-lead {
    font-family: 'Volkhov', Georgia, serif;
    font-size: 1.2rem;
    font-style: italic;
    color: #0f172a;
    line-height: 1.6;
    text-align: center;
    max-width: 90%;
    margin-bottom: 60px;
}

.plural-sight-quote-box {
    background-color: #eff6ff;
    border-left: 6px solid #1d4ed8;
    padding: 30px 40px;
    border-radius: 4px;
    width: 100%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.plural-sight-quote-text {
    font-family: 'Volkhov', Georgia, serif;
    font-size: 1.15rem;
    font-style: italic;
    color: #1e293b;
    line-height: 1.6;
    margin-bottom: 15px;
}

.plural-sight-quote-author {
    font-family: 'Raleway', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: right;
    margin-bottom: 0;
}

/* Page 3: Lenses TOC Styling */
.lenses-content {
    padding: 30px 40px;
}

.lenses-title {
    font-family: 'Volkhov', Georgia, serif;
    font-size: 2rem;
    font-style: italic;
    color: #1e3a8a;
    margin-bottom: 40px;
    padding-left: 10px;
}

.lenses-vertical-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 800px;
}

.lens-item {
    display: flex;
    align-items: center;
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 8px;
    padding-left: 10px;
}

.lens-num {
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    color: #2563eb;
    width: 45px;
}

.lens-name {
    font-family: 'Roboto', sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
    color: #1e293b;
}

/* Pages 4 & 5: Purple Theme Styling */
.purple-theme-content {
    padding: 20px 10px;
}

.purple-header-block {
    background-color: var(--lens-primary);
    padding: 20px 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.purple-title {
    font-family: 'Volkhov', Georgia, serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0;
}

.purple-quote-box {
    background-color: var(--lens-secondary);
    border-left: 6px solid var(--lens-primary);
    padding: 20px 25px;
    margin-bottom: 30px;
}

.purple-quote-text {
    font-family: 'Volkhov', Georgia, serif;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--lens-text);
    line-height: 1.6;
    margin-bottom: 0;
}

.purple-subheading {
    font-family: 'Raleway', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--lens-primary);
    margin-top: 35px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--lens-border);
    padding-bottom: 8px;
}

/* Drop Cap Styling */
.has-drop-cap {
    position: relative;
}

.drop-cap {
    font-family: 'Volkhov', Georgia, serif;
    font-size: 3.5rem;
    font-weight: 700;
    float: left;
    line-height: 0.8;
    margin-top: 6px;
    margin-right: 12px;
    color: #5b21b6;
}

/* Typography styles */
.book-section-title {
    font-family: 'Volkhov', Georgia, serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 25px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
}

.book-subtitle {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #007aff;
    letter-spacing: 0.5px;
    margin-top: 10px;
    margin-bottom: 18px;
}

.book-body-text {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    color: #334155;
    line-height: 1.65;
    margin-bottom: 14px;
    text-align: justify;
}

.book-bold-lead {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.book-quote-box {
    background-color: #f8fafc;
    border-left: 4px solid #007aff;
    padding: 18px 24px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    display: flex;
    flex-direction: column;
}

.book-quote-text {
    font-family: 'Volkhov', Georgia, serif;
    font-size: 1.05rem;
    font-style: italic;
    color: #1e293b;
    line-height: 1.6;
}

.book-quote-author {
    font-family: 'Raleway', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    color: #64748b;
    text-align: right;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Book Content List */
.book-list {
    margin-bottom: 20px;
    padding-left: 20px;
}

.book-list li {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    color: #334155;
    line-height: 1.65;
    margin-bottom: 10px;
    position: relative;
    list-style-type: disc;
}

.book-list li::marker {
    color: var(--lens-primary);
}

.book-list.numbered-list {
    padding-left: 0;
    list-style: none;
}

.book-list.numbered-list li {
    list-style-type: none;
    padding-left: 35px;
    position: relative;
}

.book-list.numbered-list li::before {
    content: attr(data-number);
    position: absolute;
    left: 0;
    top: 0;
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    color: var(--lens-primary, #007aff);
    font-size: 0.92rem;
}

/* Eighteen Lenses Grid Table of Contents */
.lenses-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-row-gap: 15px;
    grid-column-gap: 40px;
    margin-top: 30px;
}

.lens-grid-item {
    display: flex;
    align-items: center;
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 8px;
}

.lens-grid-num {
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    color: #007aff;
    width: 30px;
    flex-shrink: 0;
}

.lens-grid-name {
    font-family: 'Roboto', sans-serif;
    font-size: 0.92rem;
    font-weight: 500;
    color: #334155;
}

/* Quotes Page formatting */
.quotes-grid-container {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.quote-row {
    padding: 12px 20px;
    border-radius: 0px;
    border: none;
}

.quote-row:nth-child(odd) {
    background-color: #eaeffa;
}

.quote-row:nth-child(even) {
    background-color: #fefefe;
}

.hindi-quote-container {
    padding: 12px 20px;
    margin: 0;
    text-align: center;
}

.hindi-quote-text {
    font-family: 'Volkhov', Georgia, serif;
    font-size: 1.08rem;
    line-height: 1.8;
    color: #0f172a;
    margin-bottom: 8px;
}

/* Table of Contents Side (Right) */
.toc-section {
    width: 320px;
    border-left: 1px solid #cbd5e1;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
    z-index: 10;
}

.toc-header {
    height: 52px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #cbd5e1;
    background-color: #fff;
    flex-shrink: 0;
}

.toc-header h3 {
    font-family: 'Volkhov', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.toc-list-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

/* Scrollbars */
.toc-list-wrapper::-webkit-scrollbar {
    width: 6px;
}

.toc-list-wrapper::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.toc-list-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.toc-list-wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    display: flex;
    align-items: flex-start;
    padding: 11px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    color: #475569;
}

.toc-item:hover {
    background-color: #f8fafc;
    border-left-color: #cbd5e1;
    color: #0f172a;
}

.toc-item.active {
    background-color: #eff6ff;
    border-left-color: #007aff;
    color: #1d4ed8;
}

.toc-num {
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 0.85rem;
    color: #007aff;
    width: 24px;
    margin-right: 8px;
    flex-shrink: 0;
}

.toc-label {
    font-family: 'Roboto', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.35;
}

.toc-item.active .toc-label {
    font-weight: 700;
}

.toc-divider {
    background-color: #f1f5f9;
    color: #64748b;
    font-family: 'Raleway', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 8px 20px;
    margin: 14px 0 6px 0;
    letter-spacing: 1px;
    cursor: default;
    pointer-events: none;
    border-left: none !important;
}

/* Off-canvas mobile behavior for TOC Drawer */
@media (max-width: 991px) {
    .toc-section {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 310px;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1050;
    }

    .toc-section.toc-open {
        transform: translateX(0);
    }

    .mobile-toc-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(2px);
        display: none;
        z-index: 1040;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-toc-backdrop.show-backdrop {
        display: block;
        opacity: 1;
    }
}

/* Adjustments for extra small devices */
@media (max-width: 575px) {
    .book-scroll-container {
        padding: 10px;
    }

    .book-toolbar {
        padding: 0 8px;
    }

    .toolbar-text {
        margin: 0 4px;
        min-width: 36px;
    }
}

/* Do not include the book page header from page 3 onwards */
.book-page-wrapper:nth-child(n+3) .book-page-header {
    display: none !important;
}

/* Page-by-Page Custom Theme Overrides (Pages 4 to 25) */
.theme-page-4 {
    --lens-primary: #4a0082;
    --lens-secondary: #ece3f5;
    --lens-text: #4a0082;
    --lens-border: #ece3f5;
}

.theme-page-5 {
    --lens-primary: #0d46a0;
    --lens-secondary: #e2ebf7;
    --lens-text: #0d46a0;
    --lens-border: #e2ebf7;
}

.theme-page-6 {
    --lens-primary: #4a0082;
    --lens-secondary: #ece3f5;
    --lens-text: #4a0082;
    --lens-border: #ece3f5;
}

.theme-page-7 {
    --lens-primary: #252525;
    --lens-secondary: #ededed;
    --lens-text: #252525;
    --lens-border: #ededed;
}

.theme-page-8 {
    --lens-primary: #5a636f;
    --lens-secondary: #f1f4f7;
    --lens-text: #5a636f;
    --lens-border: #f1f4f7;
}

.theme-page-9 {
    --lens-primary: #252525;
    --lens-secondary: #ededed;
    --lens-text: #252525;
    --lens-border: #ededed;
}

.theme-page-10 {
    --lens-primary: #283592;
    --lens-secondary: #e2e7f5;
    --lens-text: #283592;
    --lens-border: #e2e7f5;
}

.theme-page-11 {
    --lens-primary: #455a63;
    --lens-secondary: #ebeef0;
    --lens-text: #455a63;
    --lens-border: #ebeef0;
}

.theme-page-12 {
    --lens-primary: #b8850a;
    --lens-secondary: #faf3dc;
    --lens-text: #b8850a;
    --lens-border: #faf3dc;
}

.theme-page-13 {
    --lens-primary: #b8850a;
    --lens-secondary: #faf3dc;
    --lens-text: #b8850a;
    --lens-border: #faf3dc;
}

.theme-page-14 {
    --lens-primary: #228621;
    --lens-secondary: #e9f3e9;
    --lens-text: #228621;
    --lens-border: #e9f3e9;
}

.theme-page-15 {
    --lens-primary: #0d46a0;
    --lens-secondary: #e2ebf7;
    --lens-text: #0d46a0;
    --lens-border: #e2ebf7;
}

.theme-page-16 {
    --lens-primary: #0d46a0;
    --lens-secondary: #e2ebf7;
    --lens-text: #0d46a0;
    --lens-border: #e2ebf7;
}

.theme-page-17 {
    --lens-primary: #0d46a0;
    --lens-secondary: #e2ebf7;
    --lens-text: #0d46a0;
    --lens-border: #e2ebf7;
}

.theme-page-18 {
    --lens-primary: #0d46a0;
    --lens-secondary: #e2ebf7;
    --lens-text: #0d46a0;
    --lens-border: #e2ebf7;
}

.theme-page-19 {
    --lens-primary: #0d46a0;
    --lens-secondary: #e2ebf7;
    --lens-text: #0d46a0;
    --lens-border: #e2ebf7;
}

.theme-page-20 {
    --lens-primary: #f5941d;
    --lens-secondary: #fdf4e8;
    --lens-text: #f5941d;
    --lens-border: #fdf4e8;
}

.theme-page-21 {
    --lens-primary: #b71c1c;
    --lens-secondary: #fae6e6;
    --lens-text: #b71c1c;
    --lens-border: #fae6e6;
}

.theme-page-22 {
    --lens-primary: #b71c1c;
    --lens-secondary: #fae6e6;
    --lens-text: #b71c1c;
    --lens-border: #fae6e6;
}

.theme-page-23 {
    --lens-primary: #228621;
    --lens-secondary: #e9f3e9;
    --lens-text: #228621;
    --lens-border: #e9f3e9;
}

.theme-page-24 {
    --lens-primary: #4a0082;
    --lens-secondary: #ece3f5;
    --lens-text: #4a0082;
    --lens-border: #ece3f5;
}

.theme-page-25 {
    --lens-primary: #4a0082;
    --lens-secondary: #ece3f5;
    --lens-text: #4a0082;
    --lens-border: #ece3f5;
}

.theme-page-26 {
    --lens-primary: #283592;
    --lens-secondary: #e2e7f5;
    --lens-text: #283592;
    --lens-border: #e2e7f5;
}

/* Favorite Quotes Pages Theme (Pages 27 to 34) */
.theme-page-27, .theme-page-28, .theme-page-29, .theme-page-30, .theme-page-31, .theme-page-32, .theme-page-33, .theme-page-34 {
    --lens-primary: #283592;
    --lens-secondary: #e2e7f5;
    --lens-text: #283592;
    --lens-border: #e2e7f5;
}