/* The index as the back matter of a book: alphabetical columns, lecture numbers where page numbers would be. */
:root {
  color-scheme: dark;
  --ix-bg: #181715;
  --ix-ink: #eee7dc;
  --ix-ink-soft: #cfc6b8;
  --ix-muted: #a39a8c;
  --ix-faint: #7d7468;
  --ix-gold: #c9a07a;
  --ix-gold-bright: #e2bf98;
  --ix-rule: #39342d;
  --ix-mark: #4a3a2b;
  --ix-display: Literata, Georgia, 'Times New Roman', serif;
  --ix-ui: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ix-off: #4f483f;
  --ix-shadow: rgba(0, 0, 0, .45);
  --show-sun: inline;
  --show-moon: none;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --ix-bg: #f4efe6;
    --ix-ink: #1f1a14;
    --ix-ink-soft: #3a3229;
    --ix-muted: #554c40;
    --ix-faint: #6a6053;
    --ix-gold: #85562a;
    --ix-gold-bright: #6e4520;
    --ix-rule: #d9cfbd;
    --ix-mark: #ecd9bd;
    --ix-off: #b8ad9c;
    --ix-shadow: rgba(70, 50, 25, .18);
    --show-sun: none;
    --show-moon: inline;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --ix-bg: #f4efe6;
  --ix-ink: #1f1a14;
  --ix-ink-soft: #3a3229;
  --ix-muted: #554c40;
  --ix-faint: #6a6053;
  --ix-gold: #85562a;
  --ix-gold-bright: #6e4520;
  --ix-rule: #d9cfbd;
  --ix-mark: #ecd9bd;
  --ix-off: #b8ad9c;
  --ix-shadow: rgba(70, 50, 25, .18);
  --show-sun: none;
  --show-moon: inline;
}
* { box-sizing: border-box; }
html { background: var(--ix-bg); }
body { margin: 0; background: var(--ix-bg); color: var(--ix-ink); font: 400 1.0625rem/1.75 var(--ix-display);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
a { color: inherit; }
:focus-visible { outline: 1px solid var(--ix-gold); outline-offset: 3px; }
.ix-wrap { max-width: 72rem; margin: 0 auto; }

.ix-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .6rem 1.5rem; padding-block: 2rem 1.5rem; border-bottom: 1px solid var(--ix-rule); font: 400 .85rem/1.4 var(--ix-ui); color: var(--ix-muted); }
.ix-mark { font: 400 1.1rem/1 var(--ix-display); color: var(--ix-ink); text-decoration: none; }
.ix-top nav { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; }
.ix-top nav a { text-decoration: none; padding-bottom: .2rem; border-bottom: 1px solid transparent; }
.ix-top nav a:hover { color: var(--ix-ink); }
.ix-top nav a[aria-current="page"] { color: var(--ix-ink); border-color: var(--ix-gold); }

.ix-head { padding-block: 5rem 3rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem 4rem; align-items: end; }
.ix-head h1 { font: 300 clamp(2.8rem, 6vw, 4.8rem)/1 var(--ix-display); letter-spacing: -.01em; margin: 0; }
.ix-scope { font: italic 300 1.25rem/1.5 var(--ix-display); color: var(--ix-ink-soft); margin: 1.2rem 0 0; }
.ix-scope select { field-sizing: content; max-width: 100%; font: inherit; color: var(--ix-gold); background: transparent; border: 0; border-bottom: 1px dotted var(--ix-gold); padding: 0 .2rem; cursor: pointer; }
.ix-scope select option { color: var(--ix-ink); background: var(--ix-bg); }
.ix-search { background: transparent; border: 0; border-bottom: 1px solid var(--ix-rule); color: var(--ix-ink); font: 400 1rem/1.4 var(--ix-ui); padding: .4rem 0; width: min(18rem, 100%); outline: none; }
.ix-search:focus { border-bottom-color: var(--ix-gold); }
.ix-search::placeholder { color: var(--ix-faint); }

