@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&family=Noto+Serif+Devanagari:wght@400;500;600;700&display=swap');

:root {
  --sv-devanagari-sans: "Noto Sans Devanagari", "Noto Sans", sans-serif;
  --sv-devanagari-serif: "Noto Serif Devanagari", "Noto Serif", serif;
}

.md-typeset,
.md-nav,
.md-header,
.md-tabs {
  font-family: var(--sv-devanagari-sans);
}

.md-typeset .shloka,
.md-typeset .udaharana,
.md-typeset .anvaya,
.md-typeset .padartha,
.md-typeset .vyutpatti,
.md-typeset .tika,
.md-typeset .alankara,
.md-typeset .bhavartha,
.md-typeset .vyakarana,
.md-typeset .kosha,
.md-typeset .commentary {
  font-family: var(--sv-devanagari-serif);
}

/* --- shloka / verse blocks --------------------------------------------
   Unified base style for every <div class="shloka" data-type="...">,
   whatever its data-type (previously separate .shloka/.karika/
   .shloka-play classes — see site update notes). Compact by default: many
   need to be visible on screen at once, so just bold, no box, minimal
   vertical margin. Each data-type below only overrides what's different. */
.md-typeset .shloka {
  font-weight: 600;
  margin: 0.4rem 0;
  line-height: 1.7;
  white-space: pre-line;
}

/* karika (शास्त्र root verses, e.g. काव्यप्रकाश/ध्वन्यालोक/साहित्यदर्पण) —
   slightly more breathing room since these are usually followed
   immediately by their own वृत्ति/commentary. */
.md-typeset .shloka[data-type="karika"] {
  margin: 0.8rem 0;
  line-height: 1.8;
}

/* nataka (a verse quoted within kavya-play dialogue, previously
   .shloka-play) — no box, nudged right so it visually separates from the
   speaker's name/dash without trying to align to it exactly (that varies
   with name length). Rendered inline with normal paragraph flow, so no
   extra vertical margin beyond that. */
.md-typeset .shloka[data-type="nataka"] {
  display: block;
  margin: 0 0 0 1.5rem;
  line-height: 1.9;
  white-space: pre-line;
}

/* dialog (plain spoken prose in a kavya-play, when tagged as a shloka
   block rather than left as ordinary paragraph text) — matches
   .dialog-block's spacing, not bold. */
.md-typeset .shloka[data-type="dialog"] {
  font-weight: normal;
  line-height: 1.9;
  margin: 0.6rem 0;
}

/* --- highlight="true" — an optional, independent flag any shloka can
   carry regardless of data-type, for marking a particularly important
   verse. Warm gold/amber tint (deliberately not red, which reads as an
   error/warning in this theme). --------------------------------------- */
.md-typeset .shloka[highlight="true"] {
  background: rgba(255, 179, 0, 0.14);
  border-left: 4px solid #ffab00;
  border-radius: 0.2rem;
  padding: 0.7rem 1rem;
}

[data-md-color-scheme="slate"] .md-typeset .shloka[highlight="true"] {
  background: rgba(255, 179, 0, 0.1);
}

/* --- vritti (शास्त्र prose commentary directly under a karika) --------- */
.md-typeset .vritti {
  margin: 0.6rem 0;
  line-height: 1.8;
}

/* --- claim / refute (vada dialectics) --------------------------------- */
.md-typeset .claim,
.md-typeset .refute {
  border-radius: 0.2rem;
  padding: 0.9rem 1.2rem;
  margin: 1rem 0;
  line-height: 1.8;
}

.md-typeset .claim {
  background: rgba(33, 150, 243, 0.08);
  border-left: 4px solid #2196f3;
}

.md-typeset .refute {
  background: rgba(244, 67, 54, 0.08);
  border-left: 4px solid #f44336;
}

.md-typeset .claim::before {
  content: "पक्षः";
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  opacity: 0.7;
  margin-bottom: 0.3rem;
}

.md-typeset .refute::before {
  content: "निरासः";
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  opacity: 0.7;
  margin-bottom: 0.3rem;
}

/* --- chandas / alankara glossary detail-page headers (renamed from
   .chandas/.alankara to free up .alankara for the new per-shloka
   commentary section below, which is a different meaning entirely) ---- */
.md-typeset .chandasdf,
.md-typeset .alankaradf {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
}

.md-typeset .lakshana {
  font-style: italic;
  margin: 0.5rem 0;
}

.md-typeset .udaharana {
  font-style: italic;
  margin: 0.6rem 0 0.6rem 1.8rem;
}

/* --- kavya prose / play ------------------------------------------------ */
.md-typeset .dialog-block {
  margin: 1.2rem 0;
  line-height: 1.9;
}

.md-typeset .action {
  color: var(--md-default-fg-color--light);
  font-style: italic;
}

.md-typeset .anvaya {
  margin: 0.5rem 0 0.5rem 1rem;
  line-height: 1.7;
}

