/* ── Pico Overrides ───────────────────────────────────────────────────────── */
:root {
  --pico-font-size: 106%;
  --pico-primary: #2E6B8A;
  --pico-primary-hover: #1C3A4A;
  --pico-primary-focus: rgba(46, 107, 138, 0.25);
  --pico-primary-inverse: #fff;
  --pico-color: #222222;
  --pico-background-color: #ffffff;
  --pico-h1-color: #1C3A4A;
  --pico-h2-color: #1C3A4A;
  --pico-h3-color: #2E6B8A;
  color-scheme: light only;
}

/* ── Allgemein ────────────────────────────────────────────────────────────── */
body { background: #ffffff; color: #222222; }
.subtitle, .tagline { margin-bottom: 0.5rem; }
.tagline { margin-top: 0; }
figure img { width: 100%; height: auto; display: block; border-radius: 0.5rem; }

.site-footer {
  border-top: 1px solid #ddd;
  margin-top: 3rem;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}
.site-footer nav ul li a { color: #2E6B8A; }
nav strong a { color: #1C3A4A !important; }

/* ── Download-Box ─────────────────────────────────────────────────────────── */
.download-box {
  background: #F0F5F8;
  border-left: 4px solid #2E6B8A;
  padding: 1.2rem 1.5rem;
  border-radius: 0 0.5rem 0.5rem 0;
  margin: 1.5rem 0;
}
.download-box h3 { margin-bottom: 0.4rem; color: #1C3A4A; }
.download-box p { margin-bottom: 0.8rem; font-size: 0.95em; color: #444; }

/* ── Buchbereich — responsiv ──────────────────────────────────────────────── */
.buch-section {
  display: flex;
  gap: 3.5rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}
.buch-cover {
  flex: 0 0 clamp(200px, 25vw, 320px);
  max-width: 320px;
}
.buch-cover img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 2px 4px 12px rgba(0,0,0,0.18);
}
.buch-cover-placeholder {
  width: 100%;
  aspect-ratio: 9 / 14;
  max-width: 240px;
  background: #C8DDE8;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1C3A4A;
  font-size: 12px;
  text-align: center;
  padding: 10px;
  box-shadow: 2px 4px 12px rgba(0,0,0,0.12);
}
.buch-text { flex: 1; min-width: 0; }
.buch-meta { font-size: 0.9rem; color: #666; margin-bottom: 1.2rem; }

/* ── Dark Mode Startseite ─────────────────────────────────────────────────── */
body.dark-page {
  background: #0f1e28;
  color: #d4e6f1;
  color-scheme: dark;
}
body.dark-page h1,
body.dark-page h2,
body.dark-page h3 { color: #8ecae6; }
body.dark-page header {
  background: #0f1e28;
  border-bottom: 1px solid #2E6B8A;
}
body.dark-page h2#prolog,
body.dark-page h2#inhalt,
body.dark-page h2#quellen-buch,
body.dark-page h2#ansatz,
body.dark-page h2#angaben,
body.dark-page h2#taschenbuch {
  margin-top: .75em;
}
main.container > div:nth-child(1) > section:nth-child(2) > h2:nth-child(1) {
  margin-top: .75em;
}
body.dark-page a#leseprobe,
body.dark-page a#vertiefung,
body.dark-page a#quellen,
body.dark-page a#methodik {
  text-underline-offset: .25em;
}
body.dark-page nav strong a { color: #8ecae6 !important; }
body.dark-page .nav-toggle span { background: #8ecae6; }
body.dark-page .nav-menu { background: #1a2f3e; border-color: #2E6B8A; }
body.dark-page .nav-menu li a { color: #8ecae6; }
body.dark-page .nav-menu li a:hover { background: #2E6B8A; color: #fff; }
body.dark-page header nav > ul:last-child a { color: #8ecae6; }
body.dark-page .buch-cover-placeholder { background: #1C3A4A; color: #8ecae6; }
body.dark-page .site-footer { border-color: #2E6B8A; color: #8ecae6; }
body.dark-page .site-footer nav ul li a { color: #8ecae6; }
body.dark-page p, body.dark-page li { color: #d4e6f1; }
body.dark-page a { color: #8ecae6; }

/* ── Navigation Desktop ───────────────────────────────────────────────────── */
header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
}
header nav > ul:first-child { flex: 1; margin: 0; padding: 0; list-style: none; }
header nav > ul:last-child { display: flex; gap: 1.2rem; margin: 0; padding: 0; list-style: none; }

/* ── Hamburger-Button ─────────────────────────────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #1C3A4A;
  border-radius: 2px;
  transition: all 0.25s ease;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  header nav {
    flex-wrap: wrap;
    position: relative;
  }
  header nav > ul:first-child { flex: 1; }
  header nav > ul:last-child { display: none; }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: #ffffff;
    border: 1px solid #ddd;
    border-top: 2px solid #2E6B8A;
    border-radius: 0 0 4px 4px;
    z-index: 100;
    padding: 0.5rem 0;
    list-style: none;
    margin: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  .nav-menu.nav-open { display: block; }
  .nav-menu li { border-bottom: 1px solid #f0f0f0; }
  .nav-menu li:last-child { border-bottom: none; }
  .nav-menu li a {
    display: block;
    padding: 0.7rem 1.2rem;
    color: #1C3A4A;
    font-size: 0.95rem;
    text-decoration: none;
    text-align: left;
  }
  .nav-menu li a:hover { background: #F0F5F8; }

  .buch-section { flex-direction: column; align-items: center; }
  .buch-cover { max-width: 200px; width: 100%; }
  .buch-text { width: 100%; }
}

/* ── Cover Mobile größer ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .buch-cover,
  .buch-cover-placeholder {
    max-width: 340px;
    width: 85vw;
  }
}

/* ── Download-Box dunkel auf dark-page ────────────────────────────────────── */
body.dark-page .download-box {
  background: #1a2f3e;
  border-left-color: #2E6B8A;
  color: #d4e6f1;
}
body.dark-page .download-box h3 { color: #8ecae6; }
body.dark-page .download-box p { color: #b8d4e8; }

/* ── Dunkler Header/Footer auf hellen Quellenapparat-Seiten ───────────────── */
header.dark-header {
  background: #0f1e28;
  border-bottom: 1px solid #2E6B8A;
}
header.dark-header nav strong a { color: #8ecae6 !important; }
header.dark-header nav ul li a { color: #8ecae6; }
header.dark-header .nav-toggle span { background: #8ecae6; }
header.dark-header .nav-menu {
  background: #1a2f3e;
  border-color: #2E6B8A;
}
header.dark-header .nav-menu li a { color: #8ecae6; }
header.dark-header .nav-menu li a:hover { background: #2E6B8A; color: #fff; }

/* Footer Quellenapparat — dunkel, kein Pico-nav-Rahmen */
.quellenapparat-footer {
  background: #0f1e28;
  border-top: 1px solid #2E6B8A;
  margin-top: 2rem;
  padding: 1rem 0;
}
.quellenapparat-footer nav { background: none; border: none; padding: 0; }
.quellenapparat-footer nav ul { display: flex; gap: 1.5rem; list-style: none; padding: 0; margin: 0; }
.quellenapparat-footer nav ul li a { color: #8ecae6; font-size: 0.9rem; }
.quellenapparat-footer p { color: #8ecae6; font-size: 0.8rem; margin-top: 0.5rem; }

/* ── Kaufen-Seite Grid mobile ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .kaufen-grid { grid-template-columns: 1fr !important; }
}

/* ── Dunkle Sections und Headings auf dark-page ───────────────────────────── */
body.dark-page section {
  background: transparent;
}
body.dark-page article h1 { color: #8ecae6; }
body.dark-page article h2 { color: #8ecae6; }
body.dark-page h1 { color: #8ecae6; }
body.dark-page h2 { color: #8ecae6; }
body.dark-page h3 { color: #8ecae6; }

/* ── Browser-Default article/section Hintergrund entfernen ───────────────── */
body.dark-page div[aria-labelledby],
body.dark-page div.grid > div {
  background: transparent !important;
}

body.dark-page address {
  color: #d4e6f1;
}