@font-face {
    font-family: 'Bookerly';
    src: local('Bookerly'), local('Bookerly Regular'), local('Bookerly-Regular');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Bookerly';
    src: local('Bookerly Bold'), local('Bookerly-Bold');
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: 'Bookerly';
    src: local('Bookerly Italic'), local('Bookerly-Italic'), local('Bookerly Regular Italic');
    font-weight: normal;
    font-style: italic;
}
@font-face {
    font-family: 'Bookerly';
    src: local('Bookerly Bold Italic'), local('Bookerly-BoldItalic');
    font-weight: bold;
    font-style: italic;
}
@font-face {
    font-family: 'ProportionalTamil';
    src: local('Noto Serif Tamil'), local('Noto Sans Tamil'), local('Latha'), local('Nirmala UI'), local('Vijaya'), local('Tamil MN');
    unicode-range: U+0B80-0BFF;
    size-adjust: 88%;
}
@font-face {
    font-family: 'ProportionalSanskrit';
    src: local('Sanskrit 2003'), local('Noto Serif Devanagari'), local('Noto Sans Devanagari'), local('Mangal'), local('Nirmala UI'), local('Devanagari MT');
    unicode-range: U+0900-097F, U+1CD0-1CFF, U+A8E0-A8FF;
    size-adjust: 92%;
}

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

body {
    font-family: 'Bookerly', 'Literata', 'ProportionalTamil', 'ProportionalSanskrit', Georgia, 'Liberation Serif', 'Times New Roman', serif;
    background-color: #fdfaf3;
    color: #1f1a17;
    padding-top: 2.5em;
    padding-bottom: 2.5em;
}

coverpage { text-align: center; page-break-before: always; }
h1, h2, h3, h4 {
    font-family: 'Bookerly', 'Literata', 'ProportionalTamil', Georgia, serif;
}
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-family: 'Bookerly', 'Literata', Georgia, serif;
    font-weight: bold;
    font-size: 1.15em;
    text-align: center;
    margin-top: 0.75em;
    margin-bottom: 0.75em;
}

atitle {
    font-size: 1.45em;
    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.4em; }
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-family: 'Bookerly', 'Literata', 'ProportionalTamil', 'ProportionalSanskrit', Georgia, serif;
    font-size: 1em;
    text-indent: 2em;
    line-height: 1.65em;
    margin-top: 1em;
    margin-bottom: 1em;
}

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

para > translation {
    display: block;
    font-family: 'Bookerly', 'Literata', Georgia, serif;
    text-indent: 2em;
    line-height: 1.65em;
    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: 0.8em;
    margin-bottom: 0.8em;
    margin-left: 2em;
    line-height: 1.6em;
    page-break-inside: avoid;
}

line { display: block; line-height: 1.55em; }
verse[language="ta"] {
    display: block;
    font-family: 'ProportionalTamil', 'Noto Serif Tamil', 'Noto Sans Tamil', serif;
    font-style: normal;
    font-size: 0.96em;
    margin-top: 0.9em;
    margin-bottom: 0.35em;
}
verse[language="ta"] > line {
    font-family: 'ProportionalTamil', 'Noto Serif Tamil', 'Noto Sans Tamil', serif;
    font-style: normal;
}
verse[language="en"] {
    display: block;
    font-family: 'Bookerly', 'Literata', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 0.94em;
    color: #3a2b22;
    margin-top: 0.35em;
    margin-bottom: 1em;
    line-height: 1.55em;
}
verse[language="en"] > line {
    font-family: 'Bookerly', 'Literata', Georgia, 'Times New Roman', serif;
    font-style: italic;
}
verse[language="sa"] { display: block; font-style: normal; margin-top: 1em; line-height: 1.5em; }
verse[language="sa"] > line { font-family: 'ProportionalSanskrit', 'Sanskrit 2003', 'Noto Serif Devanagari', serif; font-style: normal; font-size: 1.1em; }
verse[language="gr"] { display: block; font-style: normal; margin-top: 1em; line-height: 1.5em; }
sverse > line { font-family: "Sanskrit 2003"; font-style: normal; }
gverse > line { font-family: "Noto Serif Grantha"; font-style: normal; font-size: .85em; }

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

em, i {
    font-family: 'Bookerly', 'Literata', Georgia, 'Times New Roman', serif;
    font-weight: normal;
    font-style: italic;
}

ol, ul {
    font-family: 'Bookerly', 'Literata', Georgia, serif;
    margin: 0.8em 0;
    padding-left: 2.2em;
    text-indent: 0;
    line-height: 1.6em;
}

ol > li, ul > li {
    margin: 0.35em 0;
    text-indent: 0;
}

ol.bibliography {
    list-style: decimal outside;
    padding-left: 2.2em;
}

footnote > text {
    display: block;
    font-family: 'Bookerly', 'Literata', Georgia, serif;
    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 {
    max-width: 75%;
    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-family: 'Bookerly', 'Literata', Georgia, serif;
    font-size: 0.95em;
    font-weight: bold;
    color: #4a3d33;
    text-align: center;
    margin-top: 0.6em;
    line-height: 1.5em;
}

table {
    font-family: 'Bookerly', 'Literata', Georgia, serif;
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

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

thead th {
    background-color: #ece1ca;
    color: #7a2021;
    font-weight: bold;
}

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

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