/* baeum (baeum.de) – warm, dicht, lesbar. Wikipedia-Typografie, Craigslist-Dichte. */

/* Schrift: Calibri, falls installiert; sonst Carlito (maßgleich, SIL OFL, selbst gehostet) */
@font-face { font-family: "Carlito"; src: local("Carlito"), url("carlito-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Carlito"; src: local("Carlito Bold"), url("carlito-bold.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Carlito"; src: local("Carlito Italic"), url("carlito-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --papier: #fbf6ee;
  --flaeche: #fffdf8;
  --flaeche-2: #f5ecdf;
  --tinte: #2f2620;
  --gedaempft: #75665a;
  --linie: #e3d5c2;
  --linie-stark: #cdb99f;
  --akzent: #b0512a;
  --akzent-dunkel: #8e3f1f;
  --akzent-hell: #f4e2d0;
  --link: #9b4520;
  --besucht: #7b4a66;
  --gruen: #5e7646;
  --fokus: #d9822b;
  --schatten: 0 1px 2px rgba(80, 50, 20, .08);
  --schrift: Calibri, "Carlito", "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: var(--schrift);   /* Überschriften ebenfalls Calibri */
  --sans: var(--schrift);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papier: #1d1814; --flaeche: #26201b; --flaeche-2: #2f2721;
    --tinte: #efe4d6; --gedaempft: #b3a291; --linie: #3d332b; --linie-stark: #57493d;
    --akzent: #e08a5c; --akzent-dunkel: #f0a67d; --akzent-hell: #3a2a20;
    --link: #eb9b6e; --besucht: #d4a3c3; --gruen: #a4bf86; --fokus: #f0a050;
    --schatten: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --papier: #1d1814; --flaeche: #26201b; --flaeche-2: #2f2721;
  --tinte: #efe4d6; --gedaempft: #b3a291; --linie: #3d332b; --linie-stark: #57493d;
  --akzent: #e08a5c; --akzent-dunkel: #f0a67d; --akzent-hell: #3a2a20;
  --link: #eb9b6e; --besucht: #d4a3c3; --gruen: #a4bf86; --fokus: #f0a050;
  --schatten: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--papier); color: var(--tinte);
  font: 16px/1.5 var(--sans);
  border-top: 4px solid var(--akzent);
}
a { color: var(--link); text-decoration: none; }
a:visited { color: var(--besucht); }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--fokus); outline-offset: 2px; border-radius: 2px; }

/* ---------- Kopf ---------- */
.kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem;
  flex-wrap: wrap; max-width: 76rem; margin: 0 auto; padding: 1rem 16px .75rem;
}
.marke { display: flex; align-items: center; gap: .6rem; color: var(--tinte); }
.marke:visited { color: var(--tinte); }
.marke:hover { text-decoration: none; }
.marke svg { width: 38px; height: 38px; flex: none; }
.marke-text { display: flex; flex-direction: column; line-height: 1.15; }
.marke-titel { font: 600 1.55rem/1.1 var(--serif); letter-spacing: .01em; }
.marke-unter { font-size: .8rem; color: var(--gedaempft); }

