﻿/*
 * Hebrew Bible Studies - Main Stylesheet
 * Navy Blue Theme with Solid Colors
 */

/* ============================================
   Font Face Declarations
   ============================================ */
@font-face {
    font-family: 'David Libre';
    src: url('/assets/fonts/DavidLibre.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ============================================
   CSS Custom Properties (Variables)
   ============================================ */
:root {
    /* Primary Colors */
    --primary: #8B7D6B;
    --primary-light: #A89968;
    --primary-dark: #6B6252;
    
    /* Accent Colors */
    --accent: #D4A574;
    --accent-light: #E8B899;
    --accent-dark: #B87E4F;
    
    /* Neutral Colors */
    --soft-cream: #F5F1E8;
    --warm-gray: #9A8B7D;
    --light-gray: #E8E3DB;
    --medium-gray: #A89D93;
    --dark-gray: #5D5551;
    
    /* Background Colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: var(--soft-cream);
    --bg-dark: var(--primary);
    
    /* Text Colors */
    --text-primary: #1F2937;
    --text-secondary: #4B5563;
    --text-muted: var(--warm-gray);
    --text-light: #FFFFFF;
    
    /* Border Colors */
    --border-light: #E5E7EB;
    --border-medium: #D1D5DB;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --font-heading: 'David Libre', serif;
    --font-body: 'David Libre', serif;
    --font-weight-base: 500;
    --font-size-base: 1.125rem;
    --line-height-base: 1.8;
    
    /* Spacing */
    --section-spacing: 6rem;
    --container-padding: 1.5rem;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
}

/* RTL Support */
[dir="rtl"] {
    --text-align: right;
}

[dir="ltr"] {
    --text-align: left;
}

/* Hebrew Version - Larger and Bolder Text */
[dir="rtl"] {
    --font-size-base: 1.25rem;
}

[dir="rtl"] body {
    font-size: var(--font-size-base);
    font-weight: 500;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
    font-weight: 700;
}

[dir="rtl"] p {
    font-weight: var(--font-weight-base);
}

[dir="rtl"] .hero-title {
    font-size: clamp(2.5rem, 6.5vw, 4rem);
    font-weight: 700;
}

[dir="rtl"] .hero-subtitle {
    font-size: clamp(1.3rem, 3vw, 1.7rem);
    font-weight: 600;
}

[dir="rtl"] .hero-tagline {
    font-size: clamp(1.15rem, 2.5vw, 1.5rem);
    font-weight: 700;
}

[dir="rtl"] .section-title {
    font-size: clamp(2.4rem, 5.8vw, 3.8rem);
    font-weight: 700;
}

[dir="rtl"] .section-subtitle {
    font-size: clamp(1.2rem, 2.8vw, 1.6rem);
    font-weight: 600;
}

[dir="rtl"] .feature-title {
    font-size: clamp(1.45rem, 3.3vw, 1.8rem);
    font-weight: 700;
}

[dir="rtl"] .feature-description {
    font-size: clamp(1.15rem, 2.3vw, 1.35rem);
    font-weight: 500;
}

[dir="rtl"] .nav-link {
    font-size: clamp(1.25rem, 2.3vw, 1.5rem);
    font-weight: 600;
}

/* Responsive nav-link sizing for Hebrew */
@media (max-width: 1200px) {
    [dir="rtl"] .nav-link {
        font-size: clamp(1.15rem, 2vw, 1.35rem);
        padding: 0.4rem 0.8rem !important;
    }
}

@media (max-width: 992px) {
    [dir="rtl"] .nav-link {
        font-size: clamp(1.05rem, 1.8vw, 1.2rem);
        padding: 0.35rem 0.7rem !important;
    }
}

@media (max-width: 768px) {
    [dir="rtl"] .nav-link {
        font-size: clamp(1rem, 2vw, 1.15rem);
        padding: 0.3rem 0.6rem !important;
    }
}

@media (max-width: 480px) {
    [dir="rtl"] .nav-link {
        font-size: 0.95rem;
        padding: 0.25rem 0.5rem !important;
    }
}

[dir="rtl"] .form-label {
    font-size: clamp(1.2rem, 2vw, 1.4rem);
    font-weight: 700;
}

[dir="rtl"] .chapter-title {
    font-size: clamp(1.5rem, 3.3vw, 1.85rem);
    font-weight: 700;
}

[dir="rtl"] .chapter-description {
    font-size: clamp(1.15rem, 2.2vw, 1.35rem);
    font-weight: 500;
}

/* ============================================
   Base Styles
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: var(--font-weight-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--primary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    z-index: 9999;
}

.skip-link:focus {
    top: 0;
}

/* ============================================
   Header & Navigation
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.navbar {
    padding: 1rem 0;
}

/* Responsive navbar padding */
@media (max-width: 768px) {
    .navbar {
        padding: 0.75rem 0;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0.5rem 0;
    }
}

[dir="rtl"] .navbar-collapse {
    margin-right: auto !important;
    margin-left: 0 !important;
}

[dir="rtl"] .navbar-nav {
    margin-left: 0 !important;
    margin-right: auto !important;
}

[dir="rtl"] .navbar-nav.ms-auto {
    margin-right: auto !important;
    margin-left: inherit !important;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 700;
    color: var(--primary) !important;
    letter-spacing: 0.5px;
}

[dir="rtl"] .navbar-brand {
    font-size: clamp(1.5rem, 3vw, 1.9rem);
    font-weight: 700;
}

/* Responsive navbar brand sizing */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: clamp(1rem, 2vw, 1.3rem);
    }
    
    [dir="rtl"] .navbar-brand {
        font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    }
}

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    [dir="rtl"] .navbar-brand {
        font-size: 1.2rem;
    }
}

.navbar-brand:hover {
    color: var(--accent) !important;
}

.navbar-toggler {
    border: 1px solid var(--primary);
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 31, 84, 0.25);
}

.navbar-toggler svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary);
}

.nav-link {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 500;
    color: var(--text-secondary) !important;
    padding: 0.5rem 1rem !important;
    position: relative;
    transition: color var(--transition-fast);
}

/* Responsive nav-link sizing */
@media (max-width: 1200px) {
    .nav-link {
        font-size: clamp(1rem, 1.8vw, 1.2rem);
        padding: 0.4rem 0.8rem !important;
    }
}

@media (max-width: 992px) {
    .nav-link {
        font-size: clamp(0.95rem, 1.6vw, 1.1rem);
        padding: 0.35rem 0.7rem !important;
    }
}

@media (max-width: 768px) {
    .nav-link {
        font-size: clamp(0.9rem, 2vw, 1rem);
        padding: 0.3rem 0.6rem !important;
    }
}

@media (max-width: 480px) {
    .nav-link {
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem !important;
    }
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary) !important;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

/* Search in Navigation */
.nav-search {
    position: relative;
}