.ix-controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 3rem; border-top: 1px solid var(--ix-ink-soft); border-bottom: 1px solid var(--ix-rule); padding-block: 1.3rem; font: 400 .9rem/1.5 var(--ix-ui); color: var(--ix-muted); }
.ix-kinds { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; }
.ix-order { display: flex; gap: 1.4rem; }
.ix-kinds button, .ix-order button { all: unset; cursor: pointer; color: var(--ix-muted); border-bottom: 1px solid transparent; }
.ix-kinds button:hover, .ix-order button:hover { color: var(--ix-ink-soft); }
.ix-kinds button[aria-pressed="true"], .ix-order button[aria-pressed="true"] { color: var(--ix-ink); border-bottom-color: var(--ix-gold); }
.ix-kinds button:focus-visible, .ix-order button:focus-visible { outline: 1px solid var(--ix-gold); outline-offset: 3px; }

.ix-letters { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .9rem; padding-block: 1.4rem; font: 400 1.05rem/1.4 var(--ix-display); border-bottom: 1px solid var(--ix-rule); }
.ix-letters:empty { display: none; }
.ix-letters a { text-decoration: none; color: var(--ix-ink-soft); }
.ix-letters a:hover { color: var(--ix-gold-bright); }
.ix-letters span { color: var(--ix-off); }
.ix-letters .latin { margin-left: .8rem; padding-left: 1.2rem; border-left: 1px solid var(--ix-rule); }

.ix-abbr { font: italic 300 .95rem/1.7 var(--ix-display); color: var(--ix-muted); margin: 1.2rem 0 0; max-width: 46rem; }
.ix-abbr summary { cursor: pointer; font: 400 .85rem/1.4 var(--ix-ui); color: var(--ix-muted); list-style: none; }
.ix-abbr summary::-webkit-details-marker { display: none; }
.ix-abbr summary::after { content: ' +'; color: var(--ix-gold); }
.ix-abbr[open] summary::after { content: ' −'; }
.ix-abbr p { margin: .8rem 0 0; }
.ix-abbr i { font-style: normal; color: var(--ix-ink-soft); }

.ix-columns { columns: 3 18rem; column-gap: 4.5rem; column-rule: 1px solid var(--ix-rule); padding-block: 2.6rem 5rem; }
.ix-letter { break-inside: avoid; break-after: avoid; font: 300 3rem/1 var(--ix-display); color: var(--ix-gold); margin: 2.6rem 0 1rem; scroll-margin-top: 1.5rem; }
.ix-letter:first-child { margin-top: 0; }
.ix-entry { break-inside: avoid; padding-block: .32rem; line-height: 1.55; }
.ix-entry > button { all: unset; cursor: pointer; }
.ix-entry > button:focus-visible { outline: 1px solid var(--ix-gold); outline-offset: 2px; }
.ix-entry > button:hover .ix-name, .ix-entry.open .ix-name { color: var(--ix-gold-bright); }
.ix-kind { font-style: italic; font-weight: 300; color: var(--ix-muted); font-size: .88em; }
.ix-refs { color: var(--ix-ink-soft); font-variant-numeric: lining-nums tabular-nums; font-size: .92em; }
.ix-count { font: 400 .72rem/1 var(--ix-ui); color: var(--ix-faint); margin-left: .25rem; }
.ix-quotes { margin: .8rem 0 1.4rem; padding-left: 1.1rem; border-left: 1px solid var(--ix-gold); display: grid; gap: 1.1rem; }
.ix-quote p { margin: 0; font: italic 300 .95rem/1.6 var(--ix-display); color: var(--ix-ink-soft); }
.ix-quote mark { background: var(--ix-mark); color: var(--ix-ink); font-style: normal; padding: 0 .1em; }
.ix-src { font: 400 .76rem/1.5 var(--ix-ui); color: var(--ix-muted); margin-top: .25rem; }
.ix-src b { font-weight: 500; color: var(--ix-gold); }
.ix-src a { color: var(--ix-gold); text-decoration: none; margin-left: .4rem; white-space: nowrap; }
.ix-src a:hover { color: var(--ix-gold-bright); }
.ix-more { all: unset; cursor: pointer; font: 400 .8rem/1.5 var(--ix-ui); color: var(--ix-gold); }
.ix-empty { font: italic 300 1.1rem/1.5 var(--ix-display); color: var(--ix-muted); }
.ix-foot { padding-block: 2rem 4rem; border-top: 1px solid var(--ix-rule); font: 400 .82rem/1.6 var(--ix-ui); color: var(--ix-muted); max-width: 48rem; }

