/* BK57 – Breitkopfstraße 5–7, Leipzig
   Keine externen Ressourcen (Schriften, Skripte, Karten) – datenschutzfreundlich. */

:root {
  --paper: #f5f0e6;
  --paper-2: #ece4d4;
  --ink: #2a2520;
  --ink-soft: #5c5348;
  --brick: #8c3b27;
  --olive: #6f6a2e;
  --line: #d6cbb6;
  --card: #fbf8f2;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1d1a16;
    --paper-2: #26221d;
    --ink: #ece5d8;
    --ink-soft: #b5aa98;
    --brick: #d9876c;
    --olive: #c2bb78;
    --line: #3a342c;
    --card: #24201b;
  }
  .engraving img { filter: brightness(.92); }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(17px, 1.05vw + 12px, 19px);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brick); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }

/* ---------- Kopf ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: baseline; gap: .55em; text-decoration: none; color: var(--ink); }
.brand b { font-size: 1.35rem; letter-spacing: .08em; color: var(--brick); }
.brand span { font-family: var(--sans); font-size: .78rem; color: var(--ink-soft); letter-spacing: .02em; }
.nav { display: flex; gap: clamp(10px, 2vw, 26px); font-family: var(--sans); font-size: .86rem; }
.nav a { color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover { border-color: var(--brick); }
.nav a.key { color: var(--brick); }
.nav-toggle { display: none; }

@media (max-width: 820px) {
  .brand span { display: none; }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: none; border: 1px solid var(--line); border-radius: 6px;
    font: inherit; font-family: var(--sans); font-size: .85rem; color: var(--ink);
    padding: 6px 10px; cursor: pointer;
  }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; background: var(--paper);
    border-bottom: 1px solid var(--line); padding: 6px var(--gutter) 14px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 10px 0; border-bottom: 1px solid var(--line); }
}

/* ---------- Hero ---------- */
.hero { position: relative; min-height: min(78vh, 760px); display: grid; align-items: end; color: #fff; overflow: hidden; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,14,8,.05) 30%, rgba(20,14,8,.72) 100%); }
.hero .wrap { position: relative; z-index: 1; padding-bottom: clamp(28px, 6vh, 64px); }
.eyebrow { font-family: var(--sans); text-transform: uppercase; letter-spacing: .16em; font-size: .74rem; margin: 0 0 .6em; opacity: .9; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4.6rem); line-height: 1.04; margin: 0; font-weight: 400; letter-spacing: .01em; }
.hero p.sub { font-size: clamp(1.02rem, 1.6vw, 1.3rem); max-width: 40em; margin: .7em 0 0; font-style: italic; }

/* ---------- Abschnitte ---------- */
section { padding: clamp(56px, 9vw, 110px) 0; }
section + section { border-top: 1px solid var(--line); }
section.alt { background: var(--paper-2); }
h2 { font-size: clamp(1.75rem, 3.3vw, 2.6rem); font-weight: 400; line-height: 1.15; margin: 0 0 .6em; }
h2 small { display: block; font-family: var(--sans); font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--olive); margin-bottom: .7em; }
h3 { font-size: 1.2rem; font-weight: 600; margin: 1.6em 0 .4em; }
p { margin: 0 0 1em; }
.lead { font-size: 1.16em; color: var(--ink); }
.muted { color: var(--ink-soft); }
.note { font-family: var(--sans); font-size: .82rem; color: var(--ink-soft); }

.two { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }

.facts { margin: 0; padding: 22px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; }
.facts div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px dotted var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { font-family: var(--sans); font-size: .8rem; color: var(--ink-soft); padding-top: .2em; }
.facts dd { margin: 0; }
@media (max-width: 420px) { .facts div { grid-template-columns: 1fr; gap: 0; } }

blockquote {
  margin: 2em 0; padding: 0 0 0 1.2em; border-left: 2px solid var(--brick);
  font-style: italic; font-size: 1.12em; color: var(--ink);
}
blockquote cite { display: block; margin-top: .5em; font-style: normal; font-family: var(--sans); font-size: .78rem; color: var(--ink-soft); }

/* ---------- Zeitleiste ---------- */
.timeline { list-style: none; margin: 2em 0 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 4.6em; top: .5em; bottom: .5em; width: 1px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 4.2em 1fr; gap: 1.6em; padding: .55em 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: calc(4.6em - 4px); top: 1.15em; width: 9px; height: 9px; border-radius: 50%; background: var(--paper-2); border: 2px solid var(--brick); }
.timeline .y { font-variant-numeric: oldstyle-nums; color: var(--brick); font-size: 1.06em; text-align: right; }
.timeline li.gap .y { color: var(--ink-soft); }
.timeline li.gap::before { border-style: dashed; border-color: var(--ink-soft); }

