/*  1. ROOT & GLOBAL STYLES  */
:root {
    /* Light Theme (Default) */
    --color-primary: #FF9933;
    --color-primary-light: #FF993333;
    --color-secondary: #F57C00;
    --color-accent: #4A90E2;
    --color-background: #FDFCF9;
    --color-list-background: #fa01;
    --color-surface: #FFFFFF;
    --color-text-base: #333333;
    --color-text-muted: #6c757d;
    --color-border: #EAEAEA;
    --hero-bg-image: url('/images/interface/hero-bg.svg');

    /* Typography */
    --font-family-body: 'Montserrat', sans-serif;
    --font-family-heading: 'Bebas Neue', sans-serif;

    /* Sizing & Spacing */
    --spacing-unit: 0.5vw;
    --border-radius: 8px;
    --header-height: 64px;

    /* Borders & Shadows */
    --edge: 1px solid #77777733;   
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dark-theme {
    --color-primary: #FFB86C;
    --color-primary-light: #FFB86C33;
    --color-secondary: #F57C00;
    --color-accent: #61dafb;
    --color-background: #121212;
    --color-list-background: #5532;
    --color-surface: #1E1E1E;
    --color-text-base: #E0E0E0;
    --color-text-muted: #9E9E9E;
    --color-border: #333333;
}

*, *::before, *::after {box-sizing: border-box;margin: 0;padding: 0;}
html {scroll-behavior: smooth;}
html:lang(en) {--font-family-body: 'Montserrat', sans-serif;--font-family-heading: 'Bebas Neue', sans-serif;}
html:lang(hi) {--font-family-body: 'Noto Serif Devanagari', serif;--font-family-heading: 'Teko', sans-serif;}

/* ==========================================================================
   2. UTILITY & LAYOUT CLASSES
   ========================================================================== */
.flex-row { display: flex; flex-direction: row; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.justify-start { justify-content: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center{ justify-content: center; }
.text-center{text-align: center;}
.text-justify{text-align: justify;}
.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }
.align-center { align-content: center;align-items: center; }
.w-full { width: 100%; padding: 0 calc(var(--spacing-unit) * 2);}
.w-1200 { width: 96%;max-width: 1200px;margin: 0 auto; }
.gap-2 { gap: calc(var(--spacing-unit) * 2); }
.shadow-sm{box-shadow: 0 2px 4px #0003;}
.shadow-md{box-shadow: 0 4px 8px #0003;}

h1, h2, h3, h4, h5, h6 {font-family: var(--font-family-heading);line-height: 1.3;font-weight: 500;color: var(--color-primary);}
h1, h2 {font-weight:700;color: var(--color-secondary);margin: calc(var(--spacing-unit) * 2) 0;text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.25);}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(2rem, 2rem + 1vw, 3rem); }

a {color: var(--color-text-muted);text-decoration: none;transition: color 0.2s ease;}
a:hover {color: var(--color-primary);}
img {max-width: 100%;aspect-ratio:3/2;}
ul, ol {padding-left: 1rem;list-style: none;}

body {
    background-color: var(--color-background);font-family: var(--font-family-body);line-height: 1.6;font-size:18px;color: var(--color-text-base);
    -webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;transition: background-color 0.3s, color 0.3s;
}
@media (max-width: 600px) {body{font-size: 16px;}}
main { min-height: 75vh; }
.container { margin: 0 auto; padding: 0 var(--spacing-unit);}
.view-parent-container {
    width: 100%;
    padding: 0;
}

.home-view,
.scriptures-view,
.library-main,
.about-view {
    width: 96%;
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 4) 0;
}

.section {
    padding: calc(var(--spacing-unit) * 4) 0;
}

.view-title, .section-title {
    text-align: center;
    margin-bottom: calc(var(--spacing-unit) * 3);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--color-primary);
    margin: var(--spacing-unit) auto 0;
    border-radius: 2px;
}