.search-form {
    position: relative;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.search-input {
    border: none !important;
    background: transparent !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.9rem;
    width: 180px;
    transition: width var(--transition-normal);
}

.search-input:focus {
    width: 220px;
    box-shadow: none !important;
}

/* Responsive search input */
@media (max-width: 768px) {
    .search-input {
        width: 140px;
        padding: 0.4rem 0.6rem !important;
        font-size: 0.85rem;
    }
    
    .search-input:focus {
        width: 180px;
    }
}

@media (max-width: 480px) {
    .search-input {
        width: 100px;
        padding: 0.35rem 0.5rem !important;
        font-size: 0.8rem;
    }
    
    .search-input:focus {
        width: 130px;
    }
}

.search-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 0.75rem;
    color: var(--warm-gray);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.search-btn:hover {
    color: var(--primary);
}

.search-btn svg {
    width: 18px;
    height: 18px;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
}

.search-suggestions.show {
    display: block;
}

.search-suggestion-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
    transition: background-color var(--transition-fast);
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-item:hover {
    background: var(--bg-secondary);
}

.search-suggestion-item i {
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.suggestion-content {
    flex: 1;
}

.suggestion-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.suggestion-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Language Dropdown */
.language-dropdown .nav-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.language-dropdown svg {
    width: 18px;
    height: 18px;
}

.language-dropdown .dropdown-menu {
    min-width: 120px;
}

.language-dropdown .dropdown-item.active {
    background: var(--primary);
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
    padding: clamp(3rem, 7vw, 6.5rem) 0;
    background: url("../assets/image/backround-hero-section.png") center/cover no-repeat;
    position: relative;
    overflow: hidden;
    min-height: 100vh; /* full screen height */
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(135deg, rgba(245, 241, 232, 0.92) 0%, rgba(248, 244, 236, 0.9) 45%, rgba(233, 222, 205, 0.75) 100%),
        radial-gradient(circle at 12% 18%, rgba(139, 125, 107, 0.18) 0, transparent 40%),
        radial-gradient(circle at 82% 12%, rgba(212, 165, 116, 0.2) 0, transparent 45%),
        radial-gradient(circle at 80% 82%, rgba(168, 153, 104, 0.22) 0, transparent 45%);
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    grid-column: span 7;
    animation: slideInLeft 0.8s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.eyebrow-icon {
    width: 18px;
    height: 18px;
}

.hero-title {
    font-size: clamp(2.2rem, 4.2vw, 3.4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: var(--primary);
}

.hero-subtitle {
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 2.2vw, 1.6rem);
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.hero-tagline {
    font-size: clamp(0.95rem, 1.6vw, 1.05rem);
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 520px;
    line-height: 1.8;
}

.hero-author {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.hero-author-label {
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.hero-author-name {
    font-weight: 600;
    font-size: 1.3rem;
}

[dir="rtl"] .hero-author-name {
    font-size: 1.6rem;
}

.hero-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0 0 2rem;
    padding: 0;
    list-style: none;
}

.hero-topics li {
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--primary-dark);
    border: 1px solid rgba(139, 125, 107, 0.2);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    animation: fadeUp 0.6s ease-out both;
}

.hero-topics li:nth-child(2) { animation-delay: 0.05s; }
.hero-topics li:nth-child(3) { animation-delay: 0.1s; }
.hero-topics li:nth-child(4) { animation-delay: 0.15s; }
.hero-topics li:nth-child(5) { animation-delay: 0.2s; }
.hero-topics li:nth-child(6) { animation-delay: 0.25s; }
.hero-topics li:nth-child(7) { animation-delay: 0.3s; }
.hero-topics li:nth-child(8) { animation-delay: 0.35s; }
.hero-topics li:nth-child(9) { animation-delay: 0.4s; }

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Book Display */
.hero-media {
    grid-column: span 5;
    animation: slideInRight 0.8s ease-out 0.2s backwards;
    display: flex;
    justify-content: center;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


.hero-book-display {
    position: relative;
    max-width: 520px;
    width: 100%;
}

.book-cover-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
    transform: translateZ(0);
    transition: transform var(--transition-slow);
}

.hero-book-display:hover .book-cover-image {
    transform: scale(1.02);
}

/* Decorative Elements (Coins & Archaeological Photos) */
.hero-decorations {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hero-coin,
.hero-artifact {
    position: absolute;
    animation: floatElement 6s ease-in-out infinite;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

.hero-coin.old-coin {
    width: 150px;
    height: 150px;
    top: -12%;
    right: -10%;
    animation-delay: 0s;
    z-index: 2;
}

.hero-coin.modern-coin {
    width: 140px;
    height: 140px;
    bottom: -12%;
    left: -12%;
    animation-delay: 1.5s;
    z-index: 2;
}

/* Archaeological Photos */
.hero-artifact.artifact-1 {
    width: 120px;
    height: 120px;
    top: 5%;
    left: -15%;
    animation-delay: 0.5s;
    z-index: 1;
}

.hero-artifact.artifact-3 {
    width: 130px;
    height: 130px;
    bottom: 5%;
    right: -8%;
    animation-delay: 3s;
    z-index: 1;
}

@keyframes floatElement {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-15px) rotate(5deg);
    }
    50% {
        transform: translateY(-25px) rotate(0deg);
    }
    75% {
        transform: translateY(-15px) rotate(-5deg);
    }
}

@media (max-width: 991.98px) {
    .hero-coin.old-coin {
        width: 120px;
        height: 120px;
        top: -10%;
        right: -8%;
    }
    
    .hero-coin.modern-coin {
        width: 110px;
        height: 110px;
        bottom: -10%;
        left: -10%;
    }
    
    .hero-artifact.artifact-1 {
        width: 90px;
        height: 90px;
        top: 8%;
        left: -12%;
    }
    
    .hero-artifact.artifact-2 {
        width: 100px;
        height: 100px;
        top: 50%;
        right: -15%;
    }
    
    .hero-artifact.artifact-3 {
        width: 85px;
        height: 85px;
        bottom: 8%;
        right: -6%;
    }
}

@media (max-width: 767.98px) {
    .hero-coin.old-coin {
        width: 90px;
        height: 90px;
        top: -8%;
        right: -6%;
    }
    
    .hero-coin.modern-coin {
        width: 85px;
        height: 85px;
        bottom: -8%;
        left: -8%;
    }
    
    .hero-artifact.artifact-1 {
        width: 70px;
        height: 70px;
        top: 10%;
        left: -10%;
        opacity: 0.8;
    }
    
    .hero-artifact.artifact-2 {
        width: 75px;
        height: 75px;
        top: 50%;
        right: -12%;
        opacity: 0.75;
    }
    
    .hero-artifact.artifact-3 {
        width: 65px;
        height: 65px;
        bottom: 10%;
        right: -5%;
        opacity: 0.8;
    }
}

@media (max-width: 991.98px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-content,
    .hero-media {
        grid-column: 1 / -1;
    }

    .hero-content {
        order: 2;
    }

    .hero-media {
        order: 1;
        justify-content: center;
    }

    .hero-tagline {
        max-width: 100%;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 2.5rem 0 3.25rem;
    }

    .hero-title {
        font-size: clamp(1.9rem, 7vw, 2.6rem);
    }

    .hero-subtitle {
        font-size: 1.05rem;
    }

    .hero-author {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .hero-topics li {
        font-size: 0.8rem;
        padding: 0.35rem 0.7rem;
    }

    .hero-book-display {
        max-width: 320px;
    }
}

@media (max-width: 575.98px) {
    .hero-topics {
        gap: 0.4rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-cta .btn {
        justify-content: center;
        width: 100%;
    }
}

.book-ornament.bottom {
    margin-top: 2rem;
}

.book-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-light);
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.book-divider {
    width: 40px;
    height: 1px;
    background: var(--accent);
    margin: 1rem 0;
}

.book-author {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-style: italic;
    color: var(--accent-light);
}

.book-shadow {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 20px;
    background: rgba(0, 0, 0, 0.2);
    filter: blur(15px);
    border-radius: 50%;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    font-family: var(--font-body);
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: var(--text-light) !important;
}

.btn-primary:hover {
    background: var(--primary-light) !important;
    border-color: var(--primary-light) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    background: transparent !important;
    border: 2px solid var(--primary) !important;
    color: var(--primary) !important;
}

.btn-outline-primary:hover {
    background: var(--primary) !important;
    color: var(--text-light) !important;
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* ============================================
   Section Styles
   ============================================ */

/* Full Height Sections */
section.vh-100 {
    min-height: 100vh;
    position: relative;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

section.vh-100.d-flex {
    display: flex !important;
}

section.vh-100.align-items-center {
    align-items: center !important;
}

section.vh-100 > .container {
    width: 100%;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Ensure sections with overflow content can scroll on mobile */
@media (max-width: 767.98px) {
    section.vh-100 {
        min-height: auto;
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    section.vh-100 > .container {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    section.hero-section.vh-100 {
        min-height: 100vh;
    }
}

.section-header {
    margin-bottom: 3rem;
}

.construction-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 4px solid #ff9800;
    border-radius: var(--radius-md);
    color: #664d03;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

[dir="rtl"] .construction-notice {
    border-left: 1px solid #ffc107;
    border-right: 4px solid #ff9800;
}

.construction-notice p {
    margin: 0;
    line-height: 1.65;
}

.construction-notice p + p {
    margin-top: 0.35rem;
}

.section-title {
    font-size: clamp(2.2rem, 5.2vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary);
    line-height: 1.2;
}

.section-subtitle {
    font-size: clamp(1.05rem, 2.5vw, 1.45rem);
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 3rem;
    line-height: 1.8;
    font-weight: 500;
}

/* ============================================
   Features Section
   ============================================ */
.features-section {
    padding: var(--section-spacing) 0;
    background: url("../assets/image/features-section.png") center/cover no-repeat;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

.features-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(135deg, rgba(245, 241, 232, 0.92) 0%, rgba(248, 244, 236, 0.9) 45%, rgba(233, 222, 205, 0.75) 100%),
        radial-gradient(circle at 12% 18%, rgba(139, 125, 107, 0.18) 0, transparent 40%),
        radial-gradient(circle at 82% 12%, rgba(212, 165, 116, 0.2) 0, transparent 45%),
        radial-gradient(circle at 80% 82%, rgba(168, 153, 104, 0.22) 0, transparent 45%);
    pointer-events: none;
}

.features-section > .container {
    position: relative;
    z-index: 1;
}

.feature-card {
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    height: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 2rem 0;
    color: var(--text-light);
    box-shadow: var(--shadow-md);
}

[dir="rtl"] .feature-icon {
    margin: 0 0 2rem 0;
}

.feature-icon svg {
    width: 36px;
    height: 36px;
}

.feature-title {
    font-size: clamp(1.5rem, 3.2vw, 1.85rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary);
    line-height: 1.3;
}

.feature-description {
    color: var(--text-secondary);
    font-size: clamp(1.05rem, 1.8vw, 1.15rem);
    line-height: 2;
    text-align: justify;
    flex: 1;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.btn-read-more {
    margin-top: auto;
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-normal);
}

.btn-read-more svg {
    width: 16px;
    height: 16px;
}

.btn-read-more:hover {
    transform: translateX(4px);
}

[dir="rtl"] .btn-read-more:hover {
    transform: translateX(-4px);
}

/* Feature Modal Styles */
.feature-modal .modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(0, 31, 84, 0.15);
    overflow: hidden;
}

.feature-modal .modal-dialog {
    max-width: 900px;
}

.feature-modal .modal-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #f9f7f3 100%);
    padding: 2.5rem 3rem;
    position: relative;
}

.feature-modal .modal-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--primary) 100%);
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
}

[dir="rtl"] .modal-header-content {
    flex-direction: row-reverse;
}

.modal-feature-icon {
    width: 80px;
    height: 80px;
    margin: 0;
    flex-shrink: 0;
    box-shadow: var(--shadow-lg);
}

.modal-feature-icon svg {
    width: 36px;
    height: 36px;
}

.modal-title-wrapper {
    flex: 1;
}

.modal-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

[dir="rtl"] .modal-title {
    font-size: 2.2rem;
}

.modal-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
}

[dir="rtl"] .modal-subtitle {
    font-size: 1.1rem;
}

.feature-modal .btn-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    padding: 0.5rem;
    opacity: 0.5;
    transition: all var(--transition-fast);
}

[dir="rtl"] .feature-modal .btn-close {
    right: auto;
    left: 1.5rem;
}

.feature-modal .btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.feature-modal .modal-body {
    padding: 3rem;
    background: var(--bg-primary);
}

.modal-content-wrapper {
    max-width: 100%;
}

.modal-feature-highlight {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(139, 125, 107, 0.1) 0%, rgba(212, 165, 116, 0.15) 100%);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

[dir="rtl"] .modal-feature-highlight {
    border-left: none;
    border-right: 4px solid var(--accent);
}

.modal-feature-highlight svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
    flex-shrink: 0;
}

.modal-feature-text {
    font-size: 1.15rem;
    line-height: 2.2;
    color: var(--text-secondary);
    text-align: justify;
    margin: 0;
    font-weight: 400;
}

[dir="rtl"] .modal-feature-text {
    font-size: 1.25rem;
    font-weight: 500;
}

.feature-modal .modal-footer {
    background: var(--bg-secondary);
    padding: 2rem 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.feature-modal .modal-footer .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.feature-modal .modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.feature-modal .modal-footer .btn svg {
    width: 20px;
    height: 20px;
}

/* Responsive adjustments for modals */
@media (max-width: 991.98px) {
    .feature-modal .modal-dialog {
        max-width: 90%;
        margin: 1rem auto;
    }
    
    .feature-modal .modal-header {
        padding: 2rem 2rem;
    }
    
    .modal-header-content {
        gap: 1.5rem;
    }
    
    .modal-feature-icon {
        width: 70px;
        height: 70px;
    }
    
    .modal-feature-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .modal-title {
        font-size: 1.75rem;
    }
    
    [dir="rtl"] .modal-title {
        font-size: 1.9rem;
    }
    
    .feature-modal .modal-body {
        padding: 2rem;
    }
    
    .feature-modal .modal-footer {
        padding: 1.5rem 2rem;
    }
}

@media (max-width: 767.98px) {
    .feature-modal .modal-dialog {
        max-width: 95%;
        margin: 0.5rem auto;
    }
    
    .feature-modal .modal-header {
        padding: 1.5rem 1.5rem;
    }
    
    .modal-header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    [dir="rtl"] .modal-header-content {
        align-items: flex-end;
    }
    
    .modal-feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .modal-feature-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    [dir="rtl"] .modal-title {
        font-size: 1.65rem;
    }
    
    .modal-subtitle {
        font-size: 0.9rem;
    }
    
    .feature-modal .btn-close {
        top: 1rem;
        right: 1rem;
    }
    
    [dir="rtl"] .feature-modal .btn-close {
        left: 1rem;
        right: auto;
    }
    
    .feature-modal .modal-body {
        padding: 1.5rem;
    }
    
    .modal-feature-highlight {
        padding: 0.65rem 1.25rem;
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .modal-feature-text {
        font-size: 1.05rem;
        line-height: 2;
        text-align: left;
    }
    
    [dir="rtl"] .modal-feature-text {
        text-align: right;
        font-size: 1.15rem;
    }
    
    .feature-modal .modal-footer {
        padding: 1.25rem 1.5rem;
    }
    
    .feature-modal .modal-footer .btn {
        width: 100%;
        justify-content: center;
        padding: 0.85rem 2rem;
        font-size: 1rem;
    }
}

/* Responsive adjustments for features */
@media (max-width: 991.98px) {
    .feature-card {
        padding: 2rem;
    }
    
    .feature-icon {
        width: 70px;
        height: 70px;
    }
    
    .feature-icon svg {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 767.98px) {
    .feature-card {
        padding: 1.75rem;
    }
    
    .feature-icon {
        width: 65px;
        height: 65px;
        margin-bottom: 1.5rem;
    }
    
    .feature-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .feature-description {
        text-align: left;
    }
    
    [dir="rtl"] .feature-description {
        text-align: right;
    }
}

/* ============================================
   About Section
   ============================================ */
.about-section {
    padding: var(--section-spacing) 0;
    background: var(--bg-secondary);
}

.about-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.9;
}

.quote-card {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.quote-icon {
    color: var(--accent);
    margin-bottom: 1rem;
}

.quote-icon svg {
    width: 32px;
    height: 32px;
}

.quote-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-style: italic;
    color: var(--primary);
    line-height: 1.6;
    margin: 0 0 1rem;
}

.quote-author {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
}

/* ============================================
   Read Book Section
   ============================================ */
.read-section {
    padding: var(--section-spacing) 0;
    background: url("../assets/image/read-section.png") center/cover no-repeat;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

.read-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(135deg, rgba(245, 241, 232, 0.92) 0%, rgba(248, 244, 236, 0.9) 45%, rgba(233, 222, 205, 0.75) 100%),
        radial-gradient(circle at 12% 18%, rgba(139, 125, 107, 0.18) 0, transparent 40%),
        radial-gradient(circle at 82% 12%, rgba(212, 165, 116, 0.2) 0, transparent 45%),
        radial-gradient(circle at 80% 82%, rgba(168, 153, 104, 0.22) 0, transparent 45%);
    pointer-events: none;
}

.read-section > .container {
    position: relative;
    z-index: 1;
}

.read-form-card {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.read-form .form-label {
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.label-icon {
    width: 16px;
    height: 16px;
}

.read-form .form-control,
.read-form .form-select {
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.read-form .form-control:focus,
.read-form .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 31, 84, 0.1);
}

/* ============================================
   Chapters Section
   ============================================ */
.chapters-section {
    min-height: 100vh; /* full screen height */
    padding: var(--section-spacing) 0;
    background: url("../assets/image/chapters-section.png") center/auto no-repeat;
    position: relative;
    overflow: hidden;
}

.chapters-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(135deg, rgba(245, 241, 232, 0.92) 0%, rgba(248, 244, 236, 0.9) 45%, rgba(233, 222, 205, 0.75) 100%),
        radial-gradient(circle at 12% 18%, rgba(139, 125, 107, 0.18) 0, transparent 40%),
        radial-gradient(circle at 82% 12%, rgba(212, 165, 116, 0.2) 0, transparent 45%),
        radial-gradient(circle at 80% 82%, rgba(168, 153, 104, 0.22) 0, transparent 45%);
    pointer-events: none;
}

.chapters-section > .container {
    position: relative;
    z-index: 1;
}

/* Force Bootstrap row to stretch all columns to the tallest card's height */
.chapters-section .row {
    align-items: stretch;
}

.chapter-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    height: 100%;
}

.chapter-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-md);
    border-left: 4px solid transparent;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chapter-card:hover {
    border-left-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.chapter-number-box {
    display: inline-flex;        /* allows the box to resize naturally */
    min-width: 40px;             /* ensures small numbers don’t shrink too much */
    max-width: 60px;             /* prevents large numbers from stretching too far */
    height: 40px;                /* fixed height */
    align-items: center;         
    justify-content: center;
    border-radius: 5px;
    padding: 0 5px;              /* optional padding */
    box-sizing: border-box;
}

.chapter-number {
    font-weight: bold;
    font-size: 1rem;
    text-align: center;
    white-space: nowrap;          /* prevents line breaks for the number */
}

.chapter-title {
    font-size: clamp(1.35rem, 3vw, 1.65rem);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.chapter-description {
    color: var(--text-secondary);
    line-height: 1.7;
    flex-grow: 1;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
}

.chapter-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    font-weight: 600;
    margin-top: auto;
    padding-top: 1rem;
    font-size: clamp(1rem, 1.5vw, 1.1rem);
}

.chapter-link svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
}

.chapter-card:hover .chapter-link svg {
    transform: translateX(4px);
}

/* Combined chapter card — first two gates share one box */
.chapter-card-combined {
    cursor: default;
}

.chapter-card-combined:hover {
    transform: none;
    box-shadow: var(--shadow-md);
    border-left-color: transparent;
}

.chapter-card-item {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0.5rem 0;
}

.chapter-card-item + .chapter-card-item {
    border-top: 1px solid var(--border-color, rgba(0,0,0,0.08));
    padding-top: 1.25rem;
    margin-top: 0.75rem;
}

.chapter-card-item .chapter-link {
    text-decoration: none;
    margin-top: auto;
    padding-top: 0.75rem;
    display: inline-flex;
}

.chapter-card-item .chapter-link:hover svg {
    transform: translateX(4px);
}

[dir="rtl"] .chapter-card-item .chapter-link:hover svg {
    transform: translateX(-4px);
}

.empty-chapters {
    color: var(--text-muted);
}

.empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
}

/* ============================================
   Author Section
   ============================================ */
.author-section {
    padding: var(--section-spacing) 0;
    background: url("../assets/image/author-section.png") center/auto no-repeat;
    position: relative;
    overflow: hidden;
}

.author-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(135deg, rgba(245, 241, 232, 0.92) 0%, rgba(248, 244, 236, 0.9) 45%, rgba(233, 222, 205, 0.75) 100%),
        radial-gradient(circle at 12% 18%, rgba(139, 125, 107, 0.18) 0, transparent 40%),
        radial-gradient(circle at 82% 12%, rgba(212, 165, 116, 0.2) 0, transparent 45%),
        radial-gradient(circle at 80% 82%, rgba(168, 153, 104, 0.22) 0, transparent 45%);
    pointer-events: none;
}