/* the rest of the kavya-verse "labeled hideable sections" (padartha,
   vyutpatti, tika, alankara, bhavartha, vyakarana, kosha) plus the
   generic named "commentary" block — all share the same understated
   treatment: the <u>Label</u> is added by the generator, this is just
   spacing/color to match .anvaya and .notes. */
.md-typeset .padartha,
.md-typeset .vyutpatti,
.md-typeset .tika,
.md-typeset .alankara,
.md-typeset .bhavartha,
.md-typeset .vyakarana,
.md-typeset .kosha,
.md-typeset .commentary {
  margin: 0.5rem 0 0.5rem 1rem;
  line-height: 1.7;
  color: var(--md-default-fg-color--light);
}

/* --- notes and every "labeled hideable section" above are hidden by
   default and only shown once the toggle button is clicked (see
   notes-toggle.js, which adds .sv-show-notes to <body>). .shloka is
   deliberately never part of this — it should always stay visible. --- */
.md-typeset .notes {
  font-size: 0.85rem;
  font-style: italic;
  margin: 0.6rem 0 0.8rem 1.2rem;
  color: var(--md-default-fg-color--light);
}

.md-typeset .sv-hideable {
  display: none;
}

body.sv-show-notes .md-typeset .sv-hideable {
  display: block;
}

/* --- floating notes toggle button --------------------------------------- */
#sv-notes-toggle {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 10;
  background: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
  border: none;
  border-radius: 2rem;
  padding: 0.6rem 1.1rem;
  font-family: var(--sv-devanagari-sans);
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

#sv-notes-toggle:hover {
  filter: brightness(1.08);
}

/* --- shloka table on kavya chapter pages -------------------------------- */
.md-typeset table {
  font-family: var(--sv-devanagari-sans);
}

/* alternating row colors on every table (glossary tables, shloka tables) */
.md-typeset table:not([class]) tr:nth-child(even),
.md-typeset table tbody tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.04);
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) tr:nth-child(even),
[data-md-color-scheme="slate"] .md-typeset table tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.05);
}

/* table headers: distinct tint + a rule separating them from the body */
.md-typeset table thead th,
.md-typeset table > tr:first-child th {
  background-color: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
  border-bottom: 2px solid var(--md-primary-fg-color--dark);
}

/* vertical column separators */
.md-typeset table td,
.md-typeset table th {
  border-left: 1px solid var(--md-default-fg-color--lightest);
}

.md-typeset table td:first-child,
.md-typeset table th:first-child {
  border-left: none;
}

/* --- keep the permanent left sidebar tree out of the way, since every
   page now carries its own Home/Up bar (see .sv-topnav below) instead —
   this just stops it reserving a column on every page. Delete this block
   to get the standard MkDocs Material sidebar back. --- */
@media screen and (min-width: 76.25em) {
  .md-sidebar--primary {
    display: none;
  }
  .md-content {
    margin-left: 0;
  }
}

/* --- top navbar: just "मुखपृष्ठम्" (Home) + "⬆ <text title>" (Up / TOC),
   rendered by render_topnav() at build time — see site update notes. A
   plain sticky bar right above each page's own heading, not part of the
   MkDocs Material chrome itself (keeps this independent of any future
   theme upgrade). ------------------------------------------------------ */
.md-typeset .sv-topnav {
  position: sticky;
  top: 0.6rem;
  z-index: 5;
  display: flex;
  gap: 1rem;
  width: fit-content;
  margin: 0 0 1rem;
  padding: 0.35rem 0.9rem;
  border-radius: 2rem;
  background: var(--md-primary-fg-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.md-typeset .sv-topnav p {
  margin: 0;
}

.md-typeset .sv-topnav a {
  color: var(--md-primary-bg-color);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* --- home page: one card per top-level content section (शास्त्रम्/
   काव्यम्/...), each containing that section's own ग्रन्थाः (and, for the
   topics-carrying section, विषयाः) — see build_home_page() in
   generate_indices.py. Sized to sit side-by-side (small min-width, so two
   cards comfortably share a row); wraps to stacked only on narrow/mobile
   screens. Wraps automatically as sections are added via
   site_config.yaml, no CSS changes needed. ------------------------------ */
.sv-home-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0;
}

.md-typeset .sv-home-card {
  flex: 1 1 14rem;
  min-width: 13rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-top: 0.3rem solid var(--md-primary-fg-color);
  border-radius: 0.5rem;
  padding: 0.9rem 1.2rem 1.2rem;
  background: var(--md-default-bg-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.md-typeset .sv-home-card:hover {
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.13);
  transform: translateY(-2px);
}

.md-typeset .sv-home-card h2 {
  margin-top: 0;
  font-size: 1.25rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--md-primary-fg-color--dark);
}

.md-typeset .sv-home-card h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--md-primary-fg-color);
  margin: 1rem 0 0.4rem;
}

.md-typeset .sv-home-card ul {
  margin-top: 0.3rem;
}

.md-typeset .sv-home-card li {
  margin: 0.2rem 0;
  font-size: 0.92rem;
}

