/* Global variables declared in :root */
:root {
    --primary-color: #3E703C;
    --primary-dark-color: #2F542E;
    --accent-1-color: #C08F4C;
    --accent-2-color: #A3735E;
    --neutral-color: #E6E0D5;
    --highlight-color: #F7F5F2;
    --text-color: #2b2b2b;
}

/*!* Local variable scoped to the .card class *!*/
/*.card {*/
/*  --card-bg: #f0f0f0;*/
/*}*/

@font-face {
    font-family: "Vazirmatn";
    src: url("/static/fonts/vazirmatn/Vazirmatn[wght].woff2") format("woff2-variations");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

html {
    scroll-behavior: smooth;
    direction: rtl;
}

body {
    font-family: "Vazirmatn", system-ui, -apple-system, sans-serif;
    font-weight: 400;
    color: var(--text-color);
}

p {
    line-height: 1.7;
    text-align: justify;
}

/*html[lang="fa"] i {*/
/*    font-synthesis: none;*/
/*}*/

/*html[lang="fa"] em {*/
/*    font-style: italic;*/
/*    font-synthesis: none;*/
/*    font-variation-settings: "slnt" -6;*/
/*}*/

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

.page-header {
    margin-bottom: 2rem;
}

.toc {
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 0.5rem;
    /*border: 1px solid #555555;*/
    /*border-radius: 0.3rem;*/
}

.toc li {
    display: block;
    padding: .3rem 0;
}

.toc a {
    color: var(--text-color, #555);
    text-decoration: none;
}

.toc a:hover, .toc .toc-top a:hover {
    color: var(--primary-dark-color, #3e703c);
    text-decoration: underline;
}

.toc-top a {
    color: var(--text-color, #555);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.toc-divider {
    height: 1px;
    background-color: #ddd;
    margin: 0.5rem 0 0.75rem;
}

/* RTL-aware TOC indentation */
.toc-level-2 {
    margin-right: 0;
}

.toc-level-3 {
    margin-right: 1rem;
}

.toc-level-4 {
    margin-right: 2rem;
}

.toc-level-5 {
    margin-right: 3rem;
}

.toc-level-6 {
    margin-right: 4rem;
}

html[dir="ltr"] .toc-level-3 {
    margin-left: 1rem;
    margin-right: 0;
}

html[dir="ltr"] .toc-level-4 {
    margin-left: 2rem;
    margin-right: 0;
}

html[dir="ltr"] .toc-level-5 {
    margin-left: 3rem;
    margin-right: 0;
}

html[dir="ltr"] .toc-level-6 {
    margin-left: 4rem;
    margin-right: 0;
}

.toc a.active {
    font-weight: 500;
    color: var(--primary-dark-color, #3e703c);
    border-right: 3px solid var(--primary-color); /* Bootstrap primary */
    padding-right: 0.5rem;
}

html[dir="ltr"] .toc a.active {
    border-right: none;
    border-left: 3px solid var(--primary-color);
    padding-left: 0.5rem;
    padding-right: 0;
}

/* styling text */

h1 {
    font-size: 2.5rem;
    font-weight: 500;
    padding-bottom: 1rem;
    padding-top: 1.5rem;
    margin: 0;
}

h2 {
    font-size: 2rem;
    font-weight: 400;
    padding-bottom: 0.75rem;
    padding-top: 1.25rem;
    margin: 0;
}

h3 {
    font-size: 1.75rem;
    font-weight: 400;
    padding-bottom: 0.5rem;
    padding-top: 1rem;
    margin: 0;
}

h4 {
    font-size: 1.5rem;
    font-weight: 400;
    padding-bottom: 0.25rem;
    padding-top: 0.75rem;
    margin: 0;
}

h5 {
    font-size: 1.25rem;
    font-weight: 400;
    padding-bottom: 0;
    padding-top: 0.5rem;
    margin: 0;
}

h6 {
    font-size: 1rem;
    font-weight: 400;
    padding-bottom: 0;
    padding-top: 0.25rem;
    margin: 0;
}

h2.section_name, h2.reference_title {
    color: white;
    padding: 0.3rem 1rem;
    margin: 2rem 0 0.5rem;
    font-size: 1rem;
    background-color: var(--primary-color);
    border-radius: 300rem;
}

h2.reference_title {
    background-color: var(--accent-1-color);
}

section.footnotes ol li, section.footnotes ol li p {
    margin: 0;
}

sup.footnote-ref a {
    text-decoration: none;
}

strong {
    font-weight: 500;
}

.footnotes-sep {
    display: none;
}

a.entry-inline {
    /*color: var(--primary-color);*/
    display: inline-block;
    text-decoration: none;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

a.entry-inline:hover {
    text-decoration: underline;
}

a.no_entry {
    color: #551A8B;
}

/* Bootstrap Tooltip */
.tooltip-inner {
    max-width: 400px !important;
}

/* Styling revisions diff page */
.revision-checkbox:disabled + label {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Diff table styles */
.table-responsive {
    width: 100%;
    overflow-x: visible; /* Remove horizontal scrollbar */
}

.diff {
    width: 100%;
    border-collapse: collapse;
    font-family: Vazirmatn, serif;
    font-size: .9rem;
    table-layout: auto;
}

.diff tbody {
    font-family: inherit;
    white-space: pre-wrap;
    word-wrap: normal;
    word-break: normal;
}

.diff td {
    padding: 0.25rem 0.5rem;
    vertical-align: top;
    border: 1px solid #dee2e6;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
}

.diff thead {
    background-color: #f8f9fa;
    text-align: center;
    font-weight: bold;
}

.diff .diff_header {
    background-color: #f8f9fa;
    text-align: right;
    padding: 0.25rem 0.5rem;
    border: 1px solid #dee2e6;
    font-weight: bold;
}

.diff .diff_next {
    background-color: #f8f9fa;
    width: 1.5rem;
}

.diff .diff_add {
    background-color: #d4edda;
}

.diff .diff_chg {
    background-color: #fff3cd;
}

.diff .diff_sub {
    background-color: #f8d7da;
}

.diff .diff_header {
    background-color: #e9ecef;
}

.diff td.diff_header,
.diff th.diff_header {
    width: 1%;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
}

.diff td:not(.diff_header):not(.diff_next),
.diff th:not(.diff_header):not(.diff_next) {
    width: auto;
}

/*.list-group-item {*/
/*    padding: 0.75rem 1.25rem;*/
/*}*/

/*.form-check {*/
/*    margin: 0;*/
/*}*/

/*.form-check-input {*/
/*    margin-top: 0.3em;*/
/*}*/

#compareBtn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.select2-container {
    display: block;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #dee2e6;
    appearance: none;
    border-radius: 0.375rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.select2-selection__clear {
    display: none;
}

.select2-container--default .select2-selection--single {
    border: none !important;
}

/* Style search results */
mark {
    background-color: #90e38c !important;
}

/* Style Poems sections*/
.poem {
    line-height: 1.5 !important;
    margin: .5rem 1rem .5rem !important;
}