/* Wikipedia Vector 2022 skin — faithful recreation */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --color-base: #202122;
  --color-subtle: #54595d;
  --color-link: #3366cc;
  --color-link-hover: #3056a9;
  --color-visited: #6b4ba1;
  --color-red: #ba3925;
  --bg-page: #f8f9fa;
  --bg-content: #fff;
  --border: #a2a9b1;
  --border-light: #c8ccd1;
  --border-faint: #eaecf0;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-heading: 'Source Serif 4', 'Linux Libertine', Georgia, Times, serif;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.625;
  color: var(--color-base);
  background: var(--bg-page);
  -webkit-font-smoothing: auto;
}

a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--color-link-hover); }
a:visited { color: var(--color-visited); }
img { max-width: 100%; display: block; }

/* ===== WIKI HEADER BAR ===== */
.wiki-header {
  background: var(--bg-content);
  border-bottom: 1px solid var(--border-faint);
  position: sticky;
  top: 0;
  z-index: 100;
}

.wiki-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wiki-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--color-subtle);
}

.wiki-logo svg { flex-shrink: 0; }

.wiki-logo-text {
  line-height: 1.2;
}

.wiki-logo-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.1rem;
  color: var(--color-base);
  letter-spacing: -0.01em;
}

.wiki-logo-sub {
  font-size: 0.72rem;
  color: var(--color-subtle);
}

.wiki-switch {
  display: flex;
  gap: 4px;
}

.switch-btn {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-subtle);
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.switch-btn:hover {
  background: var(--border-faint);
  color: var(--color-base);
  text-decoration: none;
}

.switch-btn--active {
  background: var(--color-base);
  color: #fff;
  border-color: var(--color-base);
}

.switch-btn--active:hover {
  background: #333;
  color: #fff;
}

/* ===== PAGE LAYOUT ===== */
.wiki-page {
  max-width: 960px;
  margin: 0 auto;
  background: var(--bg-content);
  min-height: 100vh;
  padding: 0 24px;
}

/* ===== TITLE ===== */
.wiki-title {
  font-family: var(--font-heading);
  font-size: 1.88rem;
  font-weight: normal;
  line-height: 1.375;
  padding: 16px 0 0;
  margin-bottom: 0;
}

/* ===== TABS ===== */
.wiki-tabs {
  display: flex;
  gap: 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 20px;
  padding-top: 4px;
}

.wiki-tab {
  padding: 8px 14px;
  color: var(--color-link);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s;
}

.wiki-tab:hover { text-decoration: none; border-bottom-color: var(--border-light); }
.wiki-tab--active {
  color: var(--color-base);
  border-bottom-color: var(--color-base);
  font-weight: 500;
}

/* ===== INFOBOX ===== */
.infobox {
  float: right;
  clear: right;
  width: 26em;
  margin: 0 0 0.3em 1.4em;
  border: 1px solid var(--border);
  background: var(--bg-page);
  font-size: 88%;
  line-height: 1.5;
  border-spacing: 0;
  border-collapse: collapse;
}

.infobox-title {
  text-align: center;
  font-size: 125%;
  font-weight: bold;
  padding: 8px 10px;
  background: var(--bg-page);
}

.infobox-subtitle {
  text-align: center;
  padding: 4px 10px;
  color: var(--color-subtle);
  font-size: 100%;
}

.infobox-image {
  text-align: center;
  padding: 8px;
}

.infobox-image img {
  width: 250px;
  margin: 0 auto;
}

.infobox-caption {
  font-size: 90%;
  color: var(--color-subtle);
  text-align: center;
  padding: 4px 10px 8px;
}

.infobox-row {
  display: flex;
  border-top: 1px solid var(--border-faint);
}

.infobox-label {
  width: 7.5em;
  flex-shrink: 0;
  padding: 5px 10px;
  font-weight: bold;
  vertical-align: top;
  color: var(--color-base);
}

.infobox-data {
  padding: 5px 10px;
  flex: 1;
}

.infobox-header {
  text-align: center;
  font-weight: bold;
  padding: 6px 10px;
  border-top: 1px solid var(--border-faint);
  background: var(--bg-page);
}

.infobox-data .plainlist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.infobox-data .plainlist li { margin: 0; display: flex; align-items: center; gap: 5px; }

.ib-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  border-radius: 2px;
  background: transparent;
}

/* ===== TOC ===== */
.toc {
  display: table;
  background: var(--bg-page);
  border: 1px solid var(--border);
  padding: 10px 14px;
  font-size: 95%;
  margin: 0 0 1em 0;
}

.toc-title {
  font-weight: bold;
  text-align: center;
  margin-bottom: 6px;
}

.toc ol {
  margin: 0;
  padding-left: 1.6em;
  list-style: none;
  counter-reset: toc;
}

.toc > ol { padding-left: 0; }

.toc li {
  counter-increment: toc;
  margin: 2px 0;
}

.toc li::before {
  content: counters(toc, ".") " ";
  color: var(--color-base);
}

.toc a { color: var(--color-link); }

.toc ol ol {
  padding-left: 1.4em;
  margin-top: 2px;
}

/* ===== CONTENT ===== */
.wiki-content {
  line-height: 1.625;
}

.wiki-content p {
  margin-bottom: 0.8em;
}

.wiki-content h2 {
  font-family: var(--font-heading);
  font-size: 150%;
  font-weight: normal;
  line-height: 1.375;
  border-bottom: 1px solid var(--border);
  margin: 1.2em 0 0.5em;
  padding-bottom: 2px;
}

.wiki-content h2 .edit-link {
  font-family: var(--font-body);
  font-size: 0.55em;
  font-weight: normal;
  color: var(--color-link);
  margin-left: 1em;
  vertical-align: baseline;
}

.wiki-content h3 {
  font-family: var(--font-body);
  font-size: 128%;
  font-weight: bold;
  margin: 1em 0 0.4em;
}

.wiki-content ul, .wiki-content ol {
  margin: 0.3em 0 0.8em 1.6em;
}

.wiki-content li { margin-bottom: 0.25em; }

/* ===== CITATION ===== */
.ref {
  font-size: 75%;
  vertical-align: super;
  line-height: 0;
  color: var(--color-link);
}

.ref::before { content: '['; }
.ref::after { content: ']'; }

.references {
  font-size: 90%;
  column-width: 30em;
}

.references ol {
  margin: 0.3em 0 0 2.4em;
  padding: 0;
}

.references li {
  margin-bottom: 0.3em;
}

/* ===== CATEGORIES ===== */
.catlinks {
  background: var(--bg-page);
  border: 1px solid var(--border);
  padding: 6px 10px;
  margin-top: 2em;
  font-size: 88%;
  clear: both;
}

.catlinks a { margin: 0 4px; }

/* ===== FOOTER ===== */
.wiki-footer {
  border-top: 1px solid var(--border);
  margin-top: 2em;
  padding: 12px 0 40px;
  font-size: 0.78rem;
  color: var(--color-subtle);
  clear: both;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 720px) {
  .infobox {
    float: none;
    width: 100%;
    margin: 0 0 1em 0;
  }
  .wiki-search { width: 180px; }
  .wiki-page { padding: 0 14px; }
  .wiki-title { font-size: 1.5rem; }
}