.author-section > .container {
    position: relative;
    z-index: 1;
}

.author-content p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 2;
}

.author-content > p:not(.author-contact-info) {
    text-align: justify;
}

.author-content a {
    color: var(--bs-link-color, #0d6efd);
    text-decoration: underline;
}

.author-content a:hover {
    color: var(--bs-link-hover-color, #0a58ca);
}

.author-contact-info {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 2rem;
    line-height: 1.8;
}

.author-email {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--bs-link-color, #0d6efd);
}

.author-email:hover {
    color: var(--bs-link-hover-color, #0a58ca);
}

/* ============================================
   Contact Section
   ============================================ */
.contact-section {
    padding: var(--section-spacing) 0;
    background: url("../assets/image/contact-section.png") center/cover no-repeat;
    position: relative;
    overflow: hidden;
}

.contact-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(145deg, rgba(107, 98, 82, 0.68) 0%, rgba(139, 125, 107, 0.6) 50%, rgba(93, 85, 81, 0.72) 100%),
        radial-gradient(circle at 14% 16%, rgba(212, 165, 116, 0.18) 0, transparent 42%),
        radial-gradient(circle at 84% 84%, rgba(245, 241, 232, 0.1) 0, transparent 46%);
    pointer-events: none;
}

.contact-section > .container {
    position: relative;
    z-index: 1;
}

.contact-form-card {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.contact-form .form-label {
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    font-weight: 700;
    color: var(--primary);
}

.contact-form .form-control,
.contact-form .form-select {
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
}

.contact-form .form-control:focus,
.contact-form .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 31, 84, 0.1);
}

.alert-icon {
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    padding: 4rem 0 2rem;
    background: var(--primary-dark);
    color: var(--text-light);
}

.reading-page .site-footer {
    margin-left: 400px;
    padding-left: 1in;
}

[dir="rtl"] .reading-page .site-footer {
    margin-left: 0;
    margin-right: 400px;
    padding-right: 1in;    
}

/* Mobile: Remove padding */
@media (max-width: 768px) {
    .reading-page .site-footer {
        padding-left: 3rem;
    }
    
    [dir="rtl"] .reading-page .site-footer {
        padding-right: 3rem;
    }
}

.footer-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.footer-description {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-light);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all var(--transition-fast);
}