.grid {
    display: grid;grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: calc(var(--spacing-unit) * 2);
}

.btn {
    display: inline-block;
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 3);
    font-family: var(--font-family-body);
    font-weight: 500;
    text-align: center;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: var(--edge);
    color: var(--color-surface);background-color: var(--color-primary);
}


.btn-primary:hover,.btn-secondary:hover {
    background-color: var(--color-secondary);
    color: var(--color-surface);
    transform: translateY(-2px);box-shadow: var(--shadow-md);
}

.icon {width: 1.5rem;height: 1.5rem;stroke-width: 2;stroke: currentColor;fill: none;}

/* ==========================================================================
   3. HEADER & FOOTER
   ========================================================================== */
.header {
    background-color: var(--color-surface);border-bottom: var(--edge);box-shadow: var(--shadow-sm);
    height: var(--header-height);position: sticky;top: 0;z-index: 1000;
    transition: background-color 0.3s;
}

.header-brand img {height: clamp(2rem, 2rem + 0.5vw, 4rem);}
.brand-text {line-height: 1;height:fit-content;}
.brand-name {font-size: clamp(1.5rem, 1rem + 1vw, 3rem);line-height: 1;margin:0;font-weight: 700;color: var(--color-text-base);}
.brand-tagline {font-size: 0.75rem;margin:0;color: var(--color-text-muted);}

.nav-links {display: flex;gap: calc(var(--spacing-unit) * 3);}
.nav-links a {font-weight: 500;color: var(--color-text-muted);padding: var(--spacing-unit) 0;position: relative;}
.nav-links a::after {content: '';position: absolute;bottom: 0;left: 0;width: 0;height: 2px;
    background-color: var(--color-secondary);transition: width 0.3s ease;
}
.nav-links a:hover::after, .nav-links a.active::after {width: 100%;}
.nav-links a:hover, .nav-links a.active {color:var(--color-secondary);}

.header-actions {gap: 4px;}
.hamburger-btn {display: block;}

.footer {
    background-color: var(--color-surface);
    border-top: var(--edge);
    padding: calc(var(--spacing-unit) * 2) 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer .container {display: flex;flex-direction: column;align-items: center;gap: calc(var(--spacing-unit) * 2);}
@media (min-width: 768px) {.footer .container {flex-direction: row;justify-content: space-between;}}


.footer-brand img {height: 32px;}
.footer-brand .brand-name {font-size: 1.5rem;margin: 0;font-family: var(--font-family-heading);}

.social-links a {color: var(--color-text-muted);}
.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 1.5rem; /* Match icon size */
    height: 1.5rem; /* Match icon size */
}
.footer-brand, .footer-copyright, .social-links{min-width:170px;text-wrap: wrap;} 
/* ==========================================================================
   4. COMPONENT STYLES
   ========================================================================== */
.icon-btn {
    background: none;border: none;display: inline-flex;color: var(--color-text-muted);
    justify-content: center;align-items: center;padding: 4px;cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.icon-btn:hover {background-color: var(--color-background);color: var(--color-secondary);}

.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 2);
    background: var(--hero-bg-image) no-repeat center center/cover;
    color: var(--color-surface);
    min-height: 50vh;border-bottom: var(--edge);;
}

.hero-content {
    max-width: 700px;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--color-secondary);
    margin-bottom: var(--spacing-unit);
}

.view-text,.section-text,.hero p {
    font-size: 1.2rem;
    color: var(--color-text-base);text-align: center;
    margin-bottom: calc(var(--spacing-unit) * 4);
}


.topic-card {
    background-color: var(--color-surface);
    border: var(--edge);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    min-width: 240px;
}

.topic-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.topic-card img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: contain;
}

.topic-card-content {
    padding: calc(var(--spacing-unit) * 2);
}

.topic-card-content h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-unit);
}

