/* Encyclopedia-style layout shared by index.html and rdash.html. */
/* ───────── tokens (Wikipedia Vector 2022–inspired) ───────── */
:root {
  --text: #202122;
  --text-subtle: #54595d;
  --link: #3366cc;
  --link-visited: #6a60b0;
  --link-active: #faa700;
  --border: #a2a9b1;
  --border-light: #c8ccd1;
  --border-faint: #eaecf0;
  --bg: #ffffff;
  --bg-subtle: #f8f9fa;
  --bg-header: #eaecf0;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Lato, Helvetica, Arial, sans-serif;
  --font-serif: "Linux Libertine", "Georgia", "Times", "Source Serif Pro", serif;
  /* Swap to var(--font-serif) for a serif body. Wikipedia itself uses sans-serif body text. */
  --font-body: var(--font-sans);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
}
a { color: var(--link); text-decoration: none; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration: underline; }
a:active { color: var(--link-active); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--link); outline-offset: 1px;
}
img { max-width: 100%; height: auto; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 8px; top: 8px; background: #fff; padding: 6px 10px; z-index: 100; border: 1px solid var(--border); }

/* ───────── header ───────── */
.site-header {
  background: var(--bg);
  position: relative;
  z-index: 20;
}
.header-inner {
  max-width: 1246px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  background: transparent; border: 1px solid transparent; border-radius: 2px;
  color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: rgba(0,24,73,.027); border-color: var(--border-faint); }
.icon-btn svg { width: 20px; height: 20px; }
.menu-btn, .toc-btn { display: none; }

.brand { display: flex; align-items: center; gap: 9px; color: var(--text); flex-shrink: 0; }
.brand:visited { color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; }
.brand-words { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--font-serif); font-size: 19px; letter-spacing: .08em;
  font-variant: small-caps; text-transform: lowercase;
}
.brand-tag { font-family: var(--font-serif); font-size: 11.5px; color: var(--text); margin-top: 4px; letter-spacing: .02em; }

.search {
  position: relative;
  display: flex;
  flex: 0 1 470px;
  margin-left: 20px;
}
.search input {
  flex: 1; min-width: 0;
  height: 32px;
  padding: 5px 8px 5px 32px;
  font: 14px var(--font-sans);
  color: var(--text);
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 2px 0 0 2px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cg fill='%2372777d'%3E%3Cpath d='M12.2 13.6a7 7 0 1 1 1.4-1.4l5.4 5.4-1.4 1.4zM3 8a5 5 0 1 0 10 0A5 5 0 0 0 3 8'/%3E%3C/g%3E%3C/svg%3E") no-repeat 8px center / 16px;
  -webkit-appearance: none; appearance: none;
}
.search input:focus { outline: none; border-color: var(--link); box-shadow: inset 0 0 0 1px var(--link); }
.search button {
  height: 32px; padding: 0 12px;
  font: 700 14px var(--font-sans);
  color: var(--text);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 0 2px 2px 0;
  cursor: pointer;
}
.search button:hover { background: #fff; }
.suggestions {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0;
  margin: 0; padding: 0; list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-top: 0;
  box-shadow: 0 2px 2px rgba(0,0,0,.1);
  font-size: 14px;
  z-index: 30;
}
.suggestions.open { display: block; }
.suggestions li a {
  display: block; padding: 7px 12px; color: var(--text);
}
.suggestions li a small { display: block; color: var(--text-subtle); font-size: 12px; margin-top: 1px; }
.suggestions li a:hover, .suggestions li a.active { background: var(--bg-header); text-decoration: none; }
.suggestions .s-all a { border-top: 1px solid var(--border-faint); color: var(--link); }

.top-nav { margin-left: auto; }
.top-nav ul { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; font-size: 14px; }
.top-nav a, .top-nav a:visited { color: var(--link); }

/* mobile drop-down menu */
.main-menu {
  display: none;
  position: absolute; top: 52px; left: 12px;
  width: 220px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 2px 6px -1px rgba(0,0,0,.2);
  padding: 8px 0;
  font-size: 14px;
}
.main-menu.open { display: block; }
.main-menu h2 {
  margin: 0; padding: 6px 14px 4px;
  font: 700 12px var(--font-sans); color: var(--text-subtle);
  border-bottom: 1px solid var(--border-faint);
}
.main-menu ul { list-style: none; margin: 4px 0 0; padding: 0; }
.main-menu a { display: block; padding: 7px 14px; }

/* ───────── page grid ───────── */
.page {
  max-width: 1246px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  column-gap: 28px;
}
.sidebar { grid-column: 1; }
.content { grid-column: 2; min-width: 0; }

/* ───────── table of contents ───────── */
.toc {
  position: sticky; top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  margin-top: 18px;
  padding-right: 6px;
  font-size: 14px;
  line-height: 1.4;
}
.toc-header {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 0 6px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 6px;
}
.toc-title { margin: 0; font: 700 14px var(--font-sans); }
.toc-toggle {
  font: 13px var(--font-sans); color: var(--link);
  background: none; border: 0; padding: 0; cursor: pointer;
}
.toc-toggle:hover { text-decoration: underline; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc ol ol { padding-left: 14px; }
.toc li a { display: flex; gap: 6px; padding: 4px 0; color: var(--link); }
.toc li a:visited { color: var(--link); }
.toc .tocnumber { color: var(--text); min-width: 1.4em; flex-shrink: 0; }
.toc li a.is-active { color: var(--text); font-weight: 700; }
.toc li a.is-active .tocnumber { font-weight: 400; }
.toc.collapsed .toc-list { display: none; }

/* ───────── article chrome ───────── */
.title-bar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--border);
  margin-top: 16px;
}
.firstHeading {
  margin: 0; padding: 0 0 4px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.8em;
  line-height: 1.375;
  overflow-wrap: anywhere;
}
.title-action {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 7px;
  padding: 4px 10px;
  font: 700 14px var(--font-sans); color: var(--text);
  border: 1px solid transparent; border-radius: 2px;
  white-space: nowrap;
}
.title-action:visited { color: var(--text); }
.title-action:hover { background: rgba(0,24,73,.027); border-color: var(--border-faint); text-decoration: none; }
.title-action svg { width: 16px; height: 16px; }