.social-links a:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

.social-links svg {
    width: 18px;
    height: 18px;
}

.footer-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

.footer-bottom {
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    margin: 0;
}

/* ============================================
   Reading Page Styles
   ============================================ */
.reading-page {
    background: var(--bg-primary);
}

.reading-layout {
    display: flex;
    min-height: calc(100vh - 80px);
    position: relative;
}

/* TOC Sidebar */
.toc-sidebar {
    width: 400px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    position: fixed;
    top: 80px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform var(--transition-normal);
}

[dir="rtl"] .toc-sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border-light);
}

.toc-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

.toc-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.toc-title svg {
    width: 26px;
    height: 26px;
}

.toc-close {
    display: none;
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--text-muted);
}

.toc-search {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.toc-search .input-group-text {
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-right: none;
}

.toc-search .input-group-text svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.toc-search .form-control {
    border-left: none;
    font-size: 0.9rem;
}

.toc-nav {
    padding: 1rem 0;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.toc-part {
    border-bottom: 1px solid var(--border-light);
}

.toc-part.active {
    background: rgba(0, 31, 84, 0.03);
}

.toc-part-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    transition: background var(--transition-fast);
}

.toc-part-header:hover {
    background: rgba(0, 31, 84, 0.05);
}

.toc-part-link {
    flex: 1;
    padding: 0.5rem;
    text-decoration: none;
    color: inherit;
    display: block;
}

.toc-part-link:hover {
    color: inherit;
}

.toc-part-toggle-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.toc-part-toggle-btn:hover {
    color: var(--accent);
}

.toc-toggle-icon {
    width: 21px;
    height: 21px;
    stroke-width: 2.8;
    transition: transform var(--transition-fast);
}

.toc-part-toggle-btn[aria-expanded="true"] .toc-toggle-icon {
    transform: rotate(90deg);
}

[dir="rtl"] .toc-part-toggle-btn[aria-expanded="true"] .toc-toggle-icon {
    transform: rotate(-90deg);
}

.toc-part-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.toc-chapters {
    list-style: none;
    padding: 0 0 0.5rem;
    margin: 0;
}

.toc-chapter {
    position: relative;
}

.toc-chapter-wrapper {
    display: flex;
    align-items: center;
}

.toc-expand-btn {
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toc-nav .toc-expand-btn svg,
.toc-nav .toc-mobile-icon,
.toc-nav .toc-toggle-icon {
    width: 21px;
    height: 21px;
    stroke-width: 2.8;
}

[dir="rtl"] .toc-expand-btn {
    transform: scaleX(-1);
}

.toc-expand-placeholder {
    width: 28px;
    flex-shrink: 0;
}

.toc-chapter-link {
    flex: 1;
    display: flex;
    gap: 1rem;
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 1.15rem;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-weight: 500;
}

.toc-chapter-link:hover {
    color: var(--primary);
    background: rgba(0, 31, 84, 0.05);
}

.toc-chapter-link.active {
    color: var(--primary);
    background: rgba(0, 31, 84, 0.08);
    font-weight: 500;
}

.you-are-here {
    display: block;
    font-size: 0.95rem;
    font-style: italic;
    color: #DC2626;
    font-weight: 700;
    margin-top: 0.25rem;
}

.toc-chapter-number {
    color: var(--text-muted);
    font-size: 1rem;
    min-width: 2rem;
}

.toc-subchapters {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-left: 1rem;
}

[dir="rtl"] .toc-subchapters {
    padding-left: 0;
    padding-right: 1rem;
}

/* TOC Mobile Toggle - Vertical Sticky Bottom Button */
.toc-mobile-toggle {
    display: none;
    position: fixed;
    right: 0;
    bottom: 20px;
    padding: 1rem 0.5rem;
    background: var(--primary);
    color: var(--text-light);
    border: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 99;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: auto;
    min-width: 56px;
    transition: right 0.3s ease;
}

/* English version - button on right */
[dir="ltr"] .toc-mobile-toggle {
    right: 0;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

/* Hebrew version - button on left */
[dir="rtl"] .toc-mobile-toggle {
    right: auto;
    left: 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.toc-mobile-toggle span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

[dir="rtl"] .toc-mobile-toggle span {
    writing-mode: vertical-lr;
    transform: none;
}

.toc-mobile-toggle svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toc-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.toc-overlay.show {
    display: block;
}

/* Reading Content */
.reading-content {
    flex: 1;
    max-width: 920px;
    margin-left: 400px;
    padding: 3rem 2rem 3rem 2rem;
    min-width: 0;
    font-weight: 900;
}

[dir="rtl"] .reading-content {
    margin-left: 0;
    margin-right: 400px;
    padding: 3rem 2rem 3rem 2rem;
}

/* Breadcrumb */
.reading-breadcrumb {
    margin-bottom: 2rem;
}

.reading-breadcrumb .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.reading-breadcrumb .breadcrumb-item {
    display: flex;
    align-items: center;
}

.reading-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: '';
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
    width: 16px;
    height: 16px;
    background-size: contain;
    padding: 0;
    margin: 0 0.5rem;
}

[dir="rtl"] .reading-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    transform: rotate(180deg);
}

.reading-breadcrumb .breadcrumb-item a {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.reading-breadcrumb .breadcrumb-item a:hover {
    color: var(--primary);
}

.reading-breadcrumb .breadcrumb-item a svg {
    width: 14px;
    height: 14px;
}

.reading-breadcrumb .breadcrumb-item.active {
    font-weight: 700;
    font-size: 1.2rem;
}

/* Chapter Content */
.chapter-content {
    width: 100%;
}

[dir="rtl"] .chapter-content {
    padding-right: 0;
}

.chapter-header {
    border-bottom: 1px solid var(--border-light);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
}

.chapter-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex: 1;
    min-width: 100%;
}

.text-controls-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.text-controls-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.text-size-label {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.text-size-label svg {
    width: 16px;
    height: 16px;
}

.text-controls-inner .btn-group {
    display: flex;
    gap: 0.5rem;
}

.text-controls-inner .btn-group .btn {
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.6rem;
}

.text-controls-inner .btn-group .btn svg {
    width: 14px;
    height: 14px;
}

.text-size-display {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    min-width: 60px;
    text-align: center;
}

.text-controls-wrapper .btn-group .btn {
    min-width: 36px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
}

.text-controls-wrapper .btn svg {
    width: 14px;
    height: 14px;
}

/* Icon positioning - stack on top of each other */
.tts-play-icon,
.tts-pause-icon {
    position: absolute;
    width: 14px;
    height: 14px;
    transition: opacity 0.2s ease;
}

.tts-play-icon {
    opacity: 1;
}

.tts-pause-icon {
    opacity: 0;
    pointer-events: none;
}

#ttsPlayPause.tts-playing .tts-play-icon {
    opacity: 0;
    pointer-events: none;
}

#ttsPlayPause.tts-playing .tts-pause-icon {
    opacity: 1;
    pointer-events: auto;
}

.text-controls-wrapper .input-group-text {
    background: var(--bg-primary);
    border-color: var(--border-medium);
    padding: 0.25rem 0.5rem;
}

.text-controls-wrapper .input-group-text svg {
    width: 14px;
    height: 14px;
}

.text-controls-wrapper .form-select {
    border-color: var(--border-medium);
    font-size: 0.875rem;
}

.text-controls-wrapper .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 31, 84, 0.25);
}

