/* Mantra section layout — markup from mu-plugins/dharmavidya-mantra.php, behaviour in dv-mantra.js.
   Every rule is scoped .pr-verses .dvm-* so it outranks the Oxygen .pr-name rules (0,2,0) without !important.
   Source: tools/mantra/dv-mantra.css, served from uploads/dv-assets/. */

.pr-verses .dvm-item {
  --dvm-fold: 620px;
  padding: 48px 0 52px;
  border-top: 1px solid var(--rule);
  color: var(--text);
  scroll-margin-top: calc(var(--dvm-top, 64px) + 52px);   /* clear of the site bar and the jump bar */
}
.pr-verses .dvm-item:first-of-type { border-top-width: 0; padding-top: 24px; }
.pr-verses .dvm-index + .dvm-item { padding-top: 48px; }

/* Page index ("On this page"): full card width, so it bleeds through the card's padding (56 / 28 / 18px) */
/* The canvas's "hero hills band": the site's own band backdrop (the image behind the page H1, at the same
   50% 70% / cover) under a navy-to-clear sweep and a sky-blue wash, with the text in white. */
.pr-verses .dvm-index {
  margin: 48px -56px 0; padding: 40px 56px 44px; scroll-margin-top: var(--dvm-top, 64px);
  background-color: #2f6187;
  background-image:
    linear-gradient(100deg, rgba(10, 48, 74, .77) 0%, rgba(10, 48, 74, .77) 38%, rgba(10, 48, 74, .18) 78%, rgba(10, 48, 74, .1) 100%),
    linear-gradient(rgba(100, 186, 222, .7), rgba(100, 186, 222, .7)),
    url(/wp-content/uploads/design/Mountains-backdrop.webp);
  background-size: cover; background-position: 50% 70%; background-repeat: no-repeat;
  border-top: 0; border-bottom: 1px solid #2f6187;
}
.pr-verses .dvm-index .dvm-kicker,
.pr-verses .dvm-index .dvm-index-h,
.pr-verses .dvm-index .dvm-index-sub { color: #fff; }
.pr-verses .dvm-index-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; }
.pr-verses .dvm-kicker {
  font-family: 'Noto Sans Mono', monospace; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--oinkink);
}
.pr-verses .dvm-index-h {
  margin: 0; color: var(--text); font-family: 'Noto Sans Display', sans-serif; font-weight: 600;
  font-size: clamp(24px, 2.6vw, 30px); line-height: 1.12; letter-spacing: -.026em;
}
.pr-verses .dvm-index-sub { font-size: 15px; line-height: 1.5; color: var(--muted); }
.pr-verses .dvm-index-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 12px 20px;
}
.pr-verses .dvm-index-list li { display: flex; margin: 0; }
/* A text card: number + name, the whole mantra in IAST, then kind and video, the meta row pinned to the bottom so
   cards in one grid row line up whatever the mantra's length. */