.suche { display: flex; flex: 1 1 22rem; max-width: 34rem; }
.suche input {
  flex: 1; min-width: 0; padding: .5rem .7rem; font: inherit; color: var(--tinte);
  background: var(--flaeche); border: 1px solid var(--linie-stark); border-right: 0;
  border-radius: 3px 0 0 3px;
}
.suche input::placeholder { color: var(--gedaempft); }
.suche button, .knopf {
  padding: .5rem 1rem; font: 600 .9rem var(--sans); color: #fff; cursor: pointer;
  background: var(--akzent); border: 1px solid var(--akzent); border-radius: 0 3px 3px 0;
}
.suche button:hover, .knopf:hover { background: var(--akzent-dunkel); border-color: var(--akzent-dunkel); }
:root[data-theme="dark"] .suche button, :root[data-theme="dark"] .knopf { color: #1d1814; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .suche button, :root:not([data-theme="light"]) .knopf { color: #1d1814; }
}
.knopf { border-radius: 3px; display: inline-block; }
.knopf:visited { color: #fff; }
.knopf.zart { background: transparent; color: var(--link); border-color: var(--linie-stark); }
.knopf.zart:hover { background: var(--akzent-hell); }

/* ---------- Rahmen ---------- */
.rahmen {
  display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); gap: 0 2rem;
  grid-template-areas: "leiste inhalt";
  max-width: 76rem; margin: 0 auto; padding: 0 16px 3rem;
}
.seitenleiste { grid-area: leiste; font-size: .88rem; padding-top: .4rem; }
.seitenleiste h2 {
  font: 600 .72rem/1.2 var(--sans); text-transform: uppercase; letter-spacing: .08em;
  color: var(--gedaempft); margin: 1.4rem 0 .5rem; border: 0; padding: 0;
}
.seitenleiste h2.name-klein { text-transform: none; letter-spacing: .02em; }   /* Marke immer klein */
.seitenleiste h2:first-child { margin-top: 0; }
.seitenleiste ul.nav { list-style: none; margin: 0; padding: 0; }
.seitenleiste ul.nav li { margin: .15rem 0; }

.inhalt {
  grid-area: inhalt;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 4px;
  padding: 1.4rem 1.8rem 2rem; box-shadow: var(--schatten); min-width: 0;
}

/* ---------- Typografie (Wikipedia) ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--tinte); }
h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 .2rem; }
h2 {
  font-size: 1.45rem; line-height: 1.3; margin: 1.8rem 0 .7rem;
  padding-bottom: .15rem; border-bottom: 1px solid var(--linie-stark);
}
h3 { font-size: 1.12rem; font-family: var(--sans); font-weight: 650; margin: 1.2rem 0 .4rem; }
.unterzeile { color: var(--gedaempft); margin: 0 0 1.2rem; font-size: .92rem; }
.hinweis { font-size: .85rem; color: var(--gedaempft); }
.zahl { color: var(--gedaempft); font-size: .82em; font-variant-numeric: tabular-nums; }

/* ---------- Stammbaum im Seitenrand (vertikal, oben -> unten) ---------- */
.ahnen { list-style: none; margin: 0; padding: 0; }
.ahnen li { position: relative; padding: 0 0 .55rem 1.05rem; }
.ahnen li::before {                 /* senkrechte Linie */
  content: ""; position: absolute; left: .3rem; top: .85rem; bottom: -.1rem;
  border-left: 1.5px solid var(--linie-stark);
}
.ahnen li::after {                  /* Knoten */
  content: ""; position: absolute; left: 0; top: .42rem; width: .62rem; height: .62rem;
  border-radius: 50%; background: var(--flaeche); border: 1.5px solid var(--linie-stark);
}
.ahnen li:last-child::before { display: none; }
.ahnen li.hier { font-weight: 650; }
.ahnen li.hier::after { background: var(--akzent); border-color: var(--akzent); }
.ahnen .ebene { display: block; font-size: .7rem; color: var(--gedaempft); line-height: 1.1; }

