/* Wikipedia-style reference layout. Light-only by design: the visual
   convention is the point, and a familiar encyclopedia look is what signals
   "reference document" to a human reader. */

:root {
  --accent: #0f7b6c;
  --accent-dark: #0a5c50;
  --link: #3366cc;
  --link-visited: #6b4ba1;
  --text: #202122;
  --text-muted: #54595d;
  --border: #a2a9b1;
  --border-light: #c8ccd1;
  --bg: #ffffff;
  --bg-subtle: #f8f9fa;
  --serif: 'Linux Libertine', 'Georgia', 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #f6f6f6;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
}

a { color: var(--link); text-decoration: none; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- header ---------- */

.site-header {
  background: var(--bg);
  border-bottom: 2px solid var(--accent);
}

.header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 10px 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-subtle);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-family: var(--serif); font-size: 19px; }
.brand-tagline { font-size: 11.5px; color: var(--text-muted); }

.header-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}
.header-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.header-nav li a {
  display: block;
  padding: 6px 12px;
  font-size: 13.5px;
  color: var(--link);
  border-bottom: 2px solid transparent;
}
.header-nav li.selected a {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* ---------- page ---------- */

.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  background: var(--bg);
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
}

article { padding: 28px 0 40px; }

#firstHeading {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.25;
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

.subtitle {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 6px 0 18px;
}

.content-body { max-width: 880px; }
.content-body::after { content: ''; display: block; clear: both; }

.content-body p { margin: 0 0 14px; }

h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  margin: 26px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
  clear: none;
}

h3 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  margin: 20px 0 8px;
}

.mw-editsection {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  color: var(--border);
  white-space: nowrap;
}
.mw-editsection a { color: var(--link); }

/* ---------- infobox ---------- */

.infobox {
  float: right;
  clear: right;
  width: 300px;
  margin: 4px 0 18px 22px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.5;
}

.infobox-title {
  caption-side: top;
  background: #eaecf0;
  padding: 8px;
  font-family: var(--serif);
  font-size: 16px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}

.infobox th,
.infobox td {
  padding: 6px 8px;
  border-top: 1px solid #eaecf0;
  text-align: left;
  vertical-align: top;
}

.infobox th {
  width: 38%;
  font-weight: 700;
  white-space: nowrap;
}

.infobox-image { text-align: center; padding: 10px 8px; }
.infobox-image img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border-light);
  background: #fff;
}
.infobox-caption { margin-top: 6px; color: var(--text-muted); }

/* ---------- table of contents ---------- */

.toc {
  display: inline-block;
  min-width: 250px;
  max-width: 100%;
  margin: 6px 0 20px;
  padding: 10px 18px 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  font-size: 13.5px;
}
.toc h2 {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 700;
  border: 0;
  margin: 0 0 6px;
  padding: 0;
}
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc ul ul { padding-left: 18px; }
.toc li { margin: 3px 0; }
.tocnumber { color: var(--text-muted); padding-right: 4px; }

/* ---------- figures ---------- */

.thumb {
  margin: 6px 0 18px;
  padding: 4px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  max-width: 100%;
}
.thumb img { display: block; width: 100%; height: auto; }
.thumb figcaption {
  padding: 6px 4px 2px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ---------- citations and references ---------- */

sup.reference { font-size: 10px; line-height: 1; }
sup.reference a { padding: 0 1px; }
sup.reference--broken { color: #b32424; font-weight: 700; }

ol.references {
  font-size: 12.8px;
  line-height: 1.6;
  margin: 8px 0;
  padding-left: 28px;
  color: var(--text-muted);
}
ol.references li { margin-bottom: 5px; }
ol.references li:target { background: #fef6e7; }

.cite-backlink,
.cite-backlink-letter { font-weight: 700; }

ul.plainlist { margin: 8px 0; padding-left: 22px; }
ul.plainlist li { margin: 3px 0; }

a.external::after {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 3px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%233366cc' d='M6 1h5v5H9.5V3.56L4.53 8.53 3.47 7.47 8.44 2.5H6V1zM2 3h2v1.5H2.5v5h5V8H9v3H1V3h1z'/%3E%3C/svg%3E")
    no-repeat center / contain;
}

/* ---------- faq ---------- */

.faq-item {
  padding: 10px 0 2px;
  border-top: 1px solid #eaecf0;
}
.faq-item:first-child { border-top: 0; }
.faq-item h3 {
  margin: 0 0 6px;
  font-size: 15px;
}
.faq-item p { margin: 0 0 10px; }

/* ---------- categories and footer ---------- */

.catlinks {
  margin-top: 28px;
  padding: 8px 10px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  font-size: 12.5px;
  line-height: 1.9;
}
.cat {
  display: inline-block;
  padding: 1px 8px;
  margin: 0 4px;
  border-left: 1px solid var(--border-light);
  color: var(--text-muted);
}

.site-footer {
  max-width: 1160px;
  margin: 0 auto;
  padding: 16px 24px 40px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
}
.site-footer p { margin: 3px 0; }
.disclaimer { font-style: italic; }

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .page { border: 0; padding: 0 16px; }
  .infobox {
    float: none;
    width: 100%;
    margin: 12px 0 20px;
  }
  #firstHeading { font-size: 26px; }
  .header-nav { flex-wrap: wrap; }
}

@media print {
  .site-header, .toc, .skip-link { display: none; }
  .page { border: 0; max-width: none; }
  a.external::after { display: none; }
}
