/* RJ Editions: the row of menus and the paired view. Colours inherit from the theme. */

.rj-review-label { margin: 0 0 1rem; padding: 0.5rem 0.8rem; border-left: 3px solid currentColor; font-size: 0.9rem; background: color-mix(in srgb, currentColor 6%, transparent); }

/* The controls (1.2.2.2): one row of small menus above the article: language, style (Sanskrit), original. Each is a
   chip that opens a menu under it. Doubled classes: themes style lists, buttons, links and summaries site-wide. */
.rj-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 1rem; padding: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Devanagari", "Nirmala UI", "Kohinoor Devanagari", sans-serif; font-size: 13.5px; font-style: normal; font-weight: 400; line-height: 1.35; letter-spacing: 0; text-transform: none; }
.rj-controls.rj-controls .rj-langs { display: block; margin: 0; padding: 0; }
.rj-controls .rj-menu { position: relative; display: block; margin: 0; padding: 0; }
.rj-controls .rj-menu[hidden] { display: none; }
.rj-controls.rj-controls .rj-menu > summary { display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; height: 34px; margin: 0; padding: 0 12px; border: 1px solid color-mix(in srgb, currentColor 28%, transparent); border-radius: 999px; background: transparent; color: inherit; font: inherit; font-weight: 500; line-height: 1; cursor: pointer; list-style: none; user-select: none; white-space: nowrap; }
.rj-controls .rj-menu > summary::-webkit-details-marker { display: none; }
.rj-controls .rj-menu > summary::marker { content: ""; }
.rj-controls .rj-menu > summary:hover { border-color: color-mix(in srgb, currentColor 55%, transparent); }
.rj-controls .rj-menu[open] > summary { border-color: currentColor; }
.rj-controls .rj-ico, .rj-controls .rj-chev { flex: none; }
.rj-controls .rj-chev { opacity: 0.7; transition: transform 0.15s; }
.rj-controls .rj-menu[open] .rj-chev { transform: rotate(180deg); }
.rj-controls [lang="sa"], .rj-controls [lang="hi"], .rj-controls [lang="mr"], .rj-controls [lang="ne"] { font-family: "Noto Sans Devanagari", "Nirmala UI", "Kohinoor Devanagari", system-ui, sans-serif; }
.rj-controls .rj-menu > summary [lang]:not([lang="en"]) { font-weight: 600; }
.rj-vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.rj-controls.rj-controls .rj-menu-list { position: absolute; left: 0; right: auto; top: calc(100% + 6px); z-index: 30; display: grid; gap: 2px; box-sizing: border-box; min-width: 220px; width: max-content; max-width: calc(100vw - 2rem); max-height: 330px; overflow: auto; margin: 0; padding: 6px; list-style: none; border: 1px solid color-mix(in srgb, currentColor 18%, transparent); border-radius: 12px; background: var(--rj-bg, #fff); box-shadow: 0 12px 28px rgba(20, 38, 61, 0.16); }
.rj-controls.rj-controls .rj-menu-right > .rj-menu-list { left: auto; right: 0; }
.rj-controls.rj-controls .rj-menu-list > li { display: block; margin: 0; padding: 0; }
.rj-controls.rj-controls .rj-menu-list > li::before, .rj-controls.rj-controls .rj-menu-list > li::marker { content: none; }
.rj-controls.rj-controls .rj-menu-list button, .rj-controls.rj-controls .rj-menu-list .rj-lang { appearance: none; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; box-sizing: border-box; width: 100%; min-height: 0; margin: 0; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; box-shadow: none; color: inherit; font: inherit; font-weight: 400; line-height: 1.35; letter-spacing: 0; text-align: left; text-decoration: none; text-transform: none; white-space: nowrap; cursor: pointer; }
.rj-controls.rj-controls .rj-menu-list button:hover, .rj-controls.rj-controls .rj-menu-list a.rj-lang:hover { background: color-mix(in srgb, currentColor 6%, transparent); text-decoration: none; }
.rj-controls.rj-controls .rj-menu-list button[aria-pressed="true"], .rj-controls.rj-controls .rj-menu-list .rj-lang-current { background: color-mix(in srgb, currentColor 10%, transparent); font-weight: 600; cursor: default; }
.rj-controls.rj-controls .rj-menu-list button[aria-pressed="true"] { cursor: pointer; }
.rj-controls .rj-menu-list .rj-lang[lang="sa"], .rj-controls .rj-menu-list .rj-lang[lang="hi"], .rj-controls .rj-menu-list .rj-lang[lang="mr"], .rj-controls .rj-menu-list .rj-lang[lang="ne"], .rj-controls .rj-reg-sa { font-size: 15px; }
.rj-controls .rj-menu-list small { font-size: 11.5px; font-weight: 400; opacity: 0.72; }
.rj-controls .rj-reg-star { margin-left: 0.05em; font-weight: 700; }
.rj-controls.rj-controls .rj-view-menu button { grid-template-columns: 1fr; white-space: normal; }
.rj-controls .rj-view-menu b { font-weight: inherit; }
.rj-controls .rj-view-menu button[aria-pressed="true"] b { font-weight: 600; }
.rj-controls .rj-menu-sep { height: 1px; margin: 4px 6px; background: color-mix(in srgb, currentColor 18%, transparent); }
.rj-controls .rj-menu-note { padding: 2px 10px 4px; font-size: 11px; opacity: 0.72; }
@media (prefers-reduced-motion: reduce) { .rj-controls .rj-chev { transition: none; } }

/* The original's chip names the current choice: its words follow the article's class, so they are right before any script runs. */
.rj-view summary > [class^="rj-chip-"] { display: none; }
.rj-view-both .rj-view summary > .rj-chip-both, .rj-view-tap .rj-view summary > .rj-chip-tap, .rj-view-only .rj-view summary > .rj-chip-only { display: inline; }
/* The style chip names the chosen register, by the same attribute that shows the register's text. */
.rj-regs summary > .rj-reg-c { display: none; }
.rj-edition[data-rj-reg-on="classical"] .rj-reg-c[data-rj-c="classical"],
.rj-edition[data-rj-reg-on="upanishadic"] .rj-reg-c[data-rj-c="upanishadic"],
.rj-edition[data-rj-reg-on="samhita"] .rj-reg-c[data-rj-c="samhita"],
.rj-edition[data-rj-reg-on="itihasa"] .rj-reg-c[data-rj-c="itihasa"],
.rj-edition[data-rj-reg-on="darshana"] .rj-reg-c[data-rj-c="darshana"],
.rj-edition[data-rj-reg-on="vyakarana"] .rj-reg-c[data-rj-c="vyakarana"],
.rj-edition[data-rj-reg-on="smriti"] .rj-reg-c[data-rj-c="smriti"],
.rj-edition[data-rj-reg-on="prabodha"] .rj-reg-c[data-rj-c="prabodha"] { display: inline; }

/* Only the chosen register's text shows. Without a register attribute (1.0 editions) nothing here applies. */
.rj-edition[data-rj-reg-on] .rj-r { display: none; }
.rj-edition[data-rj-reg-on="classical"] .rj-r[data-rj-r="classical"],
.rj-edition[data-rj-reg-on="upanishadic"] .rj-r[data-rj-r="upanishadic"],
.rj-edition[data-rj-reg-on="samhita"] .rj-r[data-rj-r="samhita"],
.rj-edition[data-rj-reg-on="itihasa"] .rj-r[data-rj-r="itihasa"],
.rj-edition[data-rj-reg-on="darshana"] .rj-r[data-rj-r="darshana"],
.rj-edition[data-rj-reg-on="vyakarana"] .rj-r[data-rj-r="vyakarana"],
.rj-edition[data-rj-reg-on="smriti"] .rj-r[data-rj-r="smriti"],
.rj-edition[data-rj-reg-on="prabodha"] .rj-r[data-rj-r="prabodha"] { display: inline; }
.rj-edition[data-rj-reg-on="upanishadic"] .rj-r-title[data-rj-r="upanishadic"],
.rj-edition[data-rj-reg-on="samhita"] .rj-r-title[data-rj-r="samhita"],
.rj-edition[data-rj-reg-on="itihasa"] .rj-r-title[data-rj-r="itihasa"],
.rj-edition[data-rj-reg-on="darshana"] .rj-r-title[data-rj-r="darshana"],
.rj-edition[data-rj-reg-on="vyakarana"] .rj-r-title[data-rj-r="vyakarana"],
.rj-edition[data-rj-reg-on="smriti"] .rj-r-title[data-rj-r="smriti"],
.rj-edition[data-rj-reg-on="prabodha"] .rj-r-title[data-rj-r="prabodha"] { display: block; margin: 0 0 0.4em; font-size: 1.35em; font-weight: 700; line-height: 1.45; }

.rj-controls summary:focus-visible, .rj-controls .rj-menu-list a:focus-visible, .rj-controls .rj-menu-list button:focus-visible, .rj-peek:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Devanagari is not Latin with another font: more line height, a little larger, never hyphenated. */
.rj-edition:lang(sa), .rj-edition:lang(hi), .rj-edition:lang(mr), .rj-edition:lang(ne) {
	font-family: "Noto Serif Devanagari", "Tiro Devanagari Sanskrit", "Noto Sans Devanagari", "Nirmala UI", "Kohinoor Devanagari", serif;
	font-size: 1.08em;
	line-height: 1.85;
	hyphens: none;
	word-break: normal;
	overflow-wrap: break-word;
}

/* The original beneath: visibly secondary, close to its passage so the two read as a pair. */
.rj-edition .rj-src {
	display: block;
	margin: -0.6em 0 1.5em;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 0.8em;
	font-weight: 400;
	font-style: normal;
	line-height: 1.55;
	letter-spacing: 0;
	text-transform: none;
	opacity: 0.72;
	hyphens: manual;
}
.rj-edition span.rj-src { margin: 0.15em 0 0.5em; }
.rj-edition .rj-src-heading { margin-top: -0.3em; }
.rj-edition .rj-src-title { margin: 0 0 1.5em; font-size: 0.95em; }

.rj-view-only .rj-src, .rj-view-tap .rj-src { display: none; }
.rj-view-tap .rj-src.rj-open { display: block; }
.rj-view-tap [data-rj-n] { cursor: pointer; }
.rj-view-tap [data-rj-keep] { cursor: auto; }

.rj-peek { display: none; appearance: none; margin: 0 0 0 0.4em; padding: 0 0.45em; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: 4px; background: transparent; color: inherit; font-family: system-ui, sans-serif; font-size: 0.7rem; font-weight: 400; line-height: 1.7; vertical-align: middle; cursor: pointer; opacity: 0.75; }
.rj-view-tap .rj-peek { display: inline-block; }
.rj-peek[aria-expanded="true"] { background: color-mix(in srgb, currentColor 14%, transparent); }

.rj-ref a { text-decoration: none; }

@media print {
	.rj-controls, .rj-peek { display: none !important; }
}

/* 1.2.2.3: right-to-left pages (ar, fa, ur): the row starts on the right (flex follows the direction), menus open
   from their chip's right edge, and text inside them starts on the right. */
html[dir="rtl"] .rj-controls.rj-controls .rj-menu-list { left: auto; right: 0; }
html[dir="rtl"] .rj-controls.rj-controls .rj-menu-right > .rj-menu-list { left: 0; right: auto; }
html[dir="rtl"] .rj-controls.rj-controls .rj-menu-list button, html[dir="rtl"] .rj-controls.rj-controls .rj-menu-list .rj-lang { text-align: right; }
html[dir="rtl"] .rj-controls .rj-menu-list [lang="en"], html[dir="rtl"] .rj-controls .rj-menu-list [lang="sa"], html[dir="rtl"] .rj-controls .rj-menu-list [lang="hi"] { direction: ltr; text-align: right; }
html[dir="rtl"] .rj-review-label { border-left: 0; border-right: 3px solid currentColor; }
html[dir="rtl"] .rj-controls .rj-reg-star { margin-left: 0; margin-right: 0.05em; }
.rj-controls [lang="ar"], .rj-controls [lang="fa"], .rj-controls [lang="ur"] { font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif; }