/* ---------- Stammbaum Startseite (Organigramm oben -> unten) ---------- */
.baum { text-align: center; margin: .5rem 0 1rem; overflow-x: auto; padding-bottom: .5rem; }
.baum ul { position: relative; display: flex; justify-content: center; margin: 0; padding: 1.4rem 0 0; list-style: none; }
.baum > ul { width: max-content; min-width: 100%; }   /* breit genug zum Scrollen, sonst zentriert */
.baum li { position: relative; padding: 1.4rem .5rem 0; display: flex; flex-direction: column; align-items: center; }
.baum > ul { padding-top: 0; }
.baum > ul > li { padding-top: 0; }
/* Verbinder: waagerecht über Geschwistern, senkrecht zum Knoten */
.baum li::before, .baum li::after {
  content: ""; position: absolute; top: 0; width: 50%; height: 1.4rem;
  border-top: 1.5px solid var(--linie-stark);
}
.baum li::before { right: 50%; }
.baum li::after { left: 50%; border-left: 1.5px solid var(--linie-stark); }
.baum li:only-child::before, .baum li:only-child::after { width: 0; border-top: 0; }
.baum li:only-child::after { left: 50%; }
.baum li:first-child::before, .baum li:last-child::after { border-top: 0; }
.baum li:last-child::before { border-right: 1.5px solid var(--linie-stark); }
.baum > ul > li::before, .baum > ul > li::after { display: none; }
.baum ul ul::before {
  content: ""; position: absolute; top: 0; left: 50%; height: 1.4rem;
  border-left: 1.5px solid var(--linie-stark);
}
.knoten {
  display: inline-block; padding: .45rem .9rem; background: var(--flaeche-2);
  border: 1px solid var(--linie-stark); border-radius: 4px; white-space: nowrap;
  font-family: var(--serif); font-size: 1.02rem; color: var(--tinte);
}
.knoten:visited { color: var(--tinte); }
.knoten .ebene { display: block; font: .68rem var(--sans); color: var(--gedaempft); text-transform: uppercase; letter-spacing: .07em; }
a.knoten:hover { border-color: var(--akzent); text-decoration: none; background: var(--akzent-hell); }
.knoten.blatt { background: var(--akzent-hell); border-color: var(--akzent); font-weight: 600; }

/* Gemeinden unter den Kreis-Knoten */
.kreis-spalten {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem 2rem;
  margin-top: .8rem;
}
.kreis-spalten h3 { margin-top: 0; font-family: var(--serif); font-weight: 500; font-size: 1.15rem; }

/* ---------- Craigslist-Listen ---------- */
.spalten { columns: 3 13rem; column-gap: 2rem; }
.spalten.eng { columns: 4 10rem; }
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { margin: 0 0 .2rem; break-inside: avoid; }
.block { break-inside: avoid; margin-bottom: 1.2rem; }
.block h3 { margin: 0 0 .3rem; font-size: .95rem; font-weight: 700; color: var(--akzent-dunkel); font-family: var(--sans); }
.block h3 a { color: inherit; }

/* Anbieterlisten */
.eintraege { list-style: none; margin: 0; padding: 0; }
.eintraege > li { padding: .35rem 0; border-bottom: 1px dotted var(--linie); }
.eintraege > li:last-child { border-bottom: 0; }
.eintrag-name { font-weight: 600; }
.eintrag-meta { color: var(--gedaempft); font-size: .84rem; }
.eintraege ul.kinder { list-style: none; margin: .25rem 0 0 .35rem; padding: 0 0 0 .9rem; border-left: 1.5px solid var(--linie-stark); font-size: .9rem; }
.eintraege ul.kinder li { padding: .1rem 0; }
.marke-typ {
  display: inline-block; font-size: .72rem; line-height: 1.3; padding: .05rem .4rem; margin-left: .25rem;
  border-radius: 999px; background: var(--flaeche-2); color: var(--gedaempft); border: 1px solid var(--linie);
  vertical-align: .1em; font-weight: 500;
}
.entfernung { color: var(--gruen); font-weight: 600; font-size: .84rem; font-variant-numeric: tabular-nums; }

/* ---------- Infobox (Anbieterseite) ---------- */
.infobox {
  float: right; width: 21rem; max-width: 100%; margin: 0 0 1rem 1.5rem; font-size: .88rem;
  border: 1px solid var(--linie-stark); background: var(--flaeche-2); border-collapse: collapse;
}
.infobox caption {
  caption-side: top; text-align: center; font: 600 1rem var(--serif); padding: .5rem;
  background: var(--akzent-hell); border: 1px solid var(--linie-stark); border-bottom: 0;
}
.infobox th, .infobox td { text-align: left; vertical-align: top; padding: .35rem .6rem; border-top: 1px solid var(--linie); }
.infobox th { width: 36%; font-weight: 600; color: var(--gedaempft); }
.infobox td { overflow-wrap: anywhere; }