#ttsStatus {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

#ttsStatus.bg-info {
    background-color: #0dcaf0 !important;
}

#ttsStatus.tts-active {
    background-color: var(--accent) !important;
}

#ttsStatus.tts-error {
    background-color: #dc3545 !important;
}

#ttsStatus.tts-warning {
    background-color: #ff9800 !important;
}

/* TTS Word Highlighting */
.tts-word {
    display: inline;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tts-word.tts-highlight {
    background-color: var(--accent);
    color: #ffffff;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* For dark mode or alternative themes */
body.dark-mode .tts-word.tts-highlight {
    background-color: #FFD700;
    color: #001F54;
}

/* TTS Warning Notification */
.tts-warning-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    max-width: 400px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 4px solid #ff9800;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    animation: slideInRight 0.3s ease;
}

[dir="rtl"] .tts-warning-notification {
    right: auto;
    left: 20px;
    border-left: none;
    border-right: 4px solid #ff9800;
    animation: slideInLeft 0.3s ease;
}

.tts-warning-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    color: #664d03;
    font-size: 0.9rem;
    line-height: 1.5;
}

.tts-warning-content svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    color: #ff9800;
}

.tts-warning-content span {
    flex: 1;
}

.tts-warning-close {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #664d03;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
}

.tts-warning-close:hover {
    opacity: 1;
}

