/* HE Gruppe – gemeinsames Stylesheet
   Designvariablen zentral in :root. Schrift: Nunito Sans (SIL Open Font License, siehe
   assets/fonts/OFL.txt), lokal eingebunden – keine Verbindung zu Google. Fallback: Systemschrift. */

@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/NunitoSans-VariableFont.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --he-red: #C8102E;
  --he-red-dark: #9F0C24;
  --he-ink: #1A1A1A;
  --he-muted: #575754;
  --he-line: #E3E3E0;
  --he-surface: #F5F5F3;
  --he-placeholder: #E8E8E5;
  --he-white: #FFFFFF;
  --he-error: #B00E28;
  --he-radius: 4px;
  --he-section: clamp(64px, 8vw, 112px);
  --he-wrap: 1280px;
  --he-font: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--he-font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--he-ink);
  background: var(--he-white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--he-red); }
a:hover { color: var(--he-red-dark); }
:focus-visible { outline: 3px solid var(--he-red); outline-offset: 3px; }
/* Überschriften, die nur per Skript fokussiert werden (Nachladen, Formular-Erfolg): kein Rahmen */
[tabindex="-1"]:focus { outline: none; }
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 10px 16px; background: var(--he-white); color: var(--he-ink);
  font-weight: 700; border: 2px solid var(--he-red); border-radius: var(--he-radius);
}
.skip-link:focus { top: 16px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--he-wrap); margin: 0 auto; padding: 0 24px; }
.sec { padding: var(--he-section) 0; }
.alt { background: var(--he-surface); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 5vw, 80px); align-items: center; }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.start { align-items: start; }
@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  body { font-size: 16px; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Typografie ---------- */
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--he-red); margin: 0; }
.h1 { font-size: clamp(36px, 5vw, 62px); line-height: 1.06; font-weight: 800; letter-spacing: -.015em; margin: 0; }
@media (max-width: 359px) { .h1 { font-size: 30px; overflow-wrap: break-word; } } /* lange Wörter auf sehr kleinen Handys */
.h2 { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.14; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.h3 { font-size: 21px; line-height: 1.3; font-weight: 700; margin: 0; }
.lead { font-size: clamp(18px, 1.5vw, 20px); line-height: 1.6; color: var(--he-muted); margin: 0; max-width: 64ch; }
.lead strong { color: var(--he-ink); }
.lead--full { max-width: none; }
.txt { margin: 0; color: var(--he-muted); }
.small { font-size: 14px; line-height: 1.5; color: var(--he-muted); margin: 0; }
.strong-ink { font-weight: 700; color: var(--he-ink); }

/* ---------- Buttons & Links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 26px; border-radius: var(--he-radius);
  border: 2px solid var(--he-red); background: var(--he-red); color: var(--he-white);
  font: 700 16px/1.2 var(--he-font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--he-red-dark); border-color: var(--he-red-dark); color: var(--he-white); }
.btn-o { background: var(--he-white); color: var(--he-red); }
.btn-o:hover { background: var(--he-red); border-color: var(--he-red); color: var(--he-white); }
.btn-sm { min-height: 44px; padding: 8px 16px; font-size: 15px; }
/* Handy: lange Beschriftungen umbrechen, damit kein Button breiter als der Bildschirm wird */
@media (max-width: 760px) {
  .btn { max-width: 100%; padding-inline: 20px; white-space: normal; text-align: center; text-wrap: balance; }
  .btn-sm { padding-inline: 16px; }
}
.btn svg, .link svg { flex: none; }
.link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700;
  color: var(--he-ink); text-decoration: underline; text-decoration-color: var(--he-red);
  text-decoration-thickness: 2px; text-underline-offset: 6px;
}
.link:hover { color: var(--he-red); }
.self-start { align-self: flex-start; }