.topic-card-content p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.books-carousel .book-card {
    position: relative;
    perspective: 1500px;
    cursor: pointer;
    flex-shrink: 0;
}

.scriptures-view .books-carousel .book-card {width: 180px;height: 240px;}
.scriptures-view .scriptures-scroller {justify-content: center;gap:calc(var(--spacing-unit)*3);}
.book-card-cover, .book-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow-y: auto;
}

.book-card-cover {
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: calc(var(--spacing-unit) * 2);
    color: white;
    transition: transform 0.5s ease-in-out;
    transform-origin: left;
    z-index: 2;
}

.book-card:hover .book-card-cover {
    transform: rotateY(-85deg);
}

.book-card-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent 60%);
    border-radius: var(--border-radius);
}

.book-card-cover h3, .book-card-cover p {
    position: relative;
    z-index: 1;
}

.book-card-cover h3 {
    font-size: 1.2rem;
    margin: 0;
}

.book-card-cover p {
    font-size: 0.8rem;
    font-style: italic;
}

.book-card-back {background-color: var(--color-surface);padding: calc(var(--spacing-unit) * 2);z-index: 1;}
.book-card-back h3 {font-size: 1.1rem;margin-bottom: var(--spacing-unit);}
.book-card-back p {font-size: 0.85rem;color: var(--color-text-muted);}

.scriptures-scroller {
    display: flex;
    gap: calc(var(--spacing-unit) * 3);
    padding: calc(var(--spacing-unit) * 2);
    padding-inline: calc(var(--spacing-unit) * 2); /* Restore horizontal padding */
    overflow-x: auto;
    justify-content: center;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.home-view .books-carousel{border:none}
.home-view .scriptures-scroller{flex-wrap:wrap;gap:calc(var(--spacing-unit) * 6);}
.scriptures-view .section-title,.scriptures-view .section-text{display:none;}
.scriptures-scroller::-webkit-scrollbar {display: none;}
.home-view .books-carousel .book-card {display:flex;height:300px;width:240px;}
/* ==========================================================================
   5. LOADING & ERROR STATES
   ========================================================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--color-background);
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.errorimg {
    width: 80%;
    max-width: 800px;
    margin: 4rem auto;
}

/* ==========================================================================
   6. LIBRARY VIEW STYLES
   ========================================================================== */
.library-layout {
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .view-parent-container.has-sidebar {
        display: grid;
        grid-template-columns: clamp(200px, 20%, 260px) 1fr;
    }
}
@media (max-width: 767px) {
    .grid {gap: 2rem;}
}
.library-sidebar {
    display: none;
    background-color: var(--color-surface);
    padding: calc(var(--spacing-unit) * 2);
    position: sticky;
    border-right: var(--edge);
    top: var(--header-height);
    height: 100vh;
}

.has-sidebar .library-sidebar {
    display: block;
}

.sidebar-header {
    font-size: 1.4rem;color: var(--color-text-muted);
    padding-bottom: var(--spacing-unit);
    margin-bottom: var(--spacing-unit);
    border-bottom: var(--edge);
}

.sidebar-nav ul {
    display: flex;padding:0 4px;
    flex-direction: column;
    gap: var(--spacing-unit);
}

.topic-item>a {
    display: flex;
    align-items: center;
    gap: var(--spacing-unit);
    padding: 4px calc(var(--spacing-unit) * 1.5);
    font-weight: 500;
    color: var(--color-text-muted);border-bottom:var(--edge);
}

.topic-item a:hover {background-color: var(--color-background);color: var(--color-primary);}

.topic-item a.active {

    color: var(--color-primary);
}

.subtopic-list {
    border-radius: 0 0 8px 8px;margin-left:12px;max-height: 0;overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out, opacity 0.3s ease-in;
    opacity: 0;
}
.subtopic-list.active {
    max-height: 500px; /* Adjust if subtopic lists can be very long */
    opacity: 1;
    padding: 4px;
}

.subtopic-list a {
    font-size: 0.9rem;gap:8px;
    padding: calc(var(--spacing-unit) * 0.75) var(--spacing-unit);
}

.subtopic-list a.active {
    background-color: var(--color-primary-light);
    color: var(--color-text-base);
}

.dark-theme .subtopic-list a.active {
    background-color: var(--color-surface);
    color: var(--color-secondary);
}
.topic-item .icon {width: 1.5rem;height: 1.5rem;stroke-width: 1.5;}

.breadcrumb {
    display: flex;
    gap: var(--spacing-unit);
    margin: calc(var(--spacing-unit) * 3) auto;
    
    flex-wrap: wrap;
}

.breadcrumb-item, .breadcrumb a  {font-size:1rem;font-weight:500;color: var(--color-primary);}
.breadcrumb a:hover {color: var(--color-secondary);}

.breadcrumb-item:not(:last-child)::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke-width='2' fill='%23cc7733' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M10 18l6 -6l-6 -6v12' /%3e%3c/svg%3e");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: 0 var(--spacing-unit);
    pointer-events: none;
    vertical-align: middle; /* Align icon with text */
    transform: translateY(-1px); /* Minor position adjustment */
}
.breadcrumb-select {
    /* Reset and position on top of the span */
    grid-area: 1 / 1;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: transparent;
    border: none;
    padding-right:1.5em; /* Right padding for arrow */
    margin: 0;
    width: 100%;
    height: 100%;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-primary);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'  fill='%23cc7733' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M6 10l6 6l6 -6h-12'/%3e%3c/svg%3e");
    background-position: right 0.1em center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
}
.breadcrumb-select-wrapper {
    display: grid;
    grid-template-areas: "select";
    align-items: center;
    position: relative;
}

