/* fatrank.wiki — encyclopedia theme */

:root {
  --text:          #202122;
  --text-muted:    #54595d;
  --link:          #3366cc;
  --link-visited:  #795cb2;
  --link-red:      #d73333;
  --border:        #a2a9b1;
  --border-light:  #c8ccd1;
  --bg-body:       #f6f6f6;
  --bg-box:        #f8f9fa;
  --bg-content:    #ffffff;
  --accent:        #cfe7cf;
  --serif:         'Linux Libertine', 'Georgia', 'Times New Roman', serif;
  --sans:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

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

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

a.external::after {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 3px;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%233366cc' d='M6 1h5v5H9.5V3.56L5.28 7.78 4.22 6.72 8.44 2.5H6V1zM2 2h2.5v1.5H3.5v5h5v-1H10V10H2V2z'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--bg-content);
  border-bottom: 1px solid #eaecf0;
}

.header-inner,
.tabs-inner,
.page,
.site-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.logo { display: flex; align-items: center; gap: 12px; color: inherit; }
.logo:hover { text-decoration: none; }
.logo:visited { color: inherit; }

.logo-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-box);
  font-family: var(--serif);
  font-size: 22px;
  color: var(--text);
}

.logo-title   { display: block; font-family: var(--serif); font-size: 19px; line-height: 1.2; }
.logo-tagline { display: block; font-size: 11px; color: var(--text-muted); }

.search { display: flex; }

.search input {
  width: 240px;
  padding: 6px 8px;
  border: 1px solid var(--border-light);
  border-right: 0;
  border-radius: 2px 0 0 2px;
  font: inherit;
  font-size: 13px;
}

.search input:focus { outline: 0; border-color: var(--link); box-shadow: inset 0 0 0 1px var(--link); }