/* ---------- Filter, Formular ---------- */
.chip {
  min-height: 44px; padding: 8px 20px; border-radius: 999px; border: 1px solid #BDBDB8;
  background: var(--he-white); color: var(--he-ink); font: 600 15px/1 var(--he-font); cursor: pointer;
}
.chip:hover { border-color: var(--he-ink); }
.chip[aria-pressed="true"] { background: var(--he-ink); border-color: var(--he-ink); color: var(--he-white); }
.chip--remove { display: inline-flex; align-items: center; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 15px; font-weight: 700; }
.req { color: var(--he-red); }
.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #8C8C88;
  border-radius: var(--he-radius); background: var(--he-white); color: var(--he-ink);
  font: 400 16px/1.4 var(--he-font);
}
/* Dropdowns: eigener Pfeil statt Browser-Darstellung (Safari und Chrome zeigen sie sonst sehr unterschiedlich) */
select.input {
  -webkit-appearance: none; appearance: none; padding-right: 48px; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231A1A1A' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 20px 20px;
}
.input:hover { border-color: var(--he-ink); }
.input[aria-invalid="true"] { border: 2px solid var(--he-red); }
textarea.input { min-height: 160px; resize: vertical; }
.err { font-size: 14px; font-weight: 700; color: var(--he-error); margin: 0; }

/* ---------- Kennzeichnungen ---------- */
.tag {
  display: inline-flex; align-items: center; align-self: flex-start; font-size: 12px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; padding: 5px 10px; border-radius: 2px;
  background: var(--he-ink); color: var(--he-white);
}
.tag-r { background: var(--he-red); }
.tag-o { background: var(--he-white); color: var(--he-ink); border: 1px solid var(--he-ink); }
.flag {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; line-height: 1.4;
  padding: 6px 12px; border-radius: 2px; background: #FFF3CD; color: #5C4300; border: 1px dashed #C9A227; margin: 0;
}
.ph {
  background: var(--he-placeholder); color: var(--he-muted); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; text-align: center;
  font-size: 14px; font-weight: 600; padding: 16px; border-radius: var(--he-radius);
}
.ratio-43 { aspect-ratio: 4 / 3; }
.ratio-11 { aspect-ratio: 1 / 1; }
.media { display: block; width: 100%; height: auto; border-radius: var(--he-radius); background: var(--he-placeholder); }

/* ---------- Header ---------- */
.site-header { background: var(--he-white); border-bottom: 1px solid var(--he-line); }
.bar {
  max-width: var(--he-wrap); margin: 0 auto; padding: 16px 24px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 40px;
}
.brand { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; text-decoration: none; color: var(--he-ink); }
.brand img { width: 58px; height: 56px; flex: none; }
.brand__claim { font-size: 15px; font-weight: 600; color: var(--he-muted); }
.bar__right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 22px; }
.nav-list a {
  display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; font-weight: 600;
  color: var(--he-ink); text-decoration: none; border-bottom: 2px solid transparent;
}
.nav-list a:hover { color: var(--he-red); }
.nav-list a[aria-current="page"] { font-weight: 800; color: var(--he-red); border-bottom-color: var(--he-red); }
.icon-links { list-style: none; margin: 0; padding: 0 0 0 14px; display: flex; gap: 2px; border-left: 1px solid var(--he-line); }
.icon-links a {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--he-ink); border-radius: 50%;
}
.icon-links a:hover { color: var(--he-red); background: var(--he-surface); }
.icon-links img { width: 24px; height: 24px; }
@media (max-width: 760px) { .icon-links { border-left: none; padding-left: 0; margin-left: -10px; } }
.icon-links img.li { width: 28px; }

/* ---------- Seitenabschluss & Footer ---------- */
.closing { background: var(--he-surface); border-top: 1px solid var(--he-line); padding: clamp(56px, 7vw, 96px) 24px; text-align: center; }
.closing p { margin: 0 auto; max-width: 980px; font-size: clamp(24px, 3vw, 36px); line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
.closing span { color: var(--he-red); }
.site-footer { border-top: 1px solid var(--he-line); background: var(--he-white); }
.site-footer .bar { padding: 32px 24px; gap: 20px 40px; }
.footer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 22px; }
.footer-list a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 600; color: var(--he-ink); }
.footer-list a:hover { color: var(--he-red); }