.breadcrumb-select, .breadcrumb-select-text {
    grid-area: select;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--color-primary);
    padding-right: 1.5em;
    white-space: nowrap;
}

.breadcrumb-select-text {
    /* Place the span below the select */
    z-index: -1;
    visibility: hidden; /* Hide it visually but allow it to set width */
}



.breadcrumb-select:hover {
    color: var(--color-secondary);
}

.breadcrumb-select:focus {
    outline: none;
    text-decoration: underline;
    text-decoration-color: var(--color-secondary);
}

/* ==========================================================================
   7. ARTICLE READER STYLES
   ========================================================================== */
.article-header {
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
    margin: 0 auto;
    max-width: 1200px;
    border: var(--edge);
    border-radius: var(--border-radius);
    background-color: var(--color-surface);
    padding: calc(var(--spacing-unit) * 2);margin-bottom: calc(var(--spacing-unit) * 3) ;
}

.article-header-image {
    width: clamp(300px, 40%, 500px);
    aspect-ratio: 3/2;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.article-header-content {display:flex;flex-direction: column;
    padding: var(--spacing-unit);height:100%;gap:1rem;
    flex-grow: 1;background: var(--hero-bg-image) no-repeat center center/cover;;
}
.text-context{ text-transform:capitalize; font-size:0.9rem;color: 'var(--color-text-muted)';  
    font-style: 'italic';font-weight: 500;margin-bottom:2rem;} 

.article-header-content h3 {
    font-size: clamp(1.4rem, 2.5vw, 3rem);;
}

.article-details {
    border: var(--edge);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 4);
    width: 96%;
    max-width: 1200px;
    margin: 2rem auto;
}

.article-body-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: calc(var(--spacing-unit) * 3);
    font-size: 0.9rem;
    border: var(--edge);
}

.article-body-table th, .article-body-table td {
    border: var(--edge);
    padding: var(--spacing-unit);
    text-align: left;
}

.article-body-table th {
    background-color: var(--color-primary-light);
    font-weight: 700;
}