.tabs {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
}
.tabs ul { display: flex; list-style: none; margin: 0; padding: 0; gap: 2px; }
.tabs a {
  display: block; padding: 10px 8px 7px;
  border-bottom: 2px solid transparent;
  color: var(--link);
}
.tabs a:visited { color: var(--link); }
.tabs a:hover { text-decoration: none; border-bottom-color: var(--link); }
.tabs .selected a { color: var(--text); border-bottom-color: var(--text); }

.tagline { margin: 8px 0 0; font-size: 12.25px; color: var(--text-subtle); }
.shortdesc { margin: 4px 0 0; font-size: 12.25px; color: var(--text-subtle); font-style: italic; }

/* ───────── article body ───────── */
.body-content {
  font-size: 14px;
  line-height: 1.6;
  padding-top: 8px;
  padding-bottom: 24px;
}
.body-content p { margin: 7px 0 10px; }
.body-content ul, .body-content ol { margin: 4px 0 8px 1.6em; padding: 0; }
.body-content li { margin-bottom: 2px; }
.body-content h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.5em;
  line-height: 1.375;
  margin: 1em 0 .25em;
  padding: 0 0 2px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.body-content h3 { font-size: 1.2em; font-weight: 700; line-height: 1.6; margin: .5em 0 .1em; padding-top: .3em; overflow: hidden; }
