/* LoMo-Expedition – Farben wie das Original (Dunkelblau, helle Links), lesbar auf jedem Gerät. */
:root {
  --bg: #000a8c;
  --panel: #000060;
  --panel-2: #00007a;
  --text: #f0f0f0;
  --link: #80ffff;
  --visited: #c0ffff;
  --hover: #ffd54a;
  --breite: 1150px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.05rem/1.65 Georgia, "Times New Roman", serif;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); }
a:visited { color: var(--visited); }
a:hover, a:focus { color: var(--hover); }
:focus-visible { outline: 3px solid var(--hover); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--hover); color: #000; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* Kopf */
.site-header {
  background: var(--panel);
  padding: 1rem 1.25rem .75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
}
.brand { text-decoration: none; color: #fff !important; display: block; }
.brand .title { display: block; font-size: clamp(1.6rem, 4.5vw, 2.6rem); font-weight: bold; line-height: 1.1; text-shadow: 3px 2px 0 #000; }
.brand .subtitle { display: block; font-size: clamp(1rem, 2.5vw, 1.25rem); font-weight: bold; text-shadow: 2px 1px 0 #000; }
.langs { display: flex; flex-wrap: wrap; gap: .25rem .75rem; font-family: Arial, sans-serif; font-size: .95rem; }
.langs a { text-decoration: none; padding: .2rem .4rem; border-radius: 4px; }
.langs a[aria-current] { background: var(--link); color: var(--panel); font-weight: bold; }

/* Menü + Inhalt */
.layout {
  max-width: var(--breite);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.25rem;
  align-items: start;
}
.menu { background: var(--panel); border-radius: 8px; position: sticky; top: 1rem; }
.menu summary { display: none; }
.menu ul { list-style: none; margin: 0; padding: .5rem; }
.menu a {
  display: block;
  padding: .5rem .75rem;
  border-radius: 6px;
  font: bold 1rem/1.3 Arial, sans-serif;
  text-decoration: none;
}
.menu a:hover { background: var(--panel-2); }
.menu a[aria-current] { background: var(--link); color: var(--panel); }

main { min-width: 0; }
main h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2; margin: .25rem 0 1rem; text-align: center; }
main h2 { font-size: clamp(1.25rem, 3vw, 1.55rem); line-height: 1.3; margin: 2rem 0 .75rem; text-align: center; }
main h3 { font-size: 1.2rem; }
main p { max-width: 75ch; margin-left: auto; margin-right: auto; }
main p[align="center"] { text-align: center; }
main pre { white-space: pre-wrap; }
main ul, main ol { max-width: 75ch; margin-left: auto; margin-right: auto; }
.content-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.content-table td, .content-table th { padding: .4rem .6rem; vertical-align: top; }
.content-table tr + tr td { border-top: 1px solid rgba(255,255,255,.15); }

/* Kapitel-Übersicht bei langen Seiten */
.toc { background: var(--panel); border-radius: 8px; padding: .75rem 1rem; margin: 1rem 0 1.5rem; }
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem .5rem; max-width: none; }
.toc a { display: inline-block; padding: .2rem .55rem; border: 1px solid rgba(128,255,255,.4); border-radius: 999px; font: .9rem/1.4 Arial, sans-serif; text-decoration: none; }
.totop { text-align: right; font: .9rem Arial, sans-serif; margin: 1.5rem 0 0 !important; max-width: none !important; }
.back { font-family: Arial, sans-serif; }

/* Galerie */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}
.gallery figure { margin: 0; text-align: center; font: .85rem/1.35 Arial, sans-serif; }
.gallery figure a { display: block; text-decoration: none; }
.gallery img { display: block; margin: 0 auto .35rem; border: 2px solid var(--panel); border-radius: 4px; }
.gallery figcaption { color: var(--text); }