.media-block {
    background-color: var(--color-surface);
    border: var(--edge);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.media-downloads {
    display: flex;
    gap: var(--spacing-unit);
}

.audio-player {
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
    align-items: center;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.audio-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius);
    object-fit: cover;
}

.audio-info {
    flex-grow: 1;
}


.audio-info p {
    font-weight: 700;
    margin: 0 0 var(--spacing-unit) 0;
}

.audio-info audio {
    width: 100%;
    height: 40px;
}

.lyrics-container {
    max-height: 100px;
    overflow-y: auto;
    border: var(--edge);
    padding: var(--spacing-unit);
    border-radius: var(--border-radius);
    text-align: center;
}

.lyrics-container p.active {
    color: var(--color-primary);
    font-weight: bold;
}
.article-body h3 {
    font-size:clamp(1.2rem, calc(1rem + 0.5vw), 2rem);font-weight: 500;
    margin-top: calc(var(--spacing-unit) * 2);
}
.article-body p {
    text-align: justify;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.content-image-wrapper {
    width: clamp(300px, 40%, 500px);
    margin: calc(var(--spacing-unit) * 3);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.article-body img {
    width: 100%;
    aspect-ratio: 3/2;
    border-radius: var(--border-radius);
    display: block; /* Removes bottom space under image */
}

.article-body ul {
    list-style: disc;margin-bottom:1rem;
}

.content-image-wrapper.img-left {
    float: left;
    margin-left: 0;
}

.content-image-wrapper.img-right {
    float: right;
    margin-right: 0;
}

.article-body blockquote {
    background-color: var(--color-background);
    border-left: 4px solid var(--color-primary);
    padding: calc(var(--spacing-unit) * 2);
    margin: calc(var(--spacing-unit) * 3) 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
    color: var(--color-text-muted);
}

.content-image-wrapper figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    padding: var(--spacing-unit) 0;
}
.article-footer {
    margin: calc(var(--spacing-unit) * 4) auto 0;
}

.keywords-section {
    padding-top: var(--spacing-unit);
    border-top: var(--edge);
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.keywords-section h3 {margin-bottom: var(--spacing-unit);}

.meta-section {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    padding-top: var(--spacing-unit);
    border-top: var(--edge);font-weight:500;text-align: right;
}

.keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-unit);
}

.keyword-pill {
    background-color: var(--color-primary-light);
    color: var(--color-text-muted);
    padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 2);
    border-radius: 99px;
    font-size: 0.85rem;
}

.page-nav {
    padding-top: calc(var(--spacing-unit) * 3);
    max-width: 1200px;margin: 0 auto;font-size: 0.9rem;font-weight: 500;
}

.page-nav a {
    display: flex;
    align-items: center;
    gap: var(--spacing-unit);
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 2);
    border: var(--edge);
    border-radius: var(--border-radius);
    transition: background-color 0.2s, color 0.2s;
}

.page-nav a:hover {
    background-color: var(--color-primary);
    color: var(--color-surface);
}
@media (max-width: 900px) {
    .article-header {
        flex-direction: column;
        align-items: center;
    }
}
@media (max-width: 768px) {
    .article-header {
        flex-direction: column;
        align-items: center;
    }
    .article-header-image {
        width: clamp(280px, 90%, 500px);
    }
    .article-header-content {
        text-align: center;
    }
}

@media (max-width: 767px) {
    .library-sidebar {
        display: none;
        position: fixed;
        top: var(--header-height);
        right: 0;
        width: fit-content;
        min-width: 15rem;
        height: calc(100vh - var(--header-height));
        z-index: 1001;
        flex-direction: column;
        border-right: none;
        box-shadow: var(--shadow-md);
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }

    .library-sidebar.mobile-active {
        display: flex;
        transform: translateX(0);
    }

    .about-sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: var(--edge);
    }
}
/* ==========================================================================
   12. RESPONSIVE STYLES
   ========================================================================== */