.body-content h4 { font-size: 1.05em; font-weight: 700; line-height: 1.6; margin: .5em 0 0; padding-top: .3em; }
.hatnote { font-style: italic; padding-left: 1.6em; margin: 2px 0 8px; }
.hatnote a { font-style: italic; }
sup.reference { font-size: 11px; line-height: 1; font-style: normal; font-weight: 400; white-space: nowrap; unicode-bidi: isolate; }
sup.reference a, sup.reference a:visited { color: var(--link); }
:target { background: #eaf3ff; }
.body-content h2:target, .body-content h3:target, .body-content h4:target { background: none; }
.run-in { font-weight: 700; }

/* infobox */
.infobox {
  float: right; clear: right;
  width: 22em;
  margin: 8px 0 8px 1.4em;
  padding: 3px;
  border: 1px solid var(--border);
  border-spacing: 3px;
  background: var(--bg-subtle);
  color: #000;
  font-size: 88%;
  line-height: 1.5em;
}
.infobox caption, .infobox .infobox-above {
  font-size: 125%; font-weight: 700; text-align: center; padding: 3px 0;
}
.infobox .infobox-subheader { text-align: center; padding: 0 0 4px; }
.infobox .infobox-image { text-align: center; padding: 2px 0 0; }
.infobox .infobox-image img { width: 220px; display: block; margin: 0 auto; }
.infobox .infobox-caption { text-align: center; padding: 2px 4px 6px; font-size: 95%; }
.infobox th { text-align: left; vertical-align: top; padding: 0 .6em .2em .2em; width: 40%; font-weight: 700; }
.infobox td { vertical-align: top; padding: 0 .2em .2em 0; }
.infobox .infobox-header { background: var(--bg-header); text-align: center; padding: 2px 4px; }
.infobox ul { margin: 0; padding: 0; list-style: none; }

/* thumbnails */
figure.thumb {
  float: right; clear: right;
  width: 232px;
  margin: 6px 0 12px 1.4em;
  padding: 3px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  font-size: 88%;
  line-height: 1.4em;
}
figure.thumb.left { float: left; clear: left; margin: 6px 1.4em 12px 0; }
figure.thumb img { display: block; width: 100%; border: 1px solid var(--border-light); background: #fff; }
figure.thumb figcaption { padding: 4px 3px 2px; }
figure.thumb.narrow { width: 152px; }

/* tables */
.wikitable {
  border-collapse: collapse;
  margin: 8px 0 12px;
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 100%;
}
.wikitable th, .wikitable td { border: 1px solid var(--border); padding: 3px 7px; vertical-align: top; text-align: left; }
.wikitable th { background: var(--bg-header); font-weight: 700; }
.wikitable caption { font-weight: 700; padding: 4px; text-align: center; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.div-col { columns: 3 14em; column-gap: 2em; }
.div-col li { break-inside: avoid; }

/* references */
.reflist { font-size: 90%; }
.reflist ol { margin-left: 2.2em; }
.reflist li { margin-bottom: 4px; }
.reflist .backlink { font-weight: 700; margin-right: 3px; }
.reflist .backlink a, .reflist .backlink a:visited { color: var(--link); }
.reflist cite { font-style: normal; }
.ref-type { color: var(--text-subtle); }
.notelist ol { list-style: lower-alpha; }

/* navbox */
.navbox {
  clear: both;
  margin: 20px 0 0;
  border: 1px solid var(--border);
  padding: 2px;
  font-size: 88%;
  text-align: center;
}
.navbox table { width: 100%; border-spacing: 0; border-collapse: separate; }
.navbox .navbox-title { background: #ccccff; padding: 3px 6px; font-weight: 700; font-size: 114%; }
.navbox th { background: #ddddff; padding: 3px 9px; text-align: right; white-space: nowrap; border-top: 2px solid #fdfdfd; width: 1%; }
.navbox td { text-align: left; padding: 3px 6px; border-top: 2px solid #fdfdfd; border-left: 2px solid #fdfdfd; }
.navbox tr:nth-child(odd) td { background: var(--bg-subtle); }
.navbox ul { list-style: none; margin: 0; padding: 0; display: inline; }
.navbox li { display: inline; margin: 0; }
.navbox li + li::before { content: " · "; font-weight: 700; padding: 0 2px; }

/* categories */
.catlinks {
  clear: both;
  margin-top: 16px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 14px;
}
.catlinks ul { display: inline; margin: 0; padding: 0; list-style: none; }
.catlinks li { display: inline; }
.catlinks li + li { border-left: 1px solid var(--border); padding-left: 6px; margin-left: 4px; }

mark.find-hit { background: #fef6e7; outline: 2px solid #fc3; }

/* ───────── footer ───────── */
.site-footer {
  max-width: 1246px;
  margin: 0 auto;
  padding: 0 24px 32px;
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  column-gap: 28px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}
.site-footer .footer-inner { grid-column: 2; border-top: 1px solid var(--border-light); padding-top: 12px; }
.site-footer p { margin: 0 0 6px; }
.site-footer ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* ───────── responsive ───────── */
@media (max-width: 999px) {
  .page, .site-footer { display: block; padding: 0 16px; }
  .site-footer { padding-bottom: 28px; }
  .header-inner { padding: 0 12px; gap: 8px; }
  .site-header { position: sticky; top: 0; border-bottom: 1px solid var(--border-faint); }
  html { scroll-padding-top: 64px; }
  .menu-btn, .toc-btn { display: inline-flex; }
  .top-nav { display: none; }
  .search { margin-left: auto; flex-basis: 360px; }

  /* TOC becomes a drop-down panel opened from the header */
  .sidebar { position: static; }
  .toc {
    display: none;
    position: fixed; top: 60px; left: 12px; right: 12px;
    max-width: 360px;
    max-height: calc(100vh - 80px);
    margin: 0;
    padding: 4px 14px 10px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 2px 6px -1px rgba(0,0,0,.2);
    z-index: 25;
  }
  .toc.open { display: block; }
  .toc.collapsed .toc-list { display: block; }
  .toc li a { padding: 7px 0; }
}
@media (max-width: 720px) {
  .infobox { float: none; width: 100%; margin: 12px 0; }
  .lead { display: flex; flex-direction: column; }
  .lead > .lead-first { order: -1; }
  figure.thumb, figure.thumb.left { float: none; width: auto; max-width: 340px; margin: 12px auto; }
  figure.thumb.narrow { max-width: 200px; }
  .tabs { flex-direction: column; gap: 0; }
  .tabs .tabs-right { border-top: 1px solid var(--border-faint); }
  .title-action span { display: none; }
  .body-content { font-size: 15px; }
  .navbox th { text-align: left; white-space: normal; display: block; width: auto; }
  .navbox td { display: block; border-left: 0; }
}
@media (max-width: 560px) {
  .brand-words { display: none; }
  .search { position: static; flex: 1; }
  .search button { display: none; }
  .search input { border-right: 1px solid var(--border); border-radius: 2px; }
  .suggestions { left: 12px; right: 12px; top: 52px; border-top: 1px solid var(--border); }
}
@media print {
  .site-header, .sidebar, .tabs, .title-action, .navbox { display: none; }
  .page, .site-footer { display: block; }
}
