/* ==========================================================================
   AdemAjvazi.wiki
   Encyclopedic layout. No frameworks, no webfonts, no build step.
   ========================================================================== */

:root {
  --ink: #202122;
  --brand-ink: #13141A;
  --mint: #39E0BE;
  --link: #0645ad;
  --link-visited: #0b0080;
  --rule: #a2a9b1;
  --rule-light: #c8ccd1;
  --box-bg: #f8f9fa;
  --muted: #54595d;
  --serif: 'Linux Libertine', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

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

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--link); text-decoration: none; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* ---- Header ---- */
.site-header {
  border-bottom: 1px solid var(--rule-light);
  background: var(--box-bg);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.brand:visited { color: var(--ink); }
.brand:hover { text-decoration: none; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--brand-ink);
  color: #fff;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
}

.brand-name {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: .2px;
}

.brand-tld { color: var(--muted); }

.header-note {
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
}

/* ---- Article head ---- */
main { padding-bottom: 30px; }

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.25;
  margin: 18px 0 0;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--rule);
}

.tagline {
  font-size: 12.6px;
  color: var(--muted);
  margin: 4px 0 14px;
}

.hatnote {
  font-size: 13.2px;
  font-style: italic;
  color: var(--muted);
  padding-left: 1.6em;
  margin: 0 0 14px;
}

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 23px;
  margin: 26px 0 10px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--rule-light);
  clear: left;
}

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

.edit-mark {
  font-family: var(--sans);
  font-size: 12.6px;
  font-weight: 400;
  color: var(--link);
  vertical-align: baseline;
  margin-left: 6px;
  cursor: default;
}

p { margin: 0 0 12px; }

sup.ref { line-height: 1; font-size: 11.5px; }
sup.ref a { white-space: nowrap; }

/* ---- Infobox ---- */
.infobox {
  float: right;
  clear: right;
  width: 300px;
  margin: 4px 0 16px 20px;
  border: 1px solid var(--rule);
  background: var(--box-bg);
  font-size: 12.6px;
  line-height: 1.5;
}

.infobox-title {
  font-family: var(--serif);
  font-size: 17px;
  text-align: center;
  font-weight: 700;
  padding: 8px 10px 4px;
}

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

.infobox-image img { display: block; }

.img-note {
  display: block;
  font-size: 11.4px;
  color: var(--muted);
  margin-top: -14px;
  margin-bottom: 6px;
}

.infobox-caption {
  font-size: 11.8px;
  color: var(--ink);
  padding-bottom: 8px;
}

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

.infobox th,
.infobox td {
  vertical-align: top;
  text-align: left;
  padding: 5px 12px;
}

.infobox th {
  width: 34%;
  font-weight: 700;
  padding-right: 6px;
}

.infobox tr { border-top: 1px solid #eaecf0; }

/* ---- TOC ---- */
.toc {
  display: inline-block;
  border: 1px solid var(--rule);
  background: var(--box-bg);
  padding: 10px 22px 10px 14px;
  font-size: 13.2px;
  margin: 6px 0 14px;
}

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

.toc ol {
  margin: 0;
  padding-left: 1.5em;
}

.toc ol ol { padding-left: 1.4em; }

.toc li { margin: 2px 0; }

/* ---- Figures ---- */
.article-figure {
  margin: 6px 0 16px;
  max-width: 560px;
  border: 1px solid var(--rule-light);
  background: var(--box-bg);
  padding: 4px 10px 8px;
  font-size: 12.2px;
}

.article-figure img { display: block; }

.article-figure figcaption { color: var(--ink); }

/* ---- Lists, references, categories ---- */
.plain-list {
  margin: 0 0 12px;
  padding-left: 1.6em;
}

.references {
  font-size: 13.2px;
  margin: 0 0 12px;
  padding-left: 1.8em;
}

.references li { margin-bottom: 6px; }

.references li:target,
.references li:target cite { background: #eaf3ff; }

cite { font-style: italic; }

.categories {
  border: 1px solid var(--rule);
  background: var(--box-bg);
  padding: 6px 10px;
  margin-top: 26px;
  font-size: 13.2px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
  clear: both;
}

.categories-label {
  margin: 0;
  font-weight: 700;
}

.categories-label::after { content: ":"; }

.categories ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
}

.categories li { color: var(--link); }

.categories li + li::before {
  content: "|";
  color: var(--rule);
  margin: 0 8px;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--rule-light);
  background: var(--box-bg);
  padding: 14px 0 20px;
  font-size: 12.6px;
  color: var(--muted);
}

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

.footer-brand {
  font-family: var(--serif);
  color: var(--ink);
}

/* ---- Responsive ---- */
@media (max-width: 720px) {
  body { font-size: 15.5px; }

  .infobox {
    float: none;
    width: 100%;
    margin: 10px 0 16px;
  }

  .toc { display: block; }

  .header-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .edit-mark, .img-note { display: none; }
  .infobox { float: right; }
  a { color: var(--ink); }
}
