/* Jaina Literature Portal — Text Page Styles */
:root {
    --parchment:      #f5eed6;
    --parchment-mid:  #ede4c6;
    --ink:            #1e120a;
    --burgundy:       #5c0a0a;
    --gold:           #a07820;
    --gold-light:     #c9a84c;
    --gold-pale:      #ecd98c;
    --ochre:          #b87820;
    --rust:           #7a2e00;
    --muted:          #6b5a3a;
    --border:         rgba(160, 120, 32, 0.35);
    --border-strong:  rgba(160, 120, 32, 0.6);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
@font-face {
    font-family: 'Junicode';
    src: local('Junicode'), url('../../fonts/Junicode.woff2') format('woff2');
    font-weight: normal; font-style: normal;
}
@font-face {
    font-family: 'Adishila';
    src: local('Adishila'), url('../../fonts/AdishilaSemiBoldB.woff') format('woff');
    font-weight: normal; font-style: normal;
}
@font-face {
    font-family: 'Ekatra-B';
    src: local('Ekatra-B'), url('../../fonts/Ekatra-B.woff') format('woff');
    font-weight: normal; font-style: normal;
}
body {
    font-family: 'Junicode', 'Adishila', Georgia, serif;
    background-color: var(--parchment);
    background-image:
        radial-gradient(ellipse 80% 60% at 15% 40%, rgba(193,127,36,0.07) 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 85% 20%, rgba(92,10,10,0.04) 0%, transparent 55%);
    color: var(--ink);
    min-height: 100vh;
    line-height: 1.7;
}
.site-header {
    background-color: var(--burgundy);
    background-image: linear-gradient(175deg, #6e0e0e 0%, #3e0606 100%);
    color: var(--gold-pale);
    padding: 36px 40px 32px;
    position: relative;
    overflow: hidden;
}
.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 30px, rgba(255,255,255,0.015) 30px, rgba(255,255,255,0.015) 31px);
    pointer-events: none;
}
.header-inner { max-width: 740px; margin: 0 auto; position: relative; z-index: 1; }
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--gold-pale);
    text-decoration: none;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 18px;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    transition: opacity 0.2s, border-color 0.2s;
}
.back-link:hover { opacity: 1; border-color: rgba(255,220,140,0.4); }
.text-title {
    font-family: 'Junicode', 'Adishila', Georgia, serif;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: normal;
    color: var(--parchment);
    line-height: 1.25;
    margin-bottom: 8px;
}
.text-author { font-size: 0.9rem; font-style: italic; color: var(--gold-pale); opacity: 0.75; margin-bottom: 14px; }
.text-author::before { content: '— '; opacity: 0.6; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.tag { display: inline-block; padding: 2px 8px; font-size: 0.63rem; letter-spacing: 0.09em; text-transform: uppercase; border: 1px solid; border-radius: 1px; }
.tag-sanskrit  { color: #e8d09a; border-color: rgba(201,168,76,0.6); background: rgba(201,168,76,0.1); }
.tag-prakrit   { color: #b0c8e8; border-color: rgba(100,160,220,0.5); background: rgba(74,122,172,0.12); }
.tag-apabhramsha { color: #b0d8a0; border-color: rgba(120,180,80,0.5); background: rgba(90,138,58,0.12); }
.tag-sauraseni { color: #d8b8e8; border-color: rgba(160,100,200,0.5); background: rgba(138,74,170,0.1); }
main { max-width: 740px; margin: 0 auto; padding: 40px 28px 60px; }
.meta-panel {
    background: rgba(255,255,255,0.35);
    border: 1px solid var(--border);
    border-left: 4px solid var(--burgundy);
    padding: 20px 24px;
    margin-bottom: 28px;
}
.meta-panel-label { font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; font-weight: normal; opacity: 0.7; }
.meta-grid { display: grid; grid-template-columns: max-content 1fr; gap: 5px 18px; }
.meta-key { color: var(--muted); font-size: 0.78rem; opacity: 0.85; }
.meta-val { font-size: 0.84rem; color: var(--ink); }
.about-box {
    background: rgba(255,255,255,0.25);
    border: 1px solid var(--border);
    padding: 18px 22px;
    margin-bottom: 28px;
    font-size: 0.88rem;
    line-height: 1.75;
    color: #3a2a18;
}
.about-box p { margin-bottom: 10px; }
.about-box p:last-child { margin-bottom: 0; }
.about-box a { color: var(--rust); border-bottom: 1px solid rgba(122,46,0,0.3); text-decoration: none; }
.about-box a:hover { border-color: rgba(122,46,0,0.7); }
.about-box ol, .about-box ul { margin: 8px 0 8px 20px; }
.about-box li { margin-bottom: 3px; font-size: 0.86rem; }
.metre-info {
    background: rgba(255,255,255,0.2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    padding: 12px 18px;
    margin-bottom: 28px;
    font-size: 0.83rem;
    line-height: 1.65;
}
.metre-info strong { color: var(--burgundy); }
.metre-info p { margin-bottom: 6px; }
.metre-info p:last-child { margin-bottom: 0; }
.text-note {
    background: rgba(92,10,10,0.06);
    border: 1px solid rgba(92,10,10,0.15);
    padding: 10px 16px;
    margin-bottom: 20px;
    font-size: 0.86rem;
    font-style: italic;
    color: var(--burgundy);
}
.script-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    border: 1px solid var(--border-strong);
    width: fit-content;
    border-radius: 2px;
    overflow: hidden;
}
.toggle-btn {
    padding: 8px 22px;
    border: none;
    background: transparent;
    font-family: 'Junicode', Georgia, serif;
    font-size: 0.78rem;
    color: var(--muted);
    cursor: pointer;
    letter-spacing: 0.07em;
    transition: background 0.2s, color 0.2s;
    border-right: 1px solid var(--border-strong);
}
.toggle-btn:last-child { border-right: none; }
.toggle-btn.active { background: var(--burgundy); color: var(--gold-pale); }
.toggle-btn:hover:not(.active) { background: var(--parchment-mid); color: var(--burgundy); }
.script-section { display: block; }
.script-section.hidden { display: none; }
.text-section-heading {
    font-family: 'Junicode', 'Adishila', Georgia, serif;
    font-size: 0.95rem;
    font-weight: normal;
    color: var(--burgundy);
    margin: 28px 0 12px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--border);
}
.devanagari .text-section-heading { font-family: 'Adishila', 'Junicode', Georgia, serif; }
.script-section p {
    margin-bottom: 1.5em;
    line-height: 1.9;
    color: var(--ink);
    padding-left: 1.1em;
    border-left: 2px solid var(--border);
    font-size: 1rem;
}
.devanagari p { font-family: 'Adishila', 'Junicode', serif; font-size: 1.05rem; }
.script-section p:last-child { margin-bottom: 0; }
.colophon {
    font-style: italic !important;
    color: var(--muted) !important;
    border-left-color: transparent !important;
    padding-left: 0 !important;
    font-size: 0.87rem !important;
    margin-top: 1.5em !important;
    line-height: 1.6 !important;
}
.analysis-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-bottom: 20px; }
.analysis-table td { padding: 5px 12px; border: 1px solid var(--border); font-family: 'Adishila', 'Junicode', serif; }
.analysis-table tr:nth-child(even) td { background: rgba(255,255,255,0.3); }
.code-block { background: rgba(30,18,10,0.05); border: 1px solid var(--border); padding: 16px 20px; font-family: monospace; font-size: 0.8rem; line-height: 1.6; overflow-x: auto; color: #2a1a0a; }
hr.text-divider { border: none; border-top: 1px solid var(--border); margin: 36px 0; }
footer { border-top: 1px solid var(--border); text-align: center; padding: 22px 20px; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.75; max-width: 740px; margin: 0 auto; }
footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--border); }
footer a:hover { color: var(--burgundy); }
@media (max-width: 600px) {
    .site-header { padding: 26px 18px 22px; }
    main { padding: 28px 16px 50px; }
    .meta-grid { grid-template-columns: 1fr; }
    .meta-key { margin-top: 8px; }
    .script-section p { padding-left: 0.7em; }
}