.tts-warning-close svg {
    width: 18px;
    height: 18px;
    margin-top: 0;
}

.tts-warning-notification.fade-out {
    animation: fadeOut 0.3s ease;
    opacity: 0;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ============================================
   TTS Language Pack Modal Styles
   ============================================ */
.tts-language-pack-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tts-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    backdrop-filter: blur(2px);
}

.tts-modal-content {
    position: relative;
    background-color: white;
    border-radius: 16px;
    max-width: 620px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 31, 84, 0.15), 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 10001;
    display: flex;
    flex-direction: column;
}

.tts-modal-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 28px 32px;
    border-bottom: 1px solid #e8eef5;
    position: relative;
}

.tts-modal-icon-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #001F54 0%, #003080 100%);
    border-radius: 12px;
}

.tts-modal-icon {
    width: 24px;
    height: 24px;
    color: white;
    stroke-width: 1.5;
}

.tts-modal-header-text {
    flex: 1;
}

.tts-modal-header-text h2 {
    margin: 0 0 6px 0;
    font-size: 22px;
    font-weight: 700;
    color: #001F54;
    line-height: 1.3;
}

.tts-modal-subtitle {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.tts-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: #666;
}

.tts-modal-close:hover {
    background-color: #f5f7fa;
    color: #001F54;
}

.tts-modal-close i {
    width: 20px;
    height: 20px;
}

[dir="rtl"] .tts-modal-close {
    right: auto;
    left: 16px;
}

.tts-modal-body {
    flex: 1;
    padding: 28px 32px;
    overflow-y: auto;
}

.tts-instruction-section {
    margin-bottom: 28px;
}

.tts-instruction-section h3 {
    margin: 0 0 20px 0;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    color: #001F54;
    letter-spacing: 0.5px;
}

.tts-instruction-step {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px;
    background-color: #f8fafb;
    border-radius: 10px;
    border: 1px solid #e8eef5;
    transition: all 0.2s ease;
}

[dir="rtl"] .tts-instruction-step {
    flex-direction: row-reverse;
}

.tts-instruction-step:hover {
    background-color: #f0f5fa;
    border-color: #d4dce8;
    box-shadow: 0 2px 8px rgba(0, 31, 84, 0.06);
}

.step-number {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #B85C38 0%, #c96f4a 100%);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 15px;
    min-width: 36px;
}

.step-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tts-instruction-step p {
    margin: 0;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

.tts-modal-note {
    display: flex;
    gap: 12px;
    padding: 16px;
    background-color: #f0f7ff;
    border-radius: 10px;
    border-left: 4px solid #0066cc;
}

[dir="rtl"] .tts-modal-note {
    border-left: none;
    border-right: 4px solid #0066cc;
}

.tts-modal-note i {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #0066cc;
    margin-top: 2px;
}

.tts-modal-note p {
    margin: 0;
    font-size: 13px;
    color: #0055aa;
    line-height: 1.6;
}

.tts-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 20px 32px 28px 32px;
    border-top: 1px solid #e8eef5;
    background-color: #fafbfc;
    border-radius: 0 0 16px 16px;
}

.tts-modal-btn-secondary {
    padding: 12px 32px;
    background-color: #001F54;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 31, 84, 0.15);
}

.tts-modal-btn-secondary:hover {
    background-color: #003080;
    box-shadow: 0 4px 12px rgba(0, 31, 84, 0.25);
    transform: translateY(-2px);
}

.tts-modal-btn-secondary:active {
    transform: translateY(0);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 640px) {
    .tts-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .tts-modal-header {
        padding: 20px 20px;
        gap: 12px;
    }
    
    .tts-modal-header-text h2 {
        font-size: 20px;
    }
    
    .tts-modal-close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
    }
    
    .tts-modal-body {
        padding: 20px;
    }
    
    .tts-instruction-step {
        padding: 12px;
        gap: 12px;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .tts-modal-footer {
        padding: 16px 20px 20px 20px;
    }
    
    .tts-modal-btn-secondary {
        padding: 11px 24px;
        font-size: 13px;
    }
[dir="rtl"] .tts-speed-control {
        padding-right: 0;
        border-right: none;
        border-top: 1px solid var(--border-light);
    }
    
    .tts-status {
        padding-left: 0;
        border-left: none;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-light);
        width: 100%;
    }
    
    [dir="rtl"] .tts-status {
        padding-right: 0;
        border-right: none;
    }
    
    .tts-warning-notification {
        right: 10px;
        left: 10px;
        max-width: none;
        top: 70px;
    }
    
    [dir="rtl"] .tts-warning-notification {
        left: 10px;
        right: 10px;
    }
}
.chapter-number {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    padding: 0.25rem 0.75rem;
    background: rgba(184, 92, 56, 0.1);
    border-radius: var(--radius-sm);
}

.chapter-part {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.chapter-content .chapter-title {
    font-size: 3.2rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--primary);
    flex: 1;
    min-width: 100%;
}

.chapter-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Share Buttons */
.share-buttons-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}

.header-controls-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.share-label {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
    margin: 0;
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.share-btn:active {
    transform: translateY(0);
}

.share-facebook {
    background: #1877F2;
    color: white;
    border-color: #1877F2;
}

.share-facebook:hover {
    background: #145dbf;
    border-color: #145dbf;
    color: white;
}

.share-twitter {
    background: #1DA1F2;
    color: white;
    border-color: #1DA1F2;
}

.share-twitter:hover {
    background: #1a8cd8;
    border-color: #1a8cd8;
    color: white;
}

.share-whatsapp {
    background: #25D366;
    color: white;
    border-color: #25D366;
}

.share-whatsapp:hover {
    background: #1fb855;
    border-color: #1fb855;
    color: white;
}

.share-viber {
    background: #7360F2;
    color: white;
    border-color: #7360F2;
}

.share-viber:hover {
    background: #5f4dd4;
    border-color: #5f4dd4;
    color: white;
}

.share-copy {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.share-copy:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

/* Copy notification */
.copy-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    transition: all var(--transition-normal);
    font-weight: 500;
}

.copy-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Responsive adjustments for combined controls */
@media (max-width: 768px) {
    .header-controls-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .share-buttons-container {
        width: 100%;
    }
    
    .share-btn {
        width: 36px;
        height: 36px;
    }
    
    .share-btn svg {
        width: 18px;
        height: 18px;
    }
    
    /* Text controls responsive */
    .text-controls-wrapper {
        width: 100%;
    }
    
    .text-controls-inner {
        flex-wrap: wrap;
        width: 100%;
    }
    
    /* Stack controls vertically on very small screens */
    @media (max-width: 480px) {
        .text-controls-inner {
            flex-direction: column;
            align-items: flex-start;
        }
    }
}

/* Main Content Container with Sidebar */
.chapter-main-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
}

[dir="rtl"] .chapter-main-container {
    flex-direction: row-reverse;
}

.chapter-content-wrapper {
    flex: 1;
    min-width: 0;
}