@media (max-width: 760px) {
  .ix-head { grid-template-columns: 1fr; padding-block: 3rem 2rem; }
  .ix-columns { column-rule: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .ix-quotes { animation: ix-open .25s ease-out; }
  @keyframes ix-open { from { opacity: .3; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
}

.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; margin: -.4rem -.3rem -.4rem 0; padding: 0; border: 0; background: none; color: var(--ix-muted); cursor: pointer; }
.theme-toggle:hover { color: var(--ix-gold-bright); }
.theme-toggle .ui-icon { width: 1.15rem; height: 1.15rem; }
.theme-toggle .theme-toggle__sun { display: var(--show-sun); }
.theme-toggle .theme-toggle__moon { display: var(--show-moon); }
.ix-top nav { align-items: center; }

/* Series as a line of text links instead of a dropdown. */
.ix-series { display: flex; flex-wrap: wrap; gap: .35rem 1.3rem; margin-top: 1.1rem; font: 400 .88rem / 1.5 var(--ix-ui); }
.ix-series a { color: var(--ix-muted); text-decoration: none; border-bottom: 1px solid transparent; }
.ix-series a:hover { color: var(--ix-ink); }
.ix-series a[aria-current="page"] { color: var(--ix-ink); border-bottom-color: var(--ix-gold); }

.ix-mark { display: grid; gap: .25rem; }
.ix-mark span { color: var(--ix-ink); font: 400 1.1rem / 1 var(--ix-display); }
.ix-mark small { color: var(--ix-muted); font: italic 300 .82rem / 1.2 var(--ix-display); }
.search-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; margin: -.4rem -.3rem -.4rem 0; padding: 0; border: 0; background: none; color: var(--ix-muted); cursor: pointer; }
.search-toggle:hover, .search-toggle[aria-expanded="true"] { color: var(--ix-gold-bright); }
.search-toggle .ui-icon { width: 1.15rem; height: 1.15rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.site-search { position: relative; padding-block: 1.2rem .4rem; }
.site-search input { width: 100%; padding: .3rem 0 .7rem; border: 0; border-bottom: 1px solid var(--ix-gold); outline: none; background: transparent; color: var(--ix-ink); font: 300 clamp(1.3rem, 2.6vw, 1.8rem) / 1.3 var(--ix-display); }
.site-search input::placeholder { color: var(--ix-faint); font-style: italic; }
.finder__hits { position: absolute; left: 0; right: 0; top: 100%; z-index: 40; list-style: none; margin: 0; padding: 0 1rem; border-radius: 0 0 .45rem .45rem; background: var(--ix-bg); box-shadow: 0 18px 40px var(--ix-shadow); }
.finder__hits:empty { display: none; }
.finder__hits li { border-bottom: 1px solid var(--ix-rule); }
.finder__hits a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; padding: 1rem 0; text-decoration: none; }
.finder__name { color: var(--ix-ink); font: 400 1.15rem / 1.35 var(--ix-display); }
.finder__hits a:hover .finder__name { color: var(--ix-gold-bright); }
.finder__meta { color: var(--ix-muted); font: 400 .8rem / 1.6 var(--ix-ui); text-align: right; }
.finder__note { padding: 1rem 0; color: var(--ix-muted); font: italic 300 1rem / 1.5 var(--ix-display); }

/* Phones: the top bar keeps the main sections and icons on one line; the series name is
   already on the page right under it. */
@media (max-width: 700px) {
  .book-top, .ix-top { gap: .8rem 1rem; }
  .book-top nav, .ix-top nav { flex-wrap: nowrap; gap: 1.1rem; }
  .nav-series { display: none !important; }
}
@media (max-width: 380px) {
  .book-top nav, .ix-top nav { gap: .85rem; font-size: .82rem; }
}
@media (max-width: 600px) {
  .finder__hits a { grid-template-columns: 1fr; gap: .2rem; padding: .8rem 0; }
  .finder__meta { text-align: left; }
  .finder__name { font-size: 1.05rem; }
}

/* The top bar stays pinned while scrolling and slims down once the page has moved. */
.top-pin { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--ix-bg); }
.ix-top { transition: padding .2s ease-out; }
.ix-mark small { transition: opacity .2s, max-height .2s; max-height: 1.4rem; overflow: hidden; }
.is-scrolled .ix-top { padding-block: .8rem .7rem; }
.is-scrolled .ix-mark small { opacity: 0; max-height: 0; }
.ix-letter { scroll-margin-top: 4.5rem; }
.top-pin { border-bottom: 1px solid transparent; transition: border-color .2s; }
.is-scrolled .top-pin { border-bottom-color: var(--ix-rule); }