@media (min-width: 768px) {
    .hamburger-btn { display: none; }
}
@media (max-width: 767px) {
    .nav-links { display: none; }
}
/* ==========================================================================
   8. ABOUT VIEW STYLES
   ========================================================================== */
.about-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 2);
}

@media (min-width: 768px) {
    .about-layout {
        grid-template-columns: 240px 1fr;
    }
}


.about-sidebar {
    background-color: var(--color-surface);
    padding: calc(var(--spacing-unit) * 2);
    position: sticky;border-right:var(--edge);
    top: var(--header-height);
    height:100vh;
}

.about-sidebar h3 {
    padding-bottom: var(--spacing-unit);
    border-bottom: var(--edge);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.about-sidebar a {
    display: block;
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 2);
    border-radius: var(--border-radius);
    font-weight: 500;
    color: var(--color-text-muted);
    border-left: 3px solid transparent;
}

.about-sidebar a:hover {
    background-color: var(--color-background);
}

.about-sidebar a.active {
    border-left-color: var(--color-primary);
    background-color: var(--color-primary-light);
}

.about-main-content {
    width: 96%;
    max-width: 1200px;
    margin: 0 auto;
}

.about-main-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.about-main-content ul {
    list-style: disc;
}

.about-main-content h2 {
    margin-bottom: calc(var(--spacing-unit) * 3);
    border-bottom: var(--edge);
}
.about-main-content h3 {
    margin-bottom: var(--spacing-unit); margin-top: calc(var(--spacing-unit)*2) ;
    font-size: 1.6rem;
}
.info-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: calc(var(--spacing-unit) * 2);
    margin: calc(var(--spacing-unit) * 3) 0;
}

.info-card {
    background-color: var(--color-surface);
    padding: calc(var(--spacing-unit) * 2);
    border-radius: var(--border-radius);
    border: var(--edge);
    box-shadow: var(--shadow-sm);
}

.info-card-header {
    padding-bottom: var(--spacing-unit);
    gap: var(--spacing-unit);
}

.info-card img {
    height: 50px;
}

.info-card p {
    text-align: justify;
}

/* ==========================================================================
   9. SCRIPTURE VIEW STYLES
   ========================================================================== */
.scripture-navigation-section {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 2);
    padding-top: calc(var(--spacing-unit) * 2);
    border-top: var(--edge);
    margin-top: calc(var(--spacing-unit) * 2);
}

.books-carousel {
    width: auto;

}
.scriptures-view .books-carousel {
  position: relative;margin:1rem auto;
  padding-bottom: 24px; /* Make space for the shelf */
}

.scriptures-view .books-carousel::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px; /* The height of the shelf image */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' viewBox='0 0 60 4.4'%3e%3cpath fill='%23c88b5c' d='M0 0h58v1.8H0z'/%3e%3cpath fill='%23946539' d='M0 1.8h58l-4.3 2.6H4.4z'/%3e%3c/svg%3e");
  background-size: 100% 100%; /* Stretch the image to full width and height */
  filter: drop-shadow(0px 3px 12px rgba(0,0,0,0.5));
}
.book-info, .chapters-list, .verses-list {
    display: flex; /* Use flexbox for layout */
    flex-direction: column; /* Stack children vertically */
    flex: 1 1 300px;
    padding: calc(var(--spacing-unit)*3);
    padding-right:8px;
    border: var(--edge);
    border-radius: var(--border-radius);
    max-height: 300px;
}

.book-info-details,
.chapters-list ul,
.verses-list ul {
    overflow-y: auto; /* Make only the content scrollable */
}


.book-info h3,.chapters-list h3, .verses-list h3 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-unit);
    padding-bottom: var(--spacing-unit);
    position: sticky;
    top: 0;
    z-index: 1;margin-right:calc(var(--spacing-unit)*2);
}