/* ---------- Startseite: Angebote ---------- */
.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 16px 20px;
  background: var(--he-white); border: 1px solid var(--he-line); border-radius: var(--he-radius);
}
.filterbar fieldset { border: none; margin: 0; padding: 0; min-width: 0; }
.filterbar .field { flex: 1 1 220px; max-width: 300px; }
.filterbar .count { margin: 0 0 0 auto; display: flex; align-items: center; font-weight: 700; color: var(--he-ink); }
.obox { background: var(--he-white); border: 1px solid var(--he-line); border-radius: var(--he-radius); padding: 8px 24px; }
.ohead, .orow {
  display: grid;
  /* feste Breite für „Inserat“, damit Kopfzeile und Zeilen exakt dieselben Spalten haben */
  grid-template-columns: minmax(0, 1.8fr) minmax(0, .9fr) minmax(0, .9fr) minmax(0, .7fr) minmax(0, .9fr) minmax(0, 1.2fr) 150px;
  gap: 16px; align-items: center;
}
/* mittlere Spalten (Objektart bis Preis) in Kopf und Zeilen zentriert, Inserat rechtsbündig */
.ohead > :nth-child(n+2):nth-child(-n+6) { text-align: center; }
.ohead > :last-child { text-align: right; }
.orow > .oc:nth-child(n+2):nth-child(-n+6) { align-items: center; text-align: center; }
.orow > .oc:nth-child(n+2):nth-child(-n+6) .tag { align-self: center; }
.orow > .oc-x { align-items: flex-end; }
.ohead { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--he-muted); padding: 16px 0 12px; border-bottom: 2px solid var(--he-ink); }
.olist { list-style: none; margin: 0; padding: 0; }
.orow { padding: 18px 0; border-bottom: 1px solid var(--he-line); }
.orow:last-child { border-bottom: none; }
.oc { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.oc strong { font-size: 18px; line-height: 1.3; }
.cl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.empty { padding: 40px 0; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
@media (max-width: 860px) {
  .obox { background: transparent; border: none; padding: 0; }
  .ohead { display: none; }
  .olist { display: grid; gap: 16px; }
  .orow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; padding: 20px; border: 1px solid var(--he-line); border-radius: var(--he-radius); background: var(--he-white); }
  .orow:last-child { border-bottom: 1px solid var(--he-line); }
  .orow > .oc:nth-child(n+2):nth-child(-n+6), .orow > .oc-x { align-items: flex-start; text-align: left; }
  .orow > .oc:nth-child(n+2):nth-child(-n+6) .tag { align-self: flex-start; }
  .oc-main, .oc-x { grid-column: 1 / -1; }
  .cl { position: static; width: auto; height: auto; clip: auto; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--he-muted); }
  .oc-x .btn { width: 100%; }
  .filterbar .count { margin-left: 0; }
}

.contact-card { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding: 32px; background: var(--he-surface); border-radius: var(--he-radius); }
.contact-card .link { font-size: 20px; }

/* ---------- Über uns ---------- */
.step { display: flex; flex-direction: column; gap: 14px; padding-top: 24px; border-top: 3px solid var(--he-ink); margin: 0; }
.step-n { font-size: 15px; font-weight: 800; color: var(--he-red); letter-spacing: .06em; }
.kpi { background: var(--he-surface); border-radius: var(--he-radius); padding: 28px 24px; display: flex; flex-direction: column; gap: 8px; margin: 0; align-items: center; text-align: center; }
.kpi dt { order: 2; font-weight: 400; }
.kpi dd { order: 1; margin: 0; font-size: clamp(40px, 4.4vw, 56px); line-height: 1; font-weight: 800; color: var(--he-red); }
.val { display: flex; flex-direction: column; gap: 14px; padding: 32px; background: var(--he-white); border: 1px solid var(--he-line); border-radius: var(--he-radius); }
.val__bar { width: 40px; height: 4px; background: var(--he-red); }
.val-t { font-size: clamp(26px, 2.6vw, 34px); font-weight: 800; line-height: 1.1; margin: 0; }
.regions { list-style: none; margin: 8px 0 0; padding: 0; gap: 8px; }
.regions li { padding: 6px 14px; border: 1px solid var(--he-ink); border-radius: 2px; background: var(--he-white); font-size: 15px; line-height: 1.4; }
.taglist { list-style: none; margin: 8px 0 0; padding: 0; gap: 8px; }