/* ---------- Porträts ---------- */
.portraits { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 1.2em; }

/* ---------- Galerie ---------- */
figure { margin: 0; }
figcaption { font-family: var(--sans); font-size: .8rem; color: var(--ink-soft); padding-top: .55em; line-height: 1.4; }
.gallery { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 2em; }
.gallery a { display: block; overflow: hidden; border-radius: 3px; background: var(--card); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s ease; }
.gallery a:hover img { transform: scale(1.03); }
.engraving a { background: #efe9dd; border: 1px solid var(--line); }
.engraving img { object-fit: contain; padding: 6px; }
.gallery .tall img { aspect-ratio: 3 / 4; }
.gallery.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .gallery.four { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.feature { margin-top: 2.2em; }
.feature img { width: 100%; border-radius: 3px; }

.wide-photo { margin: 2.4em 0 0; }
.wide-photo img { width: 100%; border-radius: 3px; }

/* ---------- Karte / Lage ---------- */
.address { font-size: 1.15em; line-height: 1.5; margin: 0 0 1em; font-style: normal; }
.btn {
  display: inline-block; font-family: var(--sans); font-size: .9rem; text-decoration: none;
  padding: 11px 18px; border-radius: 4px; border: 1px solid var(--brick); color: var(--brick);
}
.btn:hover { background: var(--brick); color: var(--paper); }
.btn.solid { background: var(--brick); color: var(--paper); }
.btn.solid:hover { filter: brightness(1.1); }

/* ---------- Eigentümer-Teaser ---------- */
.owners { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; padding: 28px; border: 1px solid var(--line); background: var(--card); border-radius: 4px; }
.owners p { margin: 0; max-width: 38em; }

/* ---------- Dokumentliste (Eigentümerbereich) ---------- */
.doclist { list-style: none; padding: 0; margin: 1em 0 2em; border-top: 1px solid var(--line); }
.doclist li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.doclist .meta { font-family: var(--sans); font-size: .8rem; color: var(--ink-soft); white-space: nowrap; }
.placeholder { color: var(--ink-soft); font-style: italic; }

/* ---------- Fuß ---------- */
.site-footer { background: #2a2520; color: #d9d0bf; padding: 44px 0; font-family: var(--sans); font-size: .85rem; }
.site-footer a { color: #f0c9b8; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 40px; }
.site-footer p { margin: 0 0 .4em; }

/* ---------- Lightbox (Bildansicht mit Blättern und Diashow) ---------- */
dialog.lightbox {
  border: 0; padding: 0; margin: 0; background: rgba(15,11,7,.7); color: #e8e0d2;
  width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh;
  display: none; grid-template-rows: 1fr auto; overflow: hidden;
}
dialog.lightbox[open] { display: grid; }
dialog.lightbox::backdrop { background: rgba(15,11,7,.92); }
.lb-stage { display: flex; align-items: center; justify-content: center; min-height: 0; padding: 56px 64px 8px; }
.lb-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transition: opacity .25s ease; }
dialog.lightbox.loading .lb-stage img { opacity: .35; }
.lb-bar {
  display: grid; grid-template-columns: 5em 1fr auto; align-items: center; gap: 12px;
  padding: 10px 20px 18px; font-family: var(--sans); font-size: .85rem;
}
.lb-count { opacity: .75; font-variant-numeric: tabular-nums; }
.lb-cap { margin: 0; text-align: center; }
dialog.lightbox button {
  font-family: var(--sans); color: #fff; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18); border-radius: 4px; cursor: pointer;
}
dialog.lightbox button:hover, dialog.lightbox button:focus-visible { background: rgba(255,255,255,.2); }
dialog.lightbox button[hidden] { display: none; }
.lb-close { position: absolute; top: 12px; right: 16px; width: 40px; height: 40px; font-size: 1.6rem; line-height: 1; }
.lb-prev, .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 72px; font-size: 2.2rem; line-height: 1;
}
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
.lb-play { padding: 7px 12px; font-size: .82rem; white-space: nowrap; }
dialog.lightbox.playing .lb-play { background: var(--brick); border-color: var(--brick); }
@media (max-width: 640px) {
  .lb-stage { padding: 56px 8px 4px; }
  .lb-prev, .lb-next { top: auto; bottom: 64px; transform: none; width: 44px; height: 44px; font-size: 1.8rem; }
  .lb-bar { grid-template-columns: auto 1fr auto; padding: 8px 12px 14px; }
}

/* ---------- Unterseiten ---------- */
.page { padding: clamp(40px, 7vw, 80px) 0; }
.page h1 { font-weight: 400; font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0 0 .6em; }
.page h2 { font-size: 1.35rem; margin-top: 1.6em; }
