/* Sirenen-Wiki – statische Lesefassung */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #1f2328;
  --muted: #5f6b76;
  --line: #d9dee3;
  --line-soft: #eceff2;
  --side: #f5f6f8;
  --top: #1e252b;
  --accent: #b42318;
  --accent-soft: #fdf1f0;
  --link: #0b57b8;
  --visited: #5b3da8;
  --red: #c4291c;
  --placeholder: #eef0f3;
  --placeholder-ink: #8a95a1;
  --radius: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:visited { color: var(--visited); }
code { font: 0.9em/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--line-soft); padding: 0.05em 0.3em; border-radius: 3px; word-break: break-all; }
code.small { font-size: 0.75em; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* Kopfzeile */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.55rem 1.25rem;
  background: var(--top); color: #fff;
}
.brand { color: #fff !important; font-weight: 650; font-size: 1.1rem; letter-spacing: 0.01em; white-space: nowrap; }
.brand span { display: inline-block; margin-left: 0.35rem; padding: 0 0.45rem; border-radius: 4px; background: var(--accent); font-size: 0.75rem; font-weight: 600; vertical-align: 0.15em; text-transform: uppercase; letter-spacing: 0.06em; }
.brand:hover { text-decoration: none; }
.search { margin-left: auto; flex: 0 1 22rem; }
.search input, .search-page input {
  width: 100%; padding: 0.4rem 0.7rem; border-radius: var(--radius);
  border: 1px solid #47525c; background: #2b343c; color: #fff; font: inherit; font-size: 0.95rem;
}
.search input::placeholder { color: #aeb7c0; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; padding: 0 0.25rem; }

/* Grundlayout */
.layout { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: calc(100vh - 3rem); }
.sidebar { background: var(--side); border-right: 1px solid var(--line); padding: 1.25rem 1rem 2rem; font-size: 0.92rem; }
.nav-group + .nav-group { margin-top: 1.25rem; }
.nav-group h2 { margin: 0 0 0.35rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 650; }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group a { display: block; padding: 0.18rem 0.5rem; border-radius: 4px; color: var(--text); }
.nav-group a:hover { background: #e7eaee; text-decoration: none; }
.nav-group a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.main { padding: 1.5rem 2.25rem 3rem; max-width: 72rem; }
body.wide .main { max-width: none; }
.footer { border-top: 1px solid var(--line); padding: 1rem 1.25rem; font-size: 0.85rem; color: var(--muted); background: var(--side); }

.ns-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 650; }
h1 { margin: 0.1rem 0 0.75rem; font-size: 2rem; line-height: 1.25; font-weight: 650; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 0.25rem; margin: -0.25rem 0 1rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: 0.3rem 0.8rem; border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; color: var(--link); margin-bottom: -1px; }
.tabs a[aria-current] { border-color: var(--line); background: var(--bg); color: var(--text); font-weight: 600; }
.notice { margin: 0 0 1.25rem; padding: 0.75rem 1rem; border-radius: var(--radius); border: 1px solid #f1c6c1; background: var(--accent-soft); font-size: 0.95rem; }

/* Wiki-Inhalt */
.content { overflow-wrap: break-word; }
.content::after { content: ""; display: block; clear: both; }
.content h2, .content h3, .content h4 { line-height: 1.3; margin: 1.6em 0 0.5em; font-weight: 650; }
.content h2 { font-size: 1.45rem; padding-bottom: 0.2rem; border-bottom: 1px solid var(--line); }
.content h3 { font-size: 1.18rem; }
.content p { margin: 0.5em 0 0.8em; }
.content ul, .content ol { padding-left: 1.6em; }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.content table { border-collapse: collapse; }
.content sup { line-height: 0; }

table.wikitable, table.prettytable { margin: 1em 0; border: 1px solid #aaa; border-collapse: collapse; background: #f9f9f9; font-size: 0.95rem; }
table.wikitable th, table.wikitable td, table.prettytable th, table.prettytable td { padding: 0.25em 0.45em; border: 1px solid #aaa; vertical-align: top; }
table.wikitable th, table.prettytable th { background: #f2f2f2; text-align: center; }
table.infotable { margin: 1em 0; border: 1px dotted #aaa; border-collapse: collapse; background: #f9f9f9; }
table.infotable td { padding: 0.2em; font-style: italic; }
table[align="right"] { margin: 0 0 1em 1.25em; }
table[align="left"] { margin: 0 1.25em 1em 0; }
.content table:not([class]) td, .content table:not([class]) th { padding: 0.15em 0.4em; }

/* Sortierbare Tabellen */
table.sortable th.sort-th { cursor: pointer; user-select: none; }
table.sortable th.sort-th::after { content: " ↕"; color: var(--muted); font-size: 0.8em; }
table.sortable th.sort-asc::after { content: " ▲"; color: var(--text); }
table.sortable th.sort-desc::after { content: " ▼"; color: var(--text); }

/* Inhaltsverzeichnis */
#toc, .toc { display: inline-block; border: 1px solid var(--line); background: #f8f9fa; padding: 0.6rem 1rem 0.7rem; border-radius: var(--radius); font-size: 0.92rem; margin: 0.5rem 0 1rem; }
#toctitle h2 { font-size: 1rem; margin: 0 0 0.3rem; border: 0; padding: 0; }
.toc ul { list-style: none; margin: 0; padding-left: 0; }
.toc ul ul { padding-left: 1.2em; }
.tocnumber { color: var(--muted); margin-right: 0.3em; }

/* Thumbnails und Galerien */
.thumb { margin-bottom: 0.75rem; }
.thumb.tright, .floatright { float: right; clear: right; margin: 0.3rem 0 1rem 1.4rem; }
.thumb.tleft, .floatleft { float: left; clear: left; margin: 0.3rem 1.4rem 1rem 0; }
.thumb.tnone { margin: 0.3rem 1.4rem 1rem 0; }
.content p:has(> br:only-child) { margin: 0; }
.thumbinner { border: 1px solid var(--line); background: #f8f9fa; padding: 3px; border-radius: var(--radius); max-width: 100%; }
.thumbcaption { font-size: 0.88rem; line-height: 1.4; padding: 0.35rem 0.3rem 0.15rem; }
.center { text-align: center; }
.center .thumb, .center .noimg { margin-left: auto; margin-right: auto; }

ul.gallery { list-style: none; margin: 1rem 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 0.9rem; }
li.gallerybox { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #f8f9fa; padding: 4px; display: flex; flex-direction: column; }
li.gallerybox .thumb { margin: 0; }
li.gallerybox .gallerytext { font-size: 0.88rem; line-height: 1.4; padding: 0.35rem 0.3rem 0.1rem; }
li.gallerybox .gallerytext p { margin: 0; }
ul.mediathek li.gallerybox { background: var(--bg); }

/* „Kein Bild“-Platzhalter */
.noimg { display: block; max-width: 100%; font-size: 0.8rem; line-height: 1.35; text-align: left; font-style: normal; font-weight: normal; }
.noimg--gallery { width: 100%; }
.noimg-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
  width: 100%; min-height: 4.5rem; max-height: 26rem; overflow: hidden;
  background: repeating-linear-gradient(135deg, var(--placeholder) 0 10px, #e6e9ed 10px 20px);
  border: 1px dashed #b7c0c9; border-radius: 4px; color: var(--placeholder-ink) !important; text-decoration: none !important;
}
.noimg--gallery .noimg-box { max-height: 11rem; }
.noimg-box:hover { border-color: var(--accent); color: var(--accent) !important; }
.noimg-icon svg { width: 2.2rem; height: 2.2rem; display: block; }
.noimg-label { font-weight: 650; font-size: 0.9rem; letter-spacing: 0.02em; }
.noimg-dim { font-size: 0.75rem; }
.noimg--deleted .noimg-box, .noimg--missing .noimg-box { background: repeating-linear-gradient(135deg, #fbeeed 0 10px, #f6e2e0 10px 20px); border-color: #e3aaa4; color: #b8746c !important; }
.noimg-meta { display: block; padding: 0.4rem 0.15rem 0.1rem; color: var(--muted); }
.noimg-meta > span { display: block; }
.noimg-name { color: var(--text); font-weight: 600; font-size: 0.85rem; overflow-wrap: anywhere; margin-bottom: 0.1rem; }
.noimg-line b { color: var(--text); font-weight: 600; }
.noimg-status { color: var(--red); font-weight: 600; }
.noimg-missing { display: inline-block; vertical-align: top; margin: 0.25rem 0; }
.noimg-caption { display: block; font-size: 0.85rem; padding: 0.2rem 0.15rem; }
.noimg-mini { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0 0.35rem; border: 1px dashed #b7c0c9; border-radius: 4px; background: var(--placeholder); color: var(--muted) !important; font-size: 0.8rem; white-space: nowrap; }
.noimg-mini-icon svg { width: 1rem; height: 1rem; display: block; }
td > .noimg, td > p > .noimg { margin: 0.2rem 0; }

/* Aus dem Webarchiv wiederhergestellte Bilder */
img.rec-img { max-width: 100%; height: auto; vertical-align: middle; }
.rec { display: block; max-width: 100%; font-size: 0.8rem; line-height: 1.35; }
.rec--thumb img.rec-img { display: block; border-radius: 3px; }
.rec--gallery { width: 100%; }
.rec--gallery .rec-box { display: flex; align-items: center; justify-content: center; height: 11rem; background: var(--bg); border-radius: 4px; overflow: hidden; }
.rec--gallery img.rec-img { max-height: 100%; width: auto; object-fit: contain; }
.rec-note { display: block; color: var(--muted); padding: 0.2rem 0.15rem 0; }
.rec-note--preview::before { content: "◐ "; color: #b7791f; }
.rec--file { margin: 0; flex: 0 1 auto; max-width: min(100%, 520px); }
.rec--file img.rec-img { display: block; border: 1px solid var(--line); border-radius: var(--radius); background: #f8f9fa; }
.rec--file figcaption { font-size: 0.85rem; color: var(--muted); padding-top: 0.35rem; }
.rec--file figcaption .rec-note { display: inline; padding: 0; }

/* DokuWiki-Nachfolger */
.notice--dw { border-color: #b9dcd8; background: #eef7f6; }
a.dwlink { color: #0f6e66; font-weight: 600; }
.dw-missing { border-bottom: 1px dotted #8a95a1; color: var(--muted); cursor: help; }
.dw-content table.inline { margin: 1em 0; border-collapse: collapse; background: #f9f9f9; font-size: 0.95rem; }
.dw-content table.inline th, .dw-content table.inline td { padding: 0.25em 0.5em; border: 1px solid #aaa; vertical-align: top; }
.dw-content table.inline th { background: #f2f2f2; }
.dw-content .centeralign { text-align: center; }
.dw-content .rightalign { text-align: right; }
.dw-content h1, .dw-content h2 { font-size: 1.45rem; padding-bottom: 0.2rem; border-bottom: 1px solid var(--line); }
.dw-content h5 { font-size: 1rem; margin: 1.2em 0 0.4em; }
.dw-content .toc ul { list-style: none; padding-left: 0; margin: 0; }
.dw-content .toc ul ul { padding-left: 1.2em; }
.dw-content .footnotes { margin-top: 2rem; padding-top: 0.5rem; border-top: 1px solid var(--line); font-size: 0.88rem; }
.dw-content .footnotes div.fn { margin: 0.2rem 0; }
.dw-img { display: inline-block; vertical-align: top; margin: 0.2rem 0.4rem 0.4rem 0; }
.dw-img img { border-radius: 3px; }
.dw-right { float: right; clear: right; margin: 0.3rem 0 0.8rem 1.2rem; }
.dw-left { float: left; clear: left; margin: 0.3rem 1.2rem 0.8rem 0; }
.dw-center { display: block; margin: 0.5rem auto; width: fit-content; }
.noimg--dw { display: inline-block; vertical-align: top; margin: 0.2rem 0.4rem 0.4rem 0; }
.noimg--dw.dw-right { float: right; margin: 0.3rem 0 0.8rem 1.2rem; }
.noimg--dw.dw-left { float: left; margin: 0.3rem 1.2rem 0.8rem 0; }
.noimg--dw.dw-center { display: block; margin: 0.5rem auto; }
.dw-video { display: inline-block; margin: 0.2rem 0; }
.origin { display: inline-block; font-size: 0.78rem; padding: 0 0.45rem; border-radius: 999px; white-space: nowrap; }
.origin--neu { background: #e3f1e7; color: #1d6b38; }
.origin--neugeschrieben { background: #e4eefb; color: #1d4f91; }
.origin--stark { background: #fdf0d9; color: #8a5a00; }
.origin--ueberarbeitet { background: #f1ecfa; color: #5b3da8; }
.origin--uebernommen { background: #eceff2; color: #4a5560; }
.small-note { font-size: 0.82rem; padding: 0 1rem 0.6rem; margin: 0; }
td.small, ul.small { font-size: 0.85rem; }

/* Dateiseite */
.file-head { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: 1rem; }
.file-head .noimg { flex: 0 0 auto; }
.file-facts { flex: 1 1 22rem; }

/* Links */
.redlink { color: var(--red); border-bottom: 1px dotted var(--red); cursor: help; }
a.archived { color: #0f6e66; border-bottom: 1px dashed #4aa39a; }
a.archived:hover { text-decoration: none; border-bottom-style: solid; }
a.external::after { content: "↗"; font-size: 0.75em; margin-left: 0.15em; color: var(--muted); }
.badge { display: inline-block; font-size: 0.72rem; padding: 0 0.4rem; border-radius: 999px; background: #fbe9d7; color: #8a4a12; vertical-align: 0.1em; }

/* Seiteninformationen */
.pageinfo { margin-top: 2.5rem; padding-top: 1rem; border-top: 2px solid var(--line); font-size: 0.92rem; }
.cats { margin-bottom: 1rem; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.cats-label { font-weight: 600; margin-right: 0.25rem; }
.chip { display: inline-block; background: var(--side); border: 1px solid var(--line); border-radius: 999px; padding: 0.05rem 0.65rem; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; }
.info-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 1rem; background: #fbfbfc; }
.info-box h2 { font-size: 0.95rem; margin: 0 0 0.5rem; }
.info-box ul { margin: 0; padding-left: 1.1rem; }
ul.cols { columns: 15rem auto; column-gap: 1.5rem; }
ul.cols li { break-inside: avoid; }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.3rem 1rem; margin: 0; }
dl.facts dt { font-weight: 600; color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
details.history { margin-top: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fbfbfc; }
details.history summary { cursor: pointer; padding: 0.6rem 1rem; font-weight: 600; }
details.history .table-wrap { padding: 0 1rem 1rem; }
.autocomment { color: var(--muted); }
abbr.minor { font-weight: 700; text-decoration: none; color: var(--muted); }

/* Tabellen der Verzeichnisse */
.table-wrap { overflow-x: auto; }
table.datatable { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
table.datatable th, table.datatable td { text-align: left; padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.datatable thead th { border-bottom: 2px solid var(--line); background: var(--side); white-space: nowrap; }
table.datatable td.num, table.datatable th.num { text-align: right; white-space: nowrap; }
table.datatable td.plus { color: #1a7f37; }
table.datatable td.minus { color: var(--red); }
table.facts-table th { width: 16rem; color: var(--muted); font-weight: 600; }

/* A–Z-Listen */
.letter-groups { columns: 16rem auto; column-gap: 2rem; }
.letter-group { break-inside: avoid; margin-bottom: 1rem; }
.letter-group h3 { margin: 0 0 0.2rem; font-size: 1rem; color: var(--accent); border-bottom: 1px solid var(--line-soft); }
.letter-group ul { list-style: none; margin: 0; padding: 0; }
ul.tree { list-style: none; padding-left: 1.1rem; margin: 0.2rem 0; }
.content > ul.tree { padding-left: 0; }
ul.tree li { margin: 0.1rem 0; }

/* Suche */
.search-page { display: flex; gap: 0.5rem; max-width: 36rem; margin-bottom: 1.25rem; }
.search-page input { background: var(--bg); color: var(--text); border-color: var(--line); font-size: 1rem; }
.search-page button { font: inherit; padding: 0.4rem 1rem; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
.result { padding: 0.6rem 0; border-bottom: 1px solid var(--line-soft); }
.result-title { font-weight: 600; font-size: 1.05rem; }
.result-ns { font-size: 0.75rem; color: var(--muted); margin-left: 0.4rem; text-transform: uppercase; letter-spacing: 0.05em; }
.result-snippet { font-size: 0.92rem; color: var(--muted); }
.result-snippet mark { background: #fff1a8; color: var(--text); }

/* Hauptseite */
body.mainpage .ns-label { display: none; }

/* Schmale Bildschirme */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; border-right: 0; border-bottom: 1px solid var(--line); }
  body.nav-open .sidebar { display: block; }
  .main { padding: 1rem 1rem 2rem; }
  .topbar { padding: 0.5rem 1rem; gap: 0.6rem; }
  .search { flex: 1 1 auto; }
  .brand span { display: none; }
  h1 { font-size: 1.55rem; }
  .thumb.tright, .thumb.tleft, .floatright, .floatleft, table[align="right"], table[align="left"] { float: none; margin: 0.5rem 0 1rem; }
  .thumbinner { width: auto !important; }
  .content .table-wrap, .content table { max-width: 100%; }
  .content table { display: block; overflow-x: auto; }
  dl.facts { grid-template-columns: minmax(0, 1fr); }
  dl.facts dd { margin-bottom: 0.4rem; }
}

@media print {
  .topbar, .sidebar, .footer, details.history { display: none; }
  .layout { display: block; }
  .main { padding: 0; max-width: none; }
}