.dead { color: #b8b8d8; text-decoration: line-through; text-decoration-thickness: 1px; }
.notice { background: var(--panel); border-left: 4px solid var(--hover); padding: .75rem 1rem; border-radius: 4px; }

.site-footer {
  background: var(--panel);
  padding: .75rem 1.25rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem;
  font: .85rem Arial, sans-serif;
}

/* Handy und Tablet: Menü zum Aufklappen */
@media (max-width: 899px) {
  .layout { grid-template-columns: 1fr; padding: .75rem; gap: .75rem; }
  .menu { position: static; }
  .menu summary {
    display: block;
    cursor: pointer;
    padding: .75rem 1rem;
    font: bold 1.05rem Arial, sans-serif;
    list-style: none;
  }
  .menu summary::-webkit-details-marker { display: none; }
  .menu summary::before { content: "☰  "; }
  .menu[open] summary::before { content: "✕  "; }
  .menu ul { display: grid; grid-template-columns: 1fr 1fr; padding-top: 0; }
  .content-table, .content-table tbody, .content-table thead, .content-table tr, .content-table td, .content-table th { display: block; width: 100%; text-align: left; }
  .content-table td, .content-table th { padding: .15rem 0; }
  .content-table tr { padding: .5rem 0; }
  .content-table tr + tr td { border-top: 0; }
  .content-table tr + tr { border-top: 1px solid rgba(255,255,255,.25); }
  main p[align="justify"], main [align="justify"] { text-align: left; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; }
}

/* ---------- Bildansicht */
.lightbox {
  border: 0; padding: 0; margin: auto;
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  background: rgba(0, 0, 20, .94); color: #fff;
}
.lightbox::backdrop { background: rgba(0, 0, 20, .8); }
.lightbox figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3.5rem 3.5rem 1rem; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 8rem); object-fit: contain; border-radius: 4px; }
.lightbox figcaption { margin-top: .75rem; font: 1rem/1.4 Arial, sans-serif; text-align: center; max-width: 60ch; }
.lb-count { color: #b8c0ff; white-space: nowrap; }
.lightbox button {
  position: absolute; border: 0; cursor: pointer;
  background: rgba(255,255,255,.12); color: #fff;
  font: 2rem/1 Arial, sans-serif; width: 3rem; height: 3rem; border-radius: 50%;
}
.lightbox button:hover, .lightbox button:focus-visible { background: rgba(255,255,255,.3); }
.lb-prev { left: .5rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: .5rem; top: 50%; transform: translateY(-50%); }
.lb-close { right: .5rem; top: .5rem; font-size: 1.4rem !important; }
@media (max-width: 600px) {
  .lightbox figure { padding: 3.5rem .5rem 5rem; }
  .lb-prev, .lb-next { top: auto; bottom: 1rem; transform: none; }
  .lb-prev { left: 25%; } .lb-next { right: 25%; }
}

/* ---------- Kapitelleiste */
.chapterbar {
  position: fixed; left: 50%; bottom: 1rem; transform: translate(-50%, 150%);
  display: flex; align-items: stretch; gap: .25rem;
  background: var(--panel); border: 1px solid rgba(128,255,255,.35); border-radius: 999px;
  padding: .3rem; box-shadow: 0 6px 20px rgba(0,0,0,.45);
  font-family: Arial, sans-serif; z-index: 20; max-width: calc(100vw - 1.5rem);
  transition: transform .25s ease;
}
.chapterbar.visible { transform: translate(-50%, 0); }
.chapterbar button {
  border: 0; background: transparent; color: var(--link); cursor: pointer;
  font: 1.6rem/1 Arial, sans-serif; width: 2.75rem; border-radius: 999px;
}
.chapterbar button:hover, .chapterbar button:focus-visible { background: var(--panel-2); }
.cb-toc { text-decoration: none; padding: .2rem .75rem; text-align: center; min-width: 10rem; overflow: hidden; }
.cb-label { display: block; font-size: .72rem; color: #b8c0ff; }
.cb-name { display: block; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toc a[aria-current] { background: var(--link); color: var(--panel); }
@media (prefers-reduced-motion: reduce) { .chapterbar { transition: none; } }

/* ---------- Vor/Zurück zwischen Artikeln */
.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 2.5rem 0 1rem; font-family: Arial, sans-serif; }
.pager a { display: inline-block; padding: .5rem .9rem; background: var(--panel); border-radius: 6px; text-decoration: none; }
.pager .next { margin-left: auto; }
main { padding-bottom: 4rem; }

/* Footer immer am unteren Rand, auch bei kurzen Seiten */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.layout { flex: 1 0 auto; width: 100%; }
.site-header, .site-footer { flex-shrink: 0; }