.chapter-body {
    font-size: 1.625rem;
    line-height: 2;
    color: var(--text-primary);
    text-align: justify;
    font-weight: 500;
}

[dir="rtl"] .chapter-body {
    font-family: 'David Libre', serif;
}

.chapter-body h2 {
    font-size: 2.6rem;
    margin: 2.5rem 0 1rem;
}

.chapter-body h3 {
    font-size: 2.275rem;
    margin: 2rem 0 1rem;
}

.chapter-body p {
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.chapter-body strong,
.chapter-body b,
.footnote-item strong,
.footnote-item b {
    font-weight: 700;
    -webkit-text-stroke: 0.015em currentColor;
    text-shadow: 0 0 0.01em currentColor;
}

.chapter-body blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent);
    font-style: italic;
}

[dir="rtl"] .chapter-body blockquote {
    border-left: none;
    border-right: 4px solid var(--accent);
}

/* Footnotes Section */
.chapter-footnotes {
    margin-top: 3.9rem;
    padding-top: 2.6rem;
}

.footnotes-divider {
    border: none;
    border-top: 2px solid var(--primary);
    margin: 2.6rem 0 1.95rem 0;
    opacity: 0.3;
}

.footnotes-list {
    list-style: decimal;
    padding-left: 1.95rem;
    margin: 0;
}

[dir="rtl"] .footnotes-list {
    padding-left: 0;
    padding-right: 1.95rem;
}

.footnote-item {
    font-family: 'David Libre', serif;
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 1.3rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.footnote-backref {
    margin-left: 0.65rem;
    text-decoration: none;
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease;
}

[dir="rtl"] .footnote-backref {
    margin-left: 0;
    margin-right: 0.65rem;
}

.footnote-backref:hover {
    color: var(--primary);
}

.footnote-backref svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

/* Subchapters List */
.subchapters-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.subchapters-title {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.subchapters-title svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.subchapters-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.subchapters-list li {
    margin-bottom: 0.5rem;
}

.subchapters-list a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.subchapters-list a:hover {
    background: var(--primary);
    color: var(--text-light);
}

.subchapter-number {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 2.5rem;
}

.subchapters-list a:hover .subchapter-number {
    color: rgba(255, 255, 255, 0.7);
}

.subchapter-title {
    flex: 1;
}

.subchapters-list svg {
    width: 16px;
    height: 16px;
}

/* Part Overview Page Styles */
.part-content {
    margin-bottom: 3rem;
}

.part-chapters-section {
    margin-top: 3rem;
}

.part-chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .part-chapters-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.part-chapter-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.part-chapter-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.chapter-card-link {
    display: block;
    padding: 1.5rem;
    color: inherit;
    text-decoration: none;
}

.chapter-card-header {
    margin-bottom: 1rem;
}

.chapter-card-number {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(184, 92, 56, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.chapter-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0;
    line-height: 1.4;
}

.chapter-card-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 1rem 0;
}

.chapter-card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
}

.chapter-card-footer svg {
    width: 16px;
    height: 16px;
}

.part-chapter-card:hover .chapter-card-footer {
    gap: 0.75rem;
}

.next-part-card {
    aspect-ratio: 1 / 1;
    border: 2px solid #8B7D6B;
    background: #8B7D6B;
    box-shadow: 0 10px 24px rgba(139, 125, 107, 0.2);
}

.next-part-card .next-part-link {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.next-part-card .chapter-card-number {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.2);
}

.next-part-card .chapter-card-title,
.next-part-card .chapter-card-footer {
    color: #FFFFFF;
}

.next-part-card:hover {
    transform: translateY(-4px);
    border-color: #6B6456;
    box-shadow: 0 14px 28px rgba(139, 125, 107, 0.3);
}

.chapter-card-cta {
    transition: all var(--transition-fast);
}

/* Chapter Sublist (collapsible sub-chapters) */
.chapter-sublist {
    border-top: 1px solid var(--border-light);
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
}

.sublist-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sublist-toggle:hover {
    color: var(--accent);
}

.sublist-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-normal);
}

.sublist-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.chapter-sublist .subchapters-list {
    margin-top: 0.75rem;
}

.chapter-sublist .subchapters-list li {
    margin-bottom: 0.5rem;
}

.chapter-sublist .subchapters-list a {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

/* Chapter Sidebar */
.chapter-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.sidebar-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-title svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.sidebar-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 0.75rem 0;
}

.reference-info {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.reference-description {
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

.reference-details {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 0.75rem;
}

.reference-details dt {
    font-weight: 600;
    color: var(--primary);
}

.reference-details dd {
    margin: 0;
    color: var(--text-secondary);
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-list li {
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--primary);
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.sidebar-link:hover {
    background: rgba(0, 31, 84, 0.08);
    color: var(--accent);
    padding-left: 1rem;
}

.sidebar-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: var(--text-light);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sidebar-btn svg {
    width: 16px;
    height: 16px;
}

/* Text Size Adjustments */
body.text-size-sm {
    --font-size-base: 1.25rem;
}

body.text-size-md {
    --font-size-base: 1.625rem;
}

body.text-size-lg {
    --font-size-base: 1.9rem;
}

body.text-size-xl {
    --font-size-base: 2.2rem;
}

.chapter-body {
    font-size: var(--font-size-base);
}

.chapter-body h2 {
    font-size: calc(var(--font-size-base) * 1.78);
}

.chapter-body h3 {
    font-size: calc(var(--font-size-base) * 1.56);
}

.chapter-body p {
    font-size: var(--font-size-base);
    line-height: 2;
}

.footnotes-list {
    font-size: calc(var(--font-size-base) * 0.756);
}

.subchapters-list a:hover svg {
    opacity: 1;
}

/* Chapter Navigation */
.chapter-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.nav-prev,
.nav-next {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-normal);
    text-decoration: none;
}

.nav-prev:hover,
.nav-next:hover {
    background: var(--primary);
    color: var(--text-light);
    transform: translateY(-2px);
}

.nav-prev svg,
.nav-next svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.nav-next {
    justify-content: flex-end;
    text-align: right;
}

[dir="rtl"] .nav-next {
    text-align: left;
}

.nav-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-title {
    font-family: var(--font-heading);
    font-weight: 500;
}

.nav-prev.disabled,
.nav-next.disabled {
    visibility: hidden;
}

.nav-prev.nav-inverse,
.nav-next.nav-inverse {
    background: var(--primary);
    color: var(--text-light);
}

.nav-prev.nav-inverse:hover,
.nav-next.nav-inverse:hover {
    background: var(--primary-light);
    color: var(--text-light);
}

/* Reading Overview */
.reading-overview {
    max-width: 900px;
}

.overview-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.overview-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.overview-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.parts-overview {
    display: grid;
    gap: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 2rem;
}

.part-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.part-title a {
    color: var(--primary);
}

.part-title a:hover {
    color: var(--accent);
}

.part-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.part-chapters {
    list-style: none;
    padding: 0;
    margin: 0;
}

.part-chapters li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.part-chapters li:last-child {
    border-bottom: none;
}

.part-chapters a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.part-chapters a:hover {
    color: var(--primary);
}

.chapter-num {
    color: var(--text-muted);
    min-width: 1.5rem;
}

.more-link a {
    color: var(--accent) !important;
    font-weight: 500;
}

/* ============================================
   Search Page Styles
   ============================================ */
.search-page {
    padding: 3rem 0 var(--section-spacing);
    min-height: calc(100vh - 200px);
}

.search-header {
    max-width: 700px;
    margin: 0 auto 3rem;
    text-align: center;
}

.search-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.search-title svg {
    width: 32px;
    height: 32px;
}

.search-form-large .input-group {
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.search-form-large .form-control {
    border: none;
    padding: 1rem 1.5rem;
}

.search-form-large .form-control:focus {
    box-shadow: none;
}

.search-form-large .btn {
    padding: 1rem 1.5rem;
    border-radius: 0;
}

.search-form-large .btn svg {
    width: 20px;
    height: 20px;
}

.search-summary {
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.results-list {
    max-width: 100%;
}

.result-group {
    margin-bottom: 2.5rem;
}

.result-group-title {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-muted);
}

.result-group-title svg {
    width: 18px;
    height: 18px;
}

.result-item {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-family: 'Segoe UI', 'Arial', 'Tahoma', sans-serif;
}

.result-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-family: 'Segoe UI', 'Arial', 'Tahoma', sans-serif;
}

.result-breadcrumb a {
    color: var(--text-muted);
}

.result-breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb-separator {
    width: 12px;
    height: 12px;
}

.result-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-family: 'Segoe UI', 'Arial', 'Tahoma', sans-serif;
}

.result-title a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.result-title a:hover {
    color: var(--accent);
}

.result-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.result-excerpt {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.result-excerpt mark {
    background: rgba(184, 92, 56, 0.2);
    color: inherit;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
}

.result-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--accent);
    font-weight: 500;
    font-size: 0.9rem;
}