.chapters-list ul, .verses-list ul {
    padding: 0;
}
.book-info-details p{font-size: 0.9rem;margin-bottom: 1rem;text-align: justify;}
.chapters-list li a {
    display: block;
    padding: var(--spacing-unit);
    border-radius: 4px;
}

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

.chapters-list li.active a {
    background-color: var(--color-primary);
    color: var(--color-surface);
    font-weight: bold;
}

.chapter-summary {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    padding: 0 var(--spacing-unit);
    margin: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out;
}

.chapters-list li.active .chapter-summary {
    max-height: 200px;
    opacity: 1;
    padding-top: var(--spacing-unit);
}

.verses-list ul {
    display: flex;
    flex-wrap: wrap;align-content: flex-start;
    gap: var(--spacing-unit);
}

.verses-list li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    border-radius: 50%;
    border: var(--edge);
    transition: all 0.2s;
}

.verses-list li a:hover {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary);
}

.verses-list li.active a {
    background-color: var(--color-primary);
    color: var(--color-surface);
    border-color: var(--color-primary);
}


.verse-content-area {
    max-width: 1200px;
    margin: 0 auto;
}

.verse-header {
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
    padding: calc(var(--spacing-unit) * 2);
    background-color: var(--color-background);
    border-radius: var(--border-radius);
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.verse-header img {
    height: clamp(150px, 15vw, 300px);
    width: auto;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.verse-header .header-text {
    gap: calc(var(--spacing-unit) * 0.5);
}

.verse-header .header-text h4 {
    font-size: 1rem;
    color: var(--color-text-muted);
    font-family: var(--font-family-body);
}

.verse-header .header-text h3 {
    font-size: 1.8rem;
    margin: 0;
}

.verse-header .header-text p {
    font-style: italic;
    margin: 0;
}

@media (max-width: 768px) {
    .verse-header {
        flex-direction: column;
    }
}

/* ==========================================================================
   10. PAGINATION STYLES
   ========================================================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem auto;
    gap: var(--spacing-unit);
}

.pagination .btn {
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 2);
    font-size: 0.9rem;
    min-width: 80px;
}

.pagination .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    font-size: 0.9rem;
    color: var(--color-text-muted);margin:0.5rem;
}

/* ==========================================================================
   11. UNUSED CODE
   ========================================================================== */
/* The following styles are not referenced in the provided HTML/JS code */
.settings-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background-color: var(--color-surface);
    border: var(--edge);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-unit);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.settings-title {
    font-size: 1.1rem;
    text-align: center;
    padding: var(--spacing-unit);
    margin: 0;
    border-bottom: var(--edge);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-unit);
}

.setting-control {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) / 2);
}

.setting-control button, .setting-control a {
    background-color: var(--color-background);
    border: var(--edge);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 0.5) var(--spacing-unit);
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1rem;
    min-width: 40px;
    text-align: center;
}

.setting-control a {
    display: inline-block;
}

.setting-control button:hover, .setting-control a:hover {
    background-color: var(--color-primary-light);
}

.setting-control button.active {
    background-color: var(--color-primary);
    color: var(--color-surface);
    border-color: var(--color-primary);
}

.verse-block {
    background-color: var(--color-background);
    border-left: 4px solid var(--color-primary);
    padding: calc(var(--spacing-unit) * 2);
    margin: calc(var(--spacing-unit) * 3) 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.verse-sanskrit {
    font-family: var(--font-family-body);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-unit);
}

.transliteration-cell {
    font-style: italic;
    color: var(--color-text-muted);
}

.chapters-list li p {
    background-color: transparent;
    border-radius: 0;
}

.chessboard {
  width: 100%;
  max-width: 400px;
  height: auto;
}

.icon-chess {
  width: 32px;
  height: 32px;
  stroke: var(--accent);
  fill: none;
}

@media (max-width: 600px) {
    .content-image-wrapper {
        float: none !important;
        width: 90%;
        margin: 1rem auto;
    }
}
