@media print {
    hr, navigation, #std-flipbook-nav { visibility: hidden; }
    body { margin: 3em; }
}

body {
    font-family: "Noto Serif Tamil", "Noto Sans Tamil", "Times New Roman", serif;
    background-color: #fdfaf3;
    color: #1f1a17;
    padding-top: 2.5em;
    padding-bottom: 2.5em;
    margin-left: 12%;
    margin-right: 12%;
    line-height: 1.65;
}

@media screen and (max-width: 768px) {
    body {
        margin-left: 5%;
        margin-right: 5%;
        padding-top: 3.8em;
        font-size: 0.96em;
    }
    #std-flipbook-nav {
        top: 6px !important;
        right: 6px !important;
        left: 6px !important;
        justify-content: center;
        flex-wrap: wrap;
        padding: 5px 6px !important;
        gap: 4px !important;
    }
    #std-flipbook-nav a {
        font-size: 11.5px !important;
        padding: 3px 7px !important;
        white-space: nowrap;
    }
    para > text {
        text-indent: 1.2em;
    }
    verse, sverse, gverse, inscription {
        margin-left: 0.4em !important;
        margin-right: 0.2em !important;
        max-width: 100% !important;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    figure img, .half, .full, .pfull, .lfull, .center {
        max-width: 96% !important;
    }
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.9em;
    }
}

coverpage { text-align: center; page-break-before: always; }
h1, h2 { page-break-before: always; font-size: 1.25em; text-align: center; color: #7a2021; }

navigation { display: block; }
navigation a { color: #7a2021; text-decoration: none; font-weight: bold; }
navigation a:hover { text-decoration: underline; }
text > a { text-decoration: none; font-weight: bold; margin-left: .05em; color: #7a2021; }

article > details > id { display: none; }
article > bdetails > id { display: none; }
id, pfile, cfile, nfile { display: none; }

book-title, book, title, atitle, btitle, subtitle, author, publisher, year {
    display: block;
    font-weight: bold;
    font-size: 1.15em;
    text-align: center;
    margin-top: 0.75em;
    margin-bottom: 0.75em;
}

atitle {
    font-size: 1.4em;
    color: #7a2021;
}

atitle1 { display: block; font-weight: bold; font-size: 1.15em; text-align: center; }
title > line, atitle > line { font-size: 1em; line-height: 1.5em; }
publisher, year { font-size: .85em; }

b { font-weight: bold; }
br { display: block; }

para {
    display: block;
    margin-top: 1em;
    margin-bottom: 1em;
    text-align: justify;
    break-inside: auto;
}

para > text {
    display: block;
    font-size: 1em;
    text-indent: 2em;
    line-height: 1.65em;
    margin-top: 1em;
    margin-bottom: 1em;
}

para > text.continued-text {
    text-indent: 0;
}

para > text1, text1 {
    display: block;
    text-align: right !important;
    text-indent: 0 !important;
    font-weight: bold;
    line-height: 1.5em;
    margin-top: 0.8em;
}

para > translation {
    display: block;
    text-indent: 2em;
    line-height: 1.6em;
    margin-top: 1em;
    margin-bottom: 1em;
}

text > sup {
    line-height: 0;
    vertical-align: super;
    font-size: 0.85em;
    font-weight: bold;
    margin-left: 0.15em;
    margin-right: .25em;
}

verse > line > sup {
    line-height: 0;
    vertical-align: super;
    font-size: .75em;
    font-weight: bold;
    margin-left: 0.05em;
    margin-right: .25em;
}

sup { font-size: .85em; margin-left: .05em; }
details > title > line > sup,
p-title > sup {
    line-height: 0;
    vertical-align: super;
    font-weight: bold;
    margin-left: 0.05em;
    margin-right: .25em;
}

verse > number { display: none; }
verse, sverse, gverse, inscription {
    display: block;
    font-style: normal;
    margin-top: 1em;
    margin-bottom: 1em;
    margin-left: 1.5em;
    line-height: 1.6em;
    page-break-inside: avoid;
}

verse > line:nth-child(even) {
    padding-left: 1.5em;
}

inscription {
    background: rgba(201, 162, 77, 0.08);
    border-left: 3px solid #c9a24d;
    padding: 0.6em 1em;
    border-radius: 0 4px 4px 0;
    margin-left: 0.8em;
    margin-right: 0.4em;
}

line { display: block; line-height: 1.55em; }
verse[language="en"] > line { font-family: "Serif"; font-style: italic; }
sverse > line { font-family: "Sanskrit 2003"; font-style: normal; }
gverse > line { font-family: "Noto Serif Grantha"; font-style: normal; font-size: .85em; }

p-title, s-title {
    display: block;
    font-weight: bold;
    font-size: 1.12em;
    color: #5b1919;
    text-align: left;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
}

em { font-weight: bold; font-style: normal; }

para > text > ul,
para > ul {
    display: block;
    list-style: disc;
    columns: 1;
    list-style-position: outside;
    text-indent: 0;
    padding-left: 1.4em;
    margin-left: 0.8em;
    margin-right: 0.8em;
}
para > text > ul > li,
para > ul > li { display: list-item; line-height: 1.6em; margin-top: 0.3em; }

para > text > ol,
para > ol {
    display: block;
    list-style: decimal;
    list-style-position: outside;
    text-indent: 0;
    padding-left: 1.6em;
    margin-left: 0.8em;
}
para > text > ol > li,
para > ol > li { display: list-item; color: #1f1a17; line-height: 1.65em; margin-bottom: 0.2em; }

footnote > text {
    display: block;
    margin-top: 1em;
    margin-bottom: 1em;
    text-align: justify;
    line-height: 1.5em;
    text-indent: 0;
}
footnote > text > sup { vertical-align: baseline; font-weight: normal; }
footnote > p-title { display: block; font-weight: bold; text-align: center; margin-top: 1em; margin-bottom: 1em; }

figure {
    display: block;
    margin: 1.5em auto;
    text-align: center;
}

.floatright { width: 35%; float: right; margin-left: 1.5em; margin-right: 0; }
.floatleft { width: 35%; float: left; margin-right: 1.5em; margin-left: 0; }
.floatnone, .hbooktitle, .booktitle, .pfull {
    max-width: 78%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

figure img,
.half, .full, .pfull, .lfull, .center {
    max-width: 100%;
    max-height: 75vh;
    width: auto;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.caption, figcaption {
    font-size: 0.95em;
    font-weight: bold;
    color: #4a3d33;
    text-align: center;
    margin-top: 0.6em;
    line-height: 1.5em;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

table, th, td {
    border: 1px solid #cbbba0;
}

th, td {
    padding: 6px 10px;
    text-align: left;
    vertical-align: top;
}

.reference {
    border: none;
    font-size: 0.92em;
    margin-left: 1em;
}
.reference td {
    border: none;
    padding: 3px 6px;
}