/* ---------- Immobilien ---------- */
.proj { padding: 56px 0; border-top: 1px solid var(--he-line); scroll-margin-top: 24px; }
.gallery__main { position: relative; aspect-ratio: 4 / 3; border-radius: var(--he-radius); overflow: hidden; background: var(--he-placeholder); }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__main .ph { position: absolute; inset: 0; border-radius: 0; }
.gallery__ctrl { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.gallery__count { background: var(--he-ink); color: var(--he-white); font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.gbtn {
  width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--he-white); color: var(--he-ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.gbtn:hover { color: var(--he-red); }
.thumbs { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.thumb {
  width: 100%; aspect-ratio: 4 / 3; padding: 0; background: var(--he-placeholder); color: var(--he-muted);
  font: 700 14px var(--he-font); cursor: pointer; border-radius: var(--he-radius); border: 3px solid transparent;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { background: #DCDCD8; }
.thumb[aria-current="true"] { border-color: var(--he-red); }
.loc { margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; margin: 0; border-top: 1px solid var(--he-line); }
.facts div { padding: 14px 0; border-bottom: 1px solid var(--he-line); }
/* Letzte Zeile ohne Linie (bei ungerader Anzahl steht dort nur ein Wert) */
.facts div:last-child, .facts div:nth-last-child(2):nth-child(odd) { border-bottom: none; }
.facts dt { font-size: 13px; font-weight: 700; color: var(--he-muted); }
.facts dd { margin: 2px 0 0; font-size: 19px; font-weight: 800; }
.more { padding: 48px 0; border-top: 1px solid var(--he-line); display: flex; flex-direction: column; align-items: center; gap: 12px; }
@media (max-width: 860px) { .g2.proj__grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Aktuelles ---------- */
.soc { display: flex; align-items: center; gap: 18px; padding: 24px; border: 1px solid var(--he-line); border-radius: var(--he-radius); background: var(--he-white); color: var(--he-ink); text-decoration: none; min-height: 96px; }
.soc:hover { border-color: var(--he-red); color: var(--he-ink); }
.soc img { width: 44px; height: 44px; flex: none; }
.soc img.li { width: 52px; }
.soc strong { font-size: 19px; }
.ig { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.ig a { display: flex; text-decoration: none; color: var(--he-muted); }
.ig .ph { width: 100%; }
.ig img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--he-radius); background: var(--he-placeholder); transition: opacity .2s; }
.ig a:hover img, .ig a:focus-visible img { opacity: .85; }
@media (max-width: 900px) {
  .ig { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: minmax(220px, 62%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; }
  .ig li { scroll-snap-align: start; }
}
.legend { list-style: none; margin: 8px 0 0; padding: 0; gap: 12px 32px; font-size: 15px; }
.legend li { display: flex; align-items: center; gap: 10px; }
.tl { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) auto; gap: 24px 40px; align-items: center; padding: 36px 0; border-bottom: 1px solid var(--he-line); }
.ms { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.ms li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 14px; line-height: 1.3; }
.ms li::before { content: ""; position: absolute; top: 17px; right: 50%; width: 100%; height: 2px; background: #CFCFCB; }
.ms li:first-child::before { display: none; }
.ms li.st-abgeschlossen::before, .ms li.st-aktuell::before { background: var(--he-red); }
.dot { position: relative; z-index: 1; flex: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.dot--done { background: var(--he-red); }
.dot--current { background: var(--he-white); border: 3px solid var(--he-red); }
.dot--current::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--he-red); }
.dot--planned { background: var(--he-white); border: 2px dashed #8C8C88; }
.dot--sm { width: 24px; height: 24px; }
.dot--sm.dot--current::after { width: 8px; height: 8px; }
.st-label { color: var(--he-muted); }
.st-label--current { color: var(--he-red); font-weight: 800; }
@media (max-width: 900px) {
  .tl { grid-template-columns: minmax(0, 1fr); }
  .ms { grid-auto-flow: row; grid-auto-columns: auto; gap: 18px; }
  .ms li { flex-direction: row; text-align: left; gap: 14px; }
  .ms li::before { top: -18px; left: 17px; right: auto; width: 2px; height: 18px; }
}

/* ---------- Kontakt ---------- */
.cg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.fg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.full { grid-column: 1 / -1; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.note { padding: 20px 24px; border-radius: var(--he-radius); display: flex; gap: 14px; align-items: flex-start; }
.note--error { background: #FCEBEE; border: 1px solid var(--he-red); }
.note--ok { background: #EEF6EF; border: 1px solid #7DB287; flex-direction: column; }
.note--ok .h3 { color: #1E5B2A; }
.aside-card { display: flex; flex-direction: column; gap: 24px; padding: 32px; background: var(--he-surface); border-radius: var(--he-radius); }
.aside-card address { font-style: normal; line-height: 1.6; }
.aside-card .link { font-size: 19px; }
.map { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.map > a { display: block; border: 1px solid var(--he-line); border-radius: var(--he-radius); overflow: hidden; }
.map > a:hover { border-color: var(--he-red); }
.map img { width: 100%; aspect-ratio: 4 / 3; background: var(--he-placeholder); }
@media (max-width: 860px) { .cg { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .fg { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Rechtstexte ---------- */
.legal { max-width: 820px; margin: 0 auto; padding: clamp(56px, 7vw, 96px) 24px; display: flex; flex-direction: column; gap: 12px; overflow-wrap: break-word; hyphens: auto; }
.legal h1 { font-size: clamp(34px, 4.4vw, 52px); line-height: 1.08; font-weight: 800; margin: 0 0 4px; }
.legal h2 { font-size: 24px; line-height: 1.3; font-weight: 800; margin: 40px 0 4px; padding-top: 28px; border-top: 1px solid var(--he-line); scroll-margin-top: 24px; }
.legal--simple h2 { font-size: 21px; font-weight: 700; margin: 28px 0 0; padding-top: 0; border-top: none; }
.legal h3 { font-size: 19px; line-height: 1.35; font-weight: 700; margin: 20px 0 0; scroll-margin-top: 24px; }
.legal h4 { font-size: 17px; line-height: 1.4; font-weight: 700; margin: 12px 0 0; }
.legal p { margin: 0; }
.legal ul { margin: 0; padding-left: 22px; }
.legal li { margin: 4px 0; }
.ph-t { color: var(--he-muted); }
.meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; padding: 20px 24px; background: var(--he-surface); border-radius: var(--he-radius); margin-top: 12px; }
.toc { margin-top: 16px; padding: 24px 28px; border: 1px solid var(--he-line); border-radius: var(--he-radius); }
.toc h2 { margin: 0 0 8px; padding: 0; border: none; font-size: 19px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.toc ol ol { padding-left: 24px; margin-top: 4px; }
.toc a { color: var(--he-ink); text-decoration: underline; text-decoration-color: var(--he-red); text-underline-offset: 3px; }
.toc a:hover { color: var(--he-red); }

/* ---------- Druck ---------- */
/* ---------- Nach oben (wird von main.js eingefügt) ---------- */
.totop {
  position: fixed; z-index: 50; right: calc(24px + env(safe-area-inset-right, 0px)); bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: 52px; height: 52px; padding: 0; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--he-white); border-radius: 50%; background: var(--he-red); color: var(--he-white);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s, background .2s;
}
.totop.is-visible { opacity: 1; visibility: visible; transform: none; }
.totop:hover { background: var(--he-red-dark); }
@media (max-width: 760px) {
  .totop { width: 48px; height: 48px; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .totop { transition: none; } }

@media print {
  .totop, .site-header .bar__right, .closing, .filterbar, .gallery__ctrl, .thumbs, .more { display: none !important; }
  body { font-size: 12pt; }
}
