/* wiki.css — Wikipedia-inspired article style for Former Upper Pannonia wiki */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: 'Linux Libertine', 'Georgia', 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.65;
  color: #202122;
  background: #f8f9fa;
  margin: 0;
  padding: 0;
}

#content {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5em 2.5em 3em;
  background: #fff;
  border-left: 1px solid #a2a9b1;
  border-right: 1px solid #a2a9b1;
  min-height: 100vh;
}

/* ── Headings ── */

h1 {
  font-size: 2em;
  font-weight: normal;
  border-bottom: 1px solid #a2a9b1;
  padding-bottom: 4px;
  margin: 0.5em 0 0.4em;
  line-height: 1.3;
}

h2 {
  font-size: 1.5em;
  font-weight: normal;
  border-bottom: 1px solid #a2a9b1;
  padding-bottom: 2px;
  margin: 1.8em 0 0.5em;
}

h3 {
  font-size: 1.15em;
  font-weight: bold;
  margin: 1.4em 0 0.4em;
}

h4 {
  font-size: 1em;
  font-weight: bold;
  margin: 1.2em 0 0.3em;
}

/* ── Body text ── */

p {
  margin: 0 0 0.8em;
}

a {
  color: #0645ad;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:visited {
  color: #0b0080;
}

em {
  font-style: italic;
}

strong {
  font-weight: bold;
}

/* ── Table of Contents ── */

#toc {
  background: #f8f9fa;
  border: 1px solid #a2a9b1;
  padding: 12px 16px 12px 12px;
  display: inline-block;
  min-width: 180px;
  max-width: 420px;
  margin: 0.5em 0 1.2em 0;
  font-size: 0.9em;
  line-height: 1.5;
}

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

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

ol.toc-list > li {
  margin: 3px 0;
}

ol.toc-sub {
  margin: 2px 0 2px 1em;
  padding-left: 1em;
  list-style: none;
}

ol.toc-sub > li {
  margin: 2px 0;
}

#toc a {
  color: #0645ad;
}

/* ── Tables ── */

table {
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.95em;
}

th, td {
  border: 1px solid #a2a9b1;
  padding: 5px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #eaecf0;
  font-weight: bold;
}

tr:nth-child(even) td {
  background: #f8f9fa;
}

/* ── Code ── */

code {
  font-family: 'Courier New', monospace;
  font-size: 0.88em;
  background: #f8f9fa;
  border: 1px solid #ddd;
  padding: 1px 4px;
  border-radius: 2px;
}

pre {
  background: #f8f9fa;
  border: 1px solid #ddd;
  padding: 1em;
  overflow-x: auto;
  font-size: 0.88em;
  line-height: 1.4;
}

pre code {
  border: none;
  padding: 0;
  background: none;
}

/* ── Blockquote ── */

blockquote {
  margin: 1em 2em;
  padding: 0.5em 1em;
  border-left: 3px solid #a2a9b1;
  color: #555;
  font-style: italic;
}

/* ── Lists ── */

ul, ol {
  margin: 0.4em 0 0.8em;
  padding-left: 2em;
}

li {
  margin: 0.2em 0;
}

/* ── Images ── */

figure.wiki-image {
  float: right;
  clear: right;
  margin: 0.5em 0 1em 1.5em;
  padding: 4px;
  border: 1px solid #a2a9b1;
  background: #f8f9fa;
  text-align: center;
  max-width: 320px;
}

/* Each row is its own block-formatting context, so figures in it float and
   clear only against each other, never against images in other rows — an
   image always starts level with its own paragraph, never pushed down by
   an earlier, taller image elsewhere in the article still being cleared. */
.wiki-image-row {
  display: flow-root;
}

.wiki-image-row figure.wiki-image {
  margin-top: 0;
}

figure.wiki-image img {
  display: block;
  max-width: 100%;
  height: auto;
}

figure.wiki-image figcaption {
  font-size: 0.85em;
  color: #555;
  margin-top: 4px;
  padding: 0 2px;
  text-align: center;
}

/* ── Language switcher ── */

#lang-switcher {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.4em 2.5em;
  background: #fff;
  border-left: 1px solid #a2a9b1;
  border-right: 1px solid #a2a9b1;
  text-align: right;
  font-size: 0.9em;
  color: #555;
}

#lang-switcher a {
  color: #0645ad;
}

/* ── Telegram discussion link ── */

p.discussion {
  font-size: 0.9em;
}

p.discussion a,
p.discussion a:visited {
  color: #1c7ab0;
  border-bottom: 1px dotted #1c7ab0;
}

p.discussion a:hover {
  text-decoration: none;
  border-bottom-style: solid;
}

/* Telegram logo as an inline SVG data URI: no extra file, works on GitHub Pages */
p.discussion a::before {
  content: "";
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.35em;
  vertical-align: -0.2em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2326A5E4' d='M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ── Footer ── */

footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 1em 2.5em;
  border-top: 1px solid #a2a9b1;
  font-size: 0.85em;
  color: #555;
  background: #fff;
}

footer a {
  color: #0645ad;
}

/* ── Responsive ── */

@media (max-width: 700px) {
  #content {
    padding: 1em 1.2em 2em;
    border: none;
  }

  #toc {
    max-width: 100%;
    width: 100%;
  }

  h1 { font-size: 1.6em; }
  h2 { font-size: 1.3em; }
}
