/* One readings page at a time. English unless html[data-readings="ne"]. */
html:not([data-readings="ne"]) .lang-ne { display: none; }
html[data-readings="ne"] .lang-en { display: none; }

/* figures.css makes figcaption .deva a block, which would beat the rule above
   and would also split a parenthesis onto its own line. */
html:not([data-readings="ne"]) figure.plate figcaption .lang-ne { display: none; }
html[data-readings="ne"] figure.plate figcaption .lang-en { display: none; }
figure.plate figcaption .lang-en .deva {
  display: inline;
  margin-top: 0;
}

/* Noto Sans Devanagari draws taller than the English font at the same size.
   The parenthesis is a gloss, so it sits a little under the surrounding text.
   Nepali mode is not inside .lang-en, and stays full size. */
.lang-en .deva { font-size: 0.92em; display: inline; }
/* The index blurb rule is `li span { display: block }`. A name inside a link,
   and a gloss inside a sentence, stay on the line. */
li a > span { display: inline; font-weight: 600; }
/* The name is the link. The IAST and Devanagari beside it are ordinary text. */
.name-gloss {
  font-weight: 400;
  color: inherit;
  display: inline;
}

.bar:has(.lang-switch) .bar-book { flex: 0 1 auto; }
.lang-switch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0 auto;
  flex: 0 0 auto;
}
.bar .lang-switch-label { display: none; }
.lang-switch-label {
  font-size: 0.92rem;
  font-weight: 650;
  color: #8a3414;
}
.lang-switch-buttons {
  display: flex;
  gap: 0.4rem;
}
.lang-switch button {
  font: inherit;
  font-size: 0.95rem;
  color: #5c4636;
  background: transparent;
  border: 1px solid #c4b09a;
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] {
  color: #8a3414;
  background: #ead9bf;
  border-color: #ead9bf;
  font-weight: 650;
}
.lang-switch button:focus-visible {
  outline: 2px solid #b5451d;
  outline-offset: 2px;
}

html[data-theme="dark"] .lang-switch-label { color: #e7c3a8; }
html[data-theme="dark"] .lang-switch button {
  background: #2a221c;
  color: #f3e6d4;
  border-color: rgba(243, 230, 212, 0.18);
}
html[data-theme="dark"] .lang-switch button[aria-pressed="true"] {
  background: #ead9bf;
  color: #2c221a;
  border-color: #ead9bf;
}

/* Shelf index era sections and period leads */
section.era-section {
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(44, 34, 26, 0.12);
}
section.era-section:first-of-type {
  border-top: none;
  margin-top: 1rem;
  padding-top: 0;
}
section.era-section h2 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-size: 1.35rem;
  color: #2c221a;
  scroll-margin-top: 4.5rem;
}
.period-lead {
  font-style: italic;
  color: #5c4636;
  margin: 0.2rem 0 1rem;
  line-height: 1.55;
  font-size: 0.98rem;
}
html[data-theme="dark"] section.era-section {
  border-top-color: rgba(243, 230, 212, 0.14);
}
html[data-theme="dark"] section.era-section h2 {
  color: #f6ead4;
}
html[data-theme="dark"] .period-lead {
  color: #c9b7a4;
}
