/* ---------------------------------------------------------------------------
   Language toggles for the archive's parallel-text books.
   No dependencies. No new colours: everything below is one of the page's own
   custom properties (--ink, --ink2, --line, --line2, --gold, --gold-ink,
   --card, --ff-ui), so the control reads correctly in the dark theme (default)
   and in the light one (html[data-theme="light"]) without any override here.
   --------------------------------------------------------------------------- */

/* ---- the control group ------------------------------------------------- */

.hc-langbar {
  display: flex;
  flex-wrap: wrap;              /* 390px: the pills wrap, the page never scrolls sideways */
  align-items: center;
  gap: 6px;
  margin: 0 0 20px;
  padding: 0;
  font-family: var(--ff-ui);
  max-width: 100%;
}

.hc-langbar-label {
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink2);
  margin-right: 2px;
}

.hc-lang-pill {
  font-family: var(--ff-ui);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink2);
  background: transparent;
  border: 1px solid var(--line2);   /* hairline */
  border-radius: 999px;             /* round pill */
  padding: 7px 12px;
  margin: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: color .15s, border-color .15s, background-color .15s;
}

.hc-lang-pill:hover {
  border-color: var(--gold);
  color: var(--ink);
}

/* pressed = this language is on the page */
.hc-lang-pill[aria-pressed="true"] {
  color: var(--gold-ink);           /* --gold-ink, not --gold: it is the one that
                                       stays legible as text in the light theme */
  border-color: var(--gold);
  background: var(--card);
}

/* the last language left on: it cannot be turned off, so it stops offering to be */
.hc-lang-pill[aria-disabled="true"] {
  cursor: default;
}

.hc-lang-pill[aria-disabled="true"]:hover {
  color: var(--gold-ink);
}

.hc-lang-pill:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---- hiding a language ------------------------------------------------- */

/* A class on the .source-text element plus these rules.  Nothing is removed
   from the DOM, so the page's own search and its #s1-style chapter links keep
   working exactly as before -- a hidden block is still there, still findable
   by id, just not rendered.

   Class tokens are lowercased ("sa-Deva" -> "hc-hide-sa-deva") because a CSS
   class selector is case-sensitive; the attribute value keeps the real tag. */

.source-text.hc-hide-la [data-lang="la"],
.source-text.hc-hide-grc [data-lang="grc"],
.source-text.hc-hide-sa-deva [data-lang="sa-Deva"],
.source-text.hc-hide-sa-latn [data-lang="sa-Latn"],
.source-text.hc-hide-en [data-lang="en"] {
  display: none;
}
