/* ── Prolegomena-specific styles using site design tokens ── */
:root {
    --saffron:        #D4600A;
    --saffron-light:  #F0924A;
    --saffron-wash:   rgba(212, 96, 10, 0.07);
    --indigo:         #2E5FA3;
    --indigo-dark:    #1C3D70;
    --maroon:         #7A1E1E;
    --amber:          #C97A1A;
    --ink:            #1A1209;
    --ink-secondary:  #4A3B2A;
    --parchment:      #FDFAF4;
    --parchment-mid:  #F5EFE2;
    --rule:           rgba(180, 130, 60, 0.22);
    --shadow:         0 2px 18px rgba(90, 50, 10, 0.08);
    --font-devanagari: 'Siddhanta';
    --font-roman:      'Junicode';
}

/* ── Layout ── */
.prol-wrapper {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 20px;
}

.prol-content {
    flex: 1;
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 60px;
    background: var(--parchment);
    box-shadow: var(--shadow);
    min-height: 100vh;
}

@media (max-width: 768px) {
    .prol-content { padding: 24px 20px; }
    .prol-wrapper { flex-direction: column; }
}

/* ── TOC Sidebar ── */
.toc-sidebar {
    position: sticky;
    top: 80px;
    width: 280px;
    min-width: 280px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding: 20px 16px;
    margin-right: 24px;
    font-size: 0.82rem;
    scrollbar-width: thin;
}

.toc-title {
    /* font-family: var(--font-roman); */
    color: var(--saffron);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--saffron-light);
}

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

.toc-list li {
    padding: 4px 0;
    border-left: 2px solid transparent;
}

.toc-list li.toc-l3 {
    padding-left: 16px;
    font-size: 0.78rem;
}

.toc-list li a {
    color: var(--ink-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.toc-list li a:hover {
    color: var(--saffron);
}

.toc-list li.active {
    border-left-color: var(--saffron);
}

.toc-list li.active a {
    color: var(--saffron);
    font-weight: 600;
}

@media (max-width: 1024px) {
    .toc-sidebar { display: none; }
}

/* ── Mobile TOC Toggle ── */
.toc-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--saffron);
    color: #fff;
    border: none;
    font-size: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    cursor: pointer;
}

@media (max-width: 1024px) {
    .toc-mobile-toggle { display: block; }
}

/* ── Front Matter ── */
.front-meta {
    background: var(--parchment-mid);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 20px 28px;
    margin-bottom: 36px;
    font-size: 0.88rem;
    color: var(--ink-secondary);
}

.front-meta p {
    margin: 4px 0;
}

.title-page {
    text-align: center;
    padding: 48px 20px;
    margin-bottom: 36px;
    border-bottom: 2px solid var(--rule);
}

.title-page .tp-line {
    margin: 6px 0;
    font-size: 1.1rem;
    color: var(--ink-secondary);
    letter-spacing: 0.5px;
}

.title-page .tp-line:first-child {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--saffron);
    letter-spacing: 2px;
}

/* ── Section Headings ── */
.section-heading {
    color: var(--saffron);
    font-weight: 700;
    margin: 48px 0 18px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--rule);
    letter-spacing: 0.5px;
    scroll-margin-top: 80px;
}

h2.section-heading {
    font-size: 1.6rem;
}

h3.section-heading {
    font-size: 1.25rem;
    border-left: 4px solid var(--saffron-light);
    border-bottom: none;
    padding: 8px 16px;
    background: var(--saffron-wash);
    border-radius: 0 5px 5px 0;
}

/* ── Prose ── */
.prose {
    /* font-family: var(--font-roman); */
    font-size: 1.05rem;
    line-height: 1.85;
    margin-bottom: 16px;    /* Table Container and General Rules */
.manuscript-table {
    border-collapse: collapse; /* Prevents double borders */
    width: 100%;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Rules for every cell (Headers and Data) */
.manuscript-table th, 
.manuscript-table td {
    border: 1px solid #333; /* Solid black/grey rules */
    padding: 12px 10px;
    text-align: left;
    vertical-align: top; /* Keeps long MS lists aligned at the top */
}

/* Header Specific Styling */
.manuscript-table thead th {
    background-color: #f2f2f2;
    font-weight: bold;
    border-bottom: 2px solid #000; /* Slightly thicker line under headers */
}

/* Zebra Striping (Optional: makes long rows easier to track) */
.manuscript-table tbody tr:nth-child(even) {
    background-color: #fcfcfc;
}

/* Subscript Fix: Prevents <sub> from pushing the row height unevenly */
.manuscript-table sub {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
    bottom: -0.25em;
}
    color: var(--ink);
    text-align: justify;
    hyphens: auto;
}

.prose em {
    color: var(--maroon);
}

/* ── Footnote References ── */
.fn-ref {
    font-size: 0.75em;
    vertical-align: super;
    line-height: 0;
}

.fn-ref a {
    color: var(--saffron);
    text-decoration: none;
    padding: 0 2px;
    border-bottom: 1px dotted var(--saffron-light);
    transition: color 0.15s;
}

.fn-ref a:hover {
    color: var(--indigo);
}

/* ── Footnotes Section ── */
.footnotes-section {
    margin: 32px 0 48px;
    padding: 20px 24px;
    background: var(--parchment-mid);
    border: 1px solid var(--rule);
    border-radius: 6px;
    font-size: 0.9rem;
}

.footnotes-section hr {
    border: none;
    border-top: 1px solid var(--rule);
    margin: 0 0 16px;
}

.footnotes-list {
    padding-left: 24px;
    margin: 0;
}

.footnote-item {
    margin-bottom: 10px;
    line-height: 1.7;
    color: var(--ink-secondary);
    scroll-margin-top: 80px;
}

.footnote-item:target {
    background: rgba(212, 96, 10, 0.1);
    border-radius: 4px;
    padding: 4px 6px;
    margin-left: -6px;
}

.fn-back {
    color: var(--saffron-light);
    text-decoration: none;
    font-size: 0.85em;
    margin-left: 4px;
}

.fn-back:hover {
    color: var(--saffron);
}

/* ── Page Markers ── */
.page-marker {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--saffron-light);
    background: var(--saffron-wash);
    padding: 1px 6px;
    border-radius: 3px;
    margin: 0 2px;
    vertical-align: middle;
    opacity: 0.7;
}

/* ── Navbar overrides ── */
.navbar-ontop {
    z-index: 1031;
}

/* .hdclr {
    color: var(--saffron);
} */

/* ── Footer ── */
footer {
    margin-top: 48px;
}

/* Table Container and General Rules */
.manuscript-table {
    border-collapse: collapse; /* Prevents double borders */
    width: 100%;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Rules for every cell (Headers and Data) */
.manuscript-table th, 
.manuscript-table td {
    border: 1px solid #333; /* Solid black/grey rules */
    padding: 12px 10px;
    text-align: left;
    vertical-align: top; /* Keeps long MS lists aligned at the top */
}

/* Header Specific Styling */
.manuscript-table thead th {
    background-color: #f2f2f2;
    font-weight: bold;
    border-bottom: 2px solid #000; /* Slightly thicker line under headers */
}

/* Zebra Striping (Optional: makes long rows easier to track) */
.manuscript-table tbody tr:nth-child(even) {
    background-color: #fcfcfc;
}

/* Subscript Fix: Prevents <sub> from pushing the row height unevenly */
.manuscript-table sub {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
    bottom: -0.25em;
}