.result-link svg {
    width: 14px;
    height: 14px;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.no-results-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--text-muted);
}

.no-results-icon svg {
    width: 36px;
    height: 36px;
}

.no-results h3 {
    margin-bottom: 0.75rem;
}

.no-results p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.search-tips {
    text-align: left;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

[dir="rtl"] .search-tips {
    padding-left: 0;
    padding-right: 1.5rem;
}

.search-tips li {
    margin-bottom: 0.5rem;
}

/* Empty Search State */
.search-empty {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.search-empty-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--primary);
}

.search-empty-icon svg {
    width: 36px;
    height: 36px;
}

.suggested-searches {
    margin-top: 2rem;
}

.suggested-searches h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.suggested-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.suggested-tag {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.suggested-tag:hover {
    background: var(--primary);
    color: var(--text-light);
}

/* ============================================
   404 Page Styles
   ============================================ */
.error-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.error-content {
    max-width: 500px;
}

.error-code {
    font-family: var(--font-heading);
    font-size: 8rem;
    font-weight: 700;
    color: var(--primary);
    opacity: 0.1;
    line-height: 1;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 991.98px) {
    :root {
        --section-spacing: 4rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* Mobile Navbar - Make it scrollable with overflow visible for dropdowns */
    .navbar-collapse {
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        overflow-x: visible;
        padding-bottom: 4rem;
    }
    
    /* Language dropdown styling for mobile */
    .language-dropdown {
        position: relative;
    }
    
    .language-dropdown .dropdown-menu {
        display: none;
        position: absolute;
        top: 100%;
        min-width: 140px;
        z-index: 2000;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        background-color: #fff;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        margin-top: 0.25rem;
    }
    
    .language-dropdown .dropdown-menu.show {
        display: block;
    }
    
    .language-dropdown .dropdown-item {
        display: block;
        width: 100%;
        padding: 0.5rem 1rem;
        clear: both;
        color: #212529;
        text-align: inherit;
        white-space: nowrap;
        background-color: transparent;
        border: 0;
        cursor: pointer;
    }
    
    .language-dropdown .dropdown-item:hover,
    .language-dropdown .dropdown-item.active {
        color: #fff;
        background-color: #0d6efd;
    }
    
    [dir="rtl"] .language-dropdown .dropdown-menu {
        left: auto;
        right: 0;
    }
    
    [dir="ltr"] .language-dropdown .dropdown-menu {
        left: 0;
        right: auto;
    }
    
    /* TOC Mobile */
    .toc-sidebar {
        transform: translateX(-100%);
        width: 85%;
        max-width: 400px;
    }
    
    [dir="rtl"] .toc-sidebar {
        transform: translateX(100%);
    }
    
    .toc-sidebar.open {
        transform: translateX(0);
    }
    
    .toc-close {
        display: block;
    }
    
    .toc-mobile-toggle {
        display: flex;
    }
    
    .reading-content {
        margin-left: 0;
        max-width: 100%;
        padding: 2rem 1.5rem 3rem 1.5rem;
    }
    
    [dir="rtl"] .reading-content {
        margin-right: 0;
        padding: 2rem 1.5rem 3rem 1.5rem;
    }
    
    .reading-page .site-footer {
        margin-left: 0;
        margin-right: 0;
    }

    [dir="rtl"] .reading-page .site-footer {
        margin-left: 0;
        margin-right: 0;
    }

    .chapter-content .chapter-title {
        font-size: 2rem;
    }
    
    .chapter-main-container {
        flex-direction: column;
        gap: 2rem;
    }
    
    [dir="rtl"] .chapter-main-container {
        flex-direction: column;
    }
    
    .chapter-sidebar {
        width: 100%;
        max-height: none;
        position: static;
        max-height: none;
    }
    
    .text-controls {
        margin-bottom: 1rem;
    }
    
    .chapter-navigation {
        flex-direction: column;
    }
    
    .nav-prev,
    .nav-next {
        flex-direction: row;
    }
    
    .nav-next {
        flex-direction: row-reverse;
        text-align: left;
    }
    
    .chapter-navigation.nav-hebrew-mobile {
        flex-direction: column-reverse;
    }
    
    .chapter-navigation.nav-hebrew-mobile .nav-prev {
        flex-direction: row;
        text-align: right;
    }
    
    .chapter-navigation.nav-hebrew-mobile .nav-next {
        text-align: left;
        flex-direction: row-reverse;
    }
}

@media (max-width: 767.98px) {
    .hero-cta {
        flex-direction: column;
    }
    
    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }
    
    .book-cover {
        width: 260px;
        height: 380px;
    }
    
    .book-title {
        font-size: 1.5rem;
    }
    
    .search-input {
        width: 140px;
    }
    
    .search-input:focus {
        width: 180px;
    }
    
    .chapter-body {
        font-size: 1rem;
    }
    
    .reading-content {
        padding: 1.5rem 1rem 2rem 1rem;
    }
    
    [dir="rtl"] .reading-content {
        padding: 1.5rem 1rem 2rem 1rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .site-header,
    .site-footer,
    .toc-sidebar,
    .toc-mobile-toggle,
    .chapter-navigation,
    .hero-cta {
        display: none !important;
    }
    
    .reading-content {
        margin: 0;
        padding: 1.5rem;
        max-width: 100%;
    }
    
    .chapter-content {
        max-width: 100%;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .chapter-body {
        font-size: 12pt;
    }
}

/* ============================================
   Quill Editor Text Size Customization
   ============================================ */

/*
   Keep Quill sizes relative to the reader's dynamic base size
   so they continue to work with body.text-size-sm/md/lg/xl controls.
*/

/* In editor */
.ql-editor .ql-size-small {
    font-size: calc(var(--font-size-base) * 0.75);
}

.ql-editor .ql-size-normal {
    font-size: var(--font-size-base);
}

.ql-editor .ql-size-large {
    font-size: calc(var(--font-size-base) * 1.25);
}

.ql-editor .ql-size-huge {
    font-size: calc(var(--font-size-base) * 1.6);
}

/* In rendered chapter/part content */
.chapter-body .ql-size-small {
    font-size: calc(var(--font-size-base) * 0.75);
}

.chapter-body .ql-size-normal {
    font-size: var(--font-size-base);
}

.chapter-body .ql-size-large {
    font-size: calc(var(--font-size-base) * 1.25);
}

.chapter-body .ql-size-huge {
    font-size: calc(var(--font-size-base) * 1.6);
}

/* ============================================
   Accessibility Improvements
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus styles for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