.search button {
  padding: 6px 14px;
  border: 1px solid var(--border-light);
  border-radius: 0 2px 2px 0;
  background: var(--bg-box);
  font: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.search button:hover { background: #ffffff; }

/* ---------- Tab bar ---------- */

.tabs { background: var(--bg-body); border-bottom: 1px solid var(--border); }

.tabs-inner { display: flex; justify-content: space-between; }

.tabs ul { display: flex; margin: 0; padding: 0; list-style: none; }

.tabs li a {
  display: block;
  padding: 9px 12px 8px;
  font-size: 13px;
  border: 1px solid transparent;
  border-bottom: 0;
}

.tabs li.selected a {
  background: var(--bg-content);
  border-color: var(--border);
  color: var(--text);
  margin-bottom: -1px;
  padding-bottom: 9px;
}

.tabs li.selected a:hover { text-decoration: none; }

/* ---------- Page body ---------- */

.page {
  background: var(--bg-content);
  border: 1px solid var(--border);
  border-top: 0;
  padding: 20px 28px 32px;
  max-width: 1180px;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: normal; color: var(--text); }

h1 {
  margin: 0;
  padding-bottom: 4px;
  font-size: 32px;
  line-height: 1.3;
  border-bottom: 1px solid var(--border-light);
}

.site-sub {
  margin: 3px 0 14px;
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
}

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

h3 { margin: 20px 0 8px; font-size: 17px; font-weight: bold; }
h4 { margin: 16px 0 6px; font-size: 15px; font-weight: bold; }

p  { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 26px; }
li { margin-bottom: 4px; }

.editsection { font-family: var(--sans); font-size: 12px; font-weight: normal; color: var(--text-muted); white-space: nowrap; }
.editsection a { color: var(--link); }

.hatnote {
  margin: 0 0 14px;
  padding-left: 26px;
  font-style: italic;
  color: var(--text);
}

blockquote {
  margin: 0 0 14px;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--border-light);
  color: var(--text-muted);
  font-style: italic;
}

/* ---------- Infobox ---------- */

.infobox {
  float: right;
  clear: right;
  width: 320px;
  margin: 0 0 16px 22px;
  border: 1px solid var(--border);
  background: var(--bg-box);
  font-size: 12.5px;
  line-height: 1.5;
}

.infobox-title {
  padding: 7px 8px;
  background: var(--accent);
  font-family: var(--serif);
  font-size: 16px;
  text-align: center;
}

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

.infobox-logo {
  display: block;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  border: 1px solid var(--border-light);
  background: #fff;
}

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

.infobox table { width: 100%; border-collapse: collapse; }

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

.infobox th { width: 38%; font-weight: bold; }

.infobox .section-row th {
  width: auto;
  background: #eaf3ea;
  text-align: center;
  font-family: var(--serif);
  font-weight: normal;
  font-size: 13.5px;
}

.infobox ul { margin: 0; padding-left: 15px; }

/* ---------- Contents box ---------- */

.toc {
  display: table;
  margin: 0 0 18px;
  padding: 8px 18px 10px 10px;
  border: 1px solid var(--border);
  background: var(--bg-box);
  font-size: 13px;
}

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

.toc ol { margin: 0; padding-left: 20px; list-style: none; counter-reset: toc; }
.toc > ol { padding-left: 0; }
.toc li { margin: 2px 0; counter-increment: toc; }
.toc li::before { content: counters(toc, ".") "\00a0"; color: var(--text); }
.toc ol ol { counter-reset: toc; }

/* ---------- Tables ---------- */

.wikitable {
  width: 100%;
  margin: 0 0 16px;
  border-collapse: collapse;
  background: var(--bg-content);
  font-size: 13px;
}

.wikitable caption { padding-bottom: 6px; font-weight: bold; text-align: left; }

.wikitable th,
.wikitable td {
  padding: 7px 9px;
  border: 1px solid var(--border-light);
  text-align: left;
  vertical-align: top;
}

.wikitable th { background: var(--bg-box); font-weight: bold; }

.table-wrap { overflow-x: auto; }

/* ---------- References ---------- */

sup.ref { font-size: 11px; line-height: 1; }
sup.ref a { padding: 0 1px; }

.references { font-size: 13px; padding-left: 30px; }
.references li { margin-bottom: 6px; }
.references li:target { background: #eaf3ff; }

.reflist-note { font-size: 13px; color: var(--text-muted); }

/* ---------- External links ---------- */

.link-columns {
  columns: 2;
  column-gap: 36px;
  padding-left: 26px;
}

.link-columns li { break-inside: avoid; }

.link-group-title { margin: 14px 0 6px; font-size: 15px; font-weight: bold; font-family: var(--sans); }

/* ---------- Categories ---------- */

.catlinks {
  margin-top: 26px;
  padding: 6px 10px;
  border: 1px solid var(--border-light);
  background: var(--bg-box);
  font-size: 13px;
}

.catlinks ul { display: inline; margin: 0; padding: 0; list-style: none; }
.catlinks li { display: inline; padding: 0 6px; border-left: 1px solid var(--border-light); }
.catlinks li:first-child { border-left: 0; padding-left: 4px; }

/* ---------- Footer ---------- */

.site-footer { margin: 18px 0 40px; }

.site-footer-inner { font-size: 12.5px; color: var(--text-muted); }

.site-footer p { margin: 0 0 6px; }

.footer-links { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; padding: 0; list-style: none; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .infobox { float: none; width: 100%; margin: 0 0 18px; }
  .link-columns { columns: 1; }
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .search { width: 100%; }
  .search input { width: 100%; }
  .page { padding: 16px 16px 26px; }
  .tabs-inner { overflow-x: auto; }
  h1 { font-size: 27px; }
  h2 { font-size: 21px; }
}

/* ---------- Notice box ---------- */

.note-box {
  margin: 0 0 16px;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-left: 4px solid #c8ccd1;
  background: var(--bg-box);
  font-size: 13px;
  color: var(--text-muted);
}

.note-box b { color: var(--text); }