.aktionen { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.zweige { list-style: none; margin: .3rem 0 0; padding: 0; }
.zweige li { position: relative; padding: .15rem 0 .15rem 1.2rem; }
.zweige li::before { content: ""; position: absolute; left: .35rem; top: 0; bottom: 0; border-left: 1.5px solid var(--linie-stark); }
.zweige li::after { content: ""; position: absolute; left: .35rem; top: .85rem; width: .6rem; border-top: 1.5px solid var(--linie-stark); }
.zweige li:last-child::before { bottom: calc(100% - .85rem); }
.klar { clear: both; }

/* ---------- Formulare ---------- */
.formular { max-width: 40rem; }
.feld { margin: 0 0 1rem; }
.feld label, .feld .legende { display: block; font-weight: 600; margin-bottom: .25rem; font-size: .92rem; }
.feld .hilfe { display: block; font-weight: 400; color: var(--gedaempft); font-size: .8rem; }
.feld input[type=text], .feld input[type=email], .feld input[type=url], .feld input[type=tel],
.feld select, .feld textarea {
  width: 100%; padding: .5rem .6rem; font: inherit; color: var(--tinte);
  background: var(--flaeche); border: 1px solid var(--linie-stark); border-radius: 3px;
}
.feld textarea { min-height: 5rem; resize: vertical; }
.zeile { display: grid; grid-template-columns: 7rem 1fr; gap: .8rem; align-items: end; }  /* Felder bündig, auch bei Hilfetext */
.zeile.halb { grid-template-columns: 1fr 1fr; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chips label {
  display: inline-flex; align-items: center; gap: .3rem; font-weight: 400; font-size: .85rem;
  padding: .2rem .6rem; border: 1px solid var(--linie-stark); border-radius: 999px; cursor: pointer;
  background: var(--flaeche); margin: 0;
}
.chips input { accent-color: var(--akzent); margin: 0; }
.chips label:has(input:checked) { background: var(--akzent-hell); border-color: var(--akzent); }
.pflicht { color: var(--akzent); }
.kasten {
  padding: .8rem 1rem; border-left: 3px solid var(--akzent); background: var(--akzent-hell);
  border-radius: 0 3px 3px 0; font-size: .9rem; margin: 0 0 1.2rem;
}
.fehlerliste { color: var(--akzent-dunkel); font-weight: 600; }
.versteckt { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Suchergebnis-Filter */
.filter { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: end; margin: 0 0 1.2rem;
          padding: .8rem 1rem; background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 4px; }
.filter .feld { margin: 0; }
.filter .feld.breit { flex: 1 1 14rem; }

/* ---------- Fuß ---------- */
.fuss { max-width: 76rem; margin: 0 auto; padding: 0 16px 2rem 16px; font-size: .8rem; color: var(--gedaempft); }
.fuss p { margin: .3rem 0; }
.fuss a { color: var(--gedaempft); text-decoration: underline; }
.themawahl { background: none; border: 0; color: var(--gedaempft); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

/* ---------- schmal ---------- */
@media (max-width: 760px) {
  .rahmen { grid-template-columns: minmax(0, 1fr); grid-template-areas: "inhalt" "leiste"; }
  .seitenleiste { margin-top: 1.5rem; }
  .inhalt { padding: 1rem 1rem 1.5rem; }
  h1 { font-size: 1.6rem; }
  .infobox { float: none; width: 100%; margin: 0 0 1rem; }
  .zeile { grid-template-columns: 1fr; gap: 0; }
  .kopf { padding-top: .8rem; }
  .suche { flex-basis: 100%; max-width: none; }
  .knoten { white-space: normal; max-width: 10.5rem; font-size: .95rem; padding: .4rem .6rem; }
  .baum li { padding-left: .25rem; padding-right: .25rem; }
}