.pr-verses .dvm-index-list a,
.pr-verses .dvm-index-list a:hover {
  flex: 1; display: flex; flex-direction: column; gap: 6px; box-sizing: border-box; padding: 14px 18px 15px;
  background: #fff; border: 1px solid #fff; border-radius: 6px; color: var(--text); text-decoration: none;
}
.pr-verses .dvm-index-list a:hover { box-shadow: 0 6px 18px rgba(10, 38, 62, .28); }
.pr-verses .dvm-index-list a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.pr-verses .dvm-ix-top { display: flex; gap: 10px; align-items: baseline; }
.pr-verses .dvm-ix-num { font-family: 'Noto Sans Mono', monospace; font-size: 12px; color: var(--oinkink); }
.pr-verses .dvm-ix-name {
  font-family: 'Noto Sans Display', sans-serif; font-weight: 600; font-size: 17px; line-height: 1.25; letter-spacing: -.012em;
}
.pr-verses .dvm-ix-iast {
  padding-left: 28px; font-family: 'Noto Sans Mono', monospace; font-size: 13.5px; line-height: 1.55; color: var(--oinkink);
}
.pr-verses .dvm-ix-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: auto; padding: 4px 0 0 28px;
  font-family: 'Noto Sans Mono', monospace; font-size: 10.5px; line-height: 1.4; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.pr-verses .dvm-ix-vid { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.pr-verses .dvm-ix-vid svg { flex: 0 0 auto; }
@media (max-width: 1023px) { .pr-verses .dvm-index { margin: 44px -28px 0; padding: 40px 28px 44px; } }
@media (max-width: 767px)  { .pr-verses .dvm-index { margin: 36px -18px 0; padding: 40px 18px 44px; } }

/* Jump bar — printed at the end of <body>, outside .pr, so it carries its own colour values */
.dvm-jump {
  --j-text: #181c2e; --j-muted: #6c6f78; --j-rule: #dde5ec; --j-paper: #fbfaf7; --j-ink: #c1511b; --j-link: #1f6fb2;
  position: fixed; left: 0; right: 0; top: var(--dvm-top, 64px); z-index: 29;   /* under header.pr-bar (30): it slides out from beneath it */
  background: #fff; border-bottom: 1px solid var(--j-rule); box-shadow: 0 2px 6px rgba(16, 42, 66, .06);
  font-family: 'Source Sans 3', sans-serif; color: var(--j-text);
  transform: translateY(-110%); visibility: hidden;
  transition: transform .25s cubic-bezier(.22, .61, .36, 1), visibility 0s linear .25s;
}
.dvm-jump.is-on { transform: none; visibility: visible; transition: transform .25s cubic-bezier(.22, .61, .36, 1); }
.dvm-jump-in {
  max-width: 1100px; margin: 0 auto; padding: 0 56px; box-sizing: border-box; height: 52px;
  display: flex; align-items: center; gap: 18px;
}
.dvm-jump-lab {
  font-family: 'Noto Sans Mono', monospace; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--j-muted);
  white-space: nowrap;
}
.dvm-jump-pick { position: relative; flex: 1 1 auto; max-width: 560px; min-width: 0; }
.dvm-jump-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; box-sizing: border-box;
  border: 1px solid var(--j-rule); border-radius: 3px; background: #fff; color: var(--j-text); cursor: pointer; text-align: left;
  font: inherit;
}
.dvm-jump-btn:hover { border-color: #b9c6d2; }
.dvm-jump-btn:focus-visible, .dvm-jump-arr:focus-visible, .dvm-jump-list a:focus-visible { outline: 2px solid var(--j-link); outline-offset: 2px; }
.dvm-jump-n { font-family: 'Noto Sans Mono', monospace; font-size: 12px; color: var(--j-ink); white-space: nowrap; }
.dvm-jump-name {
  flex: 1; min-width: 0; font-family: 'Noto Sans Display', sans-serif; font-weight: 600; font-size: 15.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dvm-jump-btn svg { flex: 0 0 auto; transition: transform .2s; }
.dvm-jump-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.dvm-jump-list {
  list-style: none; margin: 0; padding: 6px 0; position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  max-height: calc(100vh - var(--dvm-top, 64px) - 72px); overflow-y: auto;
  background: #fff; border: 1px solid var(--j-rule); border-radius: 0 0 6px 6px; box-shadow: 0 14px 34px rgba(16, 42, 66, .14);
}
.dvm-jump-list[hidden] { display: none; }
.dvm-jump-list li { margin: 0; }
.dvm-jump-list a, .dvm-jump-list a:hover {
  display: flex; gap: 12px; align-items: baseline; min-height: 44px; padding: 11px 16px; box-sizing: border-box;
  color: var(--j-text); text-decoration: none; background: #fff;
}
.dvm-jump-list a:hover { background: var(--j-paper); }
.dvm-jump-list a[aria-current="true"] { background: var(--j-paper); }
.dvm-jump-list a[aria-current="true"] .dvm-jump-lt { font-weight: 600; }
.dvm-jump-ln { font-family: 'Noto Sans Mono', monospace; font-size: 12px; color: var(--j-ink); }
.dvm-jump-lt { font-family: 'Noto Sans Display', sans-serif; font-weight: 500; font-size: 15.5px; line-height: 1.35; }
.dvm-jump-list .dvm-jump-ix { border-top: 1px solid var(--j-rule); margin-top: 4px; }
.dvm-jump-list .dvm-jump-ix a, .dvm-jump-list .dvm-jump-ix a:hover {
  align-items: center; font-family: 'Noto Sans Mono', monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--j-link);
}
.dvm-jump-sp { flex: 1; }
.dvm-jump-arr, .dvm-jump-arr:hover {
  display: flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; box-sizing: border-box;
  border: 1px solid var(--j-rule); border-radius: 3px; color: var(--j-text); text-decoration: none; background: #fff;
}
.dvm-jump-arr:hover { border-color: #b9c6d2; }
.dvm-jump-arr[aria-disabled="true"] { color: #b9c6d2; pointer-events: none; }
@media (max-width: 1023px) { .dvm-jump-in { padding: 0 28px; } }
@media (max-width: 767px) {
  .dvm-jump-in { padding: 0 16px; gap: 10px; }
  .dvm-jump-lab, .dvm-jump-sp { display: none; }
  .dvm-jump-pick { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .dvm-jump, .dvm-jump.is-on, .dvm-jump-btn svg { transition: none; } }

/* Header row: number, name, kind pill */
.pr-verses .dvm-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 16px; margin: 0 0 28px; }
.pr-verses .dvm-num { font-family: 'Noto Sans Mono', monospace; font-size: 13px; letter-spacing: .1em; color: var(--oinkink); }
.pr-verses .dvm-head .pr-mantra-name {
  flex: 1 1 320px; margin: 0; color: var(--text);
  font-family: 'Noto Sans Display', sans-serif; font-weight: 600;
  font-size: clamp(23px, 3vw, 30px); line-height: 1.15; letter-spacing: -.024em;
}
.pr-verses .dvm-pill {
  font-family: 'Noto Sans Mono', monospace; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--rule); border-radius: 999px; padding: 5px 11px 4px; white-space: nowrap;
}
.pr-verses .dvm-lab {
  font-family: 'Noto Sans Mono', monospace; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}

/* Mantra block: recitation and media, two equal columns that stack below ~900px of card */
.pr-verses .dvm-main {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 28px 44px; align-items: start;
}
.pr-verses .dvm-main:not(.has-media) { grid-template-columns: minmax(0, 1fr); }
.pr-verses .dvm-item .pr-name {
  display: flex; flex-direction: column; gap: 18px; min-width: 0;
  margin: 0; padding: 0; border: 0;
}
.pr-verses .dvm-item .pr-name::before { content: none; }
.pr-verses .dvm-item .pr-name > * { margin: 0; max-width: none; padding-left: 0; }
.pr-verses .dvm-item .pr-deva {
  color: var(--text); font-family: 'Noto Sans Devanagari', sans-serif; font-size: 22px; line-height: 1.8;
}
.pr-verses .dvm-item .pr-iast {
  color: var(--oinkink); font-family: 'Noto Sans Mono', monospace; font-weight: 500; font-size: 17px; line-height: 1.6; letter-spacing: 0;
}
.pr-verses .dvm-item .pr-deva strong,
.pr-verses .dvm-item .pr-iast strong,
.pr-verses .dvm-item .pr-trans strong { font-weight: inherit; }
.pr-verses .dvm-item .pr-trans {
  color: var(--text); font-family: 'Source Sans 3', sans-serif; font-size: 18px; line-height: 1.6; text-wrap: pretty;
  padding-top: 18px; border-top: 1px solid var(--rule);
}

/* Media column: the dv-video figure, its caption row, the facts list */
.pr-verses .dvm-media { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pr-verses .dvm-media .dv-video { margin: 0; max-width: none; }
.pr-verses .dvm-media .dv-video-frame { border-radius: 6px; background: #12283c; }
.pr-verses .dvm-media .dv-video-play {
  width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(24, 28, 46, .72);
}
.pr-verses .dvm-media .dv-video-play::after { left: 26px; top: 20px; border-width: 12px 0 12px 19px; }
.pr-verses .dvm-media .dv-video-cap {
  display: flex; justify-content: space-between; gap: 12px; max-width: none; margin: 14px 0 0;
  font-family: 'Noto Sans Mono', monospace; font-size: 11.5px; line-height: 1.5; letter-spacing: .06em; color: var(--muted);
}
.pr-verses .dvm-media .dv-video-cap a { color: var(--iast); text-decoration: none; white-space: nowrap; }
.pr-verses .dvm-media .dv-video-cap a:hover { color: var(--brand); text-decoration: none; }

.pr-verses .dvm-item .pr-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 20px;
  margin: 4px 0 0; border-top: 1px solid var(--rule);
}
.pr-verses .dvm-item .pr-facts > div { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.pr-verses .dvm-item .pr-facts dt {
  font-family: 'Noto Sans Mono', monospace; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.pr-verses .dvm-item .pr-facts dd { margin: 3px 0 0; font-size: 15.5px; line-height: 1.4; }

/* Interpretation: two cards side by side, no outer panel — the contents rail on paper, the text on white */
.pr-verses .dvm-interp {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px 24px; margin-top: 40px;
}
.pr-verses .dvm-rail {
  flex: 1 1 250px; max-width: 100%; box-sizing: border-box; display: flex; flex-direction: column; gap: 14px;
  padding: 22px 24px 14px; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px;
}
.pr-verses .dvm-rail ol {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 18px; border-top: 1px solid var(--rule);
}
.pr-verses .dvm-rail li { flex: 1 1 180px; border-bottom: 1px solid var(--rule); }
.pr-verses .dvm-rail li a,
.pr-verses .dvm-rail li a:hover {
  display: flex; gap: 10px; align-items: baseline; min-height: 44px; padding: 11px 0; box-sizing: border-box;
  color: var(--text); text-decoration: none; font-family: 'Noto Sans Display', sans-serif; font-weight: 500; font-size: 15.5px; line-height: 1.35;
}
.pr-verses .dvm-rail li a:hover { color: var(--oinkink); }
.pr-verses .dvm-rn { font-family: 'Noto Sans Mono', monospace; font-size: 11px; color: var(--oinkink); }
.pr-verses .dvm-back,
.pr-verses .dvm-back:hover {
  display: none; align-items: center; min-height: 44px; color: var(--iast); text-decoration: none;
  font-family: 'Noto Sans Mono', monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
}
.pr-verses .dvm-interp.is-open .dvm-back { display: flex; }
/* Sticky only where the rail sits BESIDE the text (from the 1024 breakpoint); stacked above it, a transparent
   sticky rail would ride over the text. It sticks below the site bar AND the jump bar (--dvm-top is the site
   bar's bottom, set by the script; the jump bar is 52px). */
@media (min-width: 1024px) {
  .pr-verses .dvm-rail { position: sticky; top: calc(var(--dvm-top, 64px) + 68px); }
}

.pr-verses .dvm-text {
  flex: 999 1 460px; min-width: 0; box-sizing: border-box;
  padding: clamp(20px, 3vw, 36px) clamp(20px, 3.4vw, 44px) clamp(20px, 3vw, 32px);
  background: #fff; border: 1px solid var(--rule); border-radius: 6px;
}
.pr-verses .dvm-text > * { max-width: 68ch; }   /* the card is wide; the reading measure stays 68ch */
.pr-verses .dvm-fold { position: relative; }
.pr-verses .dvm-item .pr-notes {
  max-width: none; margin: 0; padding: 0; border: 0; background: none;
  color: var(--text); font-family: 'Source Sans 3', sans-serif; font-size: 17.5px; line-height: 1.72;
}
.pr-verses .dvm-item .pr-notes strong { font-weight: 600; }
.pr-verses .dvm-item .pr-notes p { margin: 0 0 16px; text-wrap: pretty; }
.pr-verses .dvm-item .pr-notes h4 {
  margin: 0 0 12px; scroll-margin-top: calc(var(--dvm-top, 64px) + 72px); color: var(--text);
  font-family: 'Noto Sans Display', sans-serif; font-weight: 600; font-size: 21px; line-height: 1.25; letter-spacing: -.018em;
}
.pr-verses .dvm-item .pr-notes * + h4 { margin-top: 32px; }
.pr-verses .dvm-item .pr-notes ul { margin: 0 0 18px; padding-left: 20px; font-size: 17.5px; line-height: 1.7; }
.pr-verses .dvm-item .pr-notes li { margin-bottom: 3px; }

/* Word by word: term · Devanāgarī · gloss on one wrapping line, explanation below, hairline between */
.pr-verses .dvm-item .pr-words { margin: 0 0 18px; }
.pr-verses .dvm-item .pr-words > div {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 14px 0 6px; border-top: 1px solid var(--rule);
}
.pr-verses .dvm-item .pr-words dt {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 0 0 6px;
  font-family: 'Noto Sans Display', sans-serif; font-weight: 600; font-size: 18px; line-height: 1.35;
}
.pr-verses .dvm-item .pr-words dt [lang="sa"] {
  font-family: 'Noto Sans Devanagari', sans-serif; font-weight: 400; font-size: 16px; color: var(--muted);
}
.pr-verses .dvm-item .pr-words dd { margin: 0; }
.pr-verses .dvm-item .pr-words dd.pr-gloss { margin: 0 0 6px; font-size: 17px; line-height: 1.35; }
.pr-verses .dvm-item .pr-words dd:not(.pr-gloss) { flex: 1 0 100%; }
.pr-verses .dvm-item .pr-words dd p { margin: 0 0 10px; font-size: 17px; line-height: 1.7; }

/* Ritual attribution table */
.pr-verses .dvm-item .pr-ritual { margin: 0 0 18px; border-top: 1px solid var(--rule); }
.pr-verses .dvm-item .pr-ritual > div {
  display: flex; flex-wrap: wrap; gap: 2px 16px; padding: 10px 0; border-bottom: 1px solid var(--rule);
}
.pr-verses .dvm-item .pr-ritual dt { flex: 0 0 170px; font-family: 'Noto Sans Display', sans-serif; font-weight: 600; font-size: 16px; line-height: 1.55; }
.pr-verses .dvm-item .pr-ritual dd { flex: 1 1 220px; margin: 0; font-size: 17px; line-height: 1.55; }

/* Closing */
.pr-verses .dvm-item .pr-close { text-align: center; padding: 18px 0 6px; border-top: 1px solid var(--rule); }
.pr-verses .dvm-item .pr-close p { margin: 0; }
.pr-verses .dvm-item .pr-close p[lang="sa"] { font-family: 'Noto Sans Devanagari', sans-serif; font-size: 20px; line-height: 1.8; }
.pr-verses .dvm-item .pr-close .pr-close-iast {
  margin: 2px 0 10px; font-family: 'Noto Sans Mono', monospace; font-weight: 500; font-size: 15px; color: var(--oinkink);
}
.pr-verses .dvm-item .pr-close p:last-child:not(.pr-close-iast):not([lang]) {
  max-width: 46ch; margin: 0 auto; font-size: 17px; line-height: 1.6; color: var(--muted); text-wrap: balance;
}

/* Fold: only with the script running, so a failed script never hides text */
.pr-verses .dvm-more {
  display: none; align-items: center; margin-top: 14px; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--text); border-radius: 3px; background: #fff; color: var(--text);
  font-family: 'Source Sans 3', sans-serif; font-weight: 600; font-size: 15px; line-height: 1; cursor: pointer;
}
.pr-verses .dvm-more:hover { background: var(--text); color: #fff; }
.pr-verses .dvm-more:focus-visible { outline: 2px solid var(--iast); outline-offset: 3px; }
.dvm-js .pr-verses .dvm-fold.is-foldable + .dvm-more { display: inline-flex; }
.dvm-js .pr-verses .dvm-fold.is-foldable { max-height: var(--dvm-fold); overflow: hidden; }
.dvm-js .pr-verses .dvm-interp.is-open .dvm-fold.is-foldable { max-height: none; }
.dvm-js .pr-verses .dvm-fold.is-foldable::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, 0), #fff);
}
.dvm-js .pr-verses .dvm-interp.is-open .dvm-fold::after { content: none; }
@media (prefers-reduced-motion: no-preference) {
  .pr-verses .dvm-fold { transition: max-height .42s cubic-bezier(.22, .61, .36, 1); }
}

@media (max-width: 767px) {
  .pr-verses .dvm-item { --dvm-fold: 520px; }
}
