/* Heigel Family Office — www.heigel-family-office.de
   Farben und Schriftcharakter folgen dem Markenmaterial der Heigel Gruppe:
   Navy #133F62 aus dem Family-Office-Logo, Blau #3C6577 und Grau #575756 aus dem CI.
   Die Rahmenfigur des Logos trägt das Seitenlayout. */

/* ---------- Schrift (lokal ausgeliefert, keine externen Verbindungen) ---------- */

@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/fira-sans-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/fira-sans-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/fira-sans-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/fira-sans-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Grundwerte ---------- */

:root {
  --navy: #133f62;
  --petrol: #3c6577;
  --graphit: #575756;
  --linie: #c7d0d6;
  --kalk: #eef2f4;
  --papier: #ffffff;

  --satz: "Fira Sans", "Segoe UI", system-ui, sans-serif;
  --spalte: 200px;
  --luft: clamp(30px, 4.5vw, 52px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: clamp(12px, 2.5vw, 32px);
  background: var(--kalk);
  color: var(--graphit);
  font: 400 17px/1.7 var(--satz);
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--linie);
  text-underline-offset: 3px;
  transition: text-decoration-color 120ms linear;
}
a:hover { text-decoration-color: var(--navy); }

:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

/* Ausserhalb des Sichtfelds, ohne die Seite zu verbreitern. */
.skip {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  width: auto;
  height: auto;
  clip-path: none;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  z-index: 10;
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  text-decoration: none;
}

/* ---------- Der Rahmen: gleiche Figur wie im Logo ---------- */

.rahmen-aussen {
  max-width: 1000px;
  margin: 0 auto;
  border: 2px solid var(--navy);
  padding: 4px;
  background: var(--papier);
}
.rahmen-innen {
  border: 1px solid var(--navy);
  padding: clamp(26px, 5vw, 76px);
}

/* ---------- Kopf ---------- */

.kopf {
  text-align: center;
  padding-bottom: var(--luft);
}

.kopf h1 {
  margin: 0 0 clamp(26px, 4vw, 40px);
  line-height: 0;
}
.kopf img {
  width: clamp(92px, 12vw, 132px);
  height: auto;
}

.lead {
  max-width: 34em;
  margin: 0 auto;
  color: var(--navy);
  font-size: clamp(18px, 1.55vw, 21px);
  line-height: 1.55;
  text-wrap: balance;
}

/* ---------- Textblöcke: Überschrift in der Randspalte ---------- */

.block {
  display: grid;
  grid-template-columns: var(--spalte) minmax(0, 1fr);
  gap: 0 48px;
  padding: var(--luft) 0;
  border-top: 1px solid var(--linie);
}

.block h2 {
  grid-column: 1;
  margin: 0;
  color: var(--navy);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.7;
}

.block .text {
  grid-column: 2;
  max-width: 64ch;
}

.schluss .text {
  grid-column: 2;
  color: var(--navy);
  font-size: 18px;
}

.kontaktzeile {
  color: var(--navy);
  font-weight: 500;
  margin-bottom: 0.35em;
}

/* ---------- Beteiligungsstruktur ---------- */

/* Das Diagramm nutzt die volle Blockbreite, damit die Genfer und die
   texanische Gesellschaft nicht in eine Drittelspalte gequetscht werden. */
.struktur {
  grid-column: 1 / -1;
  margin-top: clamp(30px, 4vw, 48px);
}

/* Abstände und Innenabstände werden bewusst je Ebene gesetzt, nicht hier zurück-
   gesetzt: ein Sammel-Reset auf ".struktur ul" wäre spezifischer als die
   Ebenen-Regeln und würde deren margin-top schlucken. */
.struktur ul { list-style: none; }

.struktur-wurzel {
  margin: 0 auto;
  max-width: 21em;
  position: relative;
  background: var(--navy);
  color: #fff;
  font-weight: 500;
  text-align: center;
  padding: 12px 20px;
  line-height: 1.4;
}
.struktur-wurzel::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1px;
  height: 26px;
  background: var(--petrol);
}

.ebene-1 {
  display: flex;
  margin: 26px 0 0;
  padding: 0;
}
.ebene-1 > li {
  position: relative;
  flex: 1 1 0;
  padding: 26px 10px 0;
  text-align: center;
}
/* Die HVC trägt zwei Untergesellschaften und bekommt entsprechend mehr Raum. */
.ebene-1 > li:nth-child(2) { flex-grow: 2.1; }
.ebene-1 > li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--petrol);
}
.ebene-1 > li:first-child::before { left: 50%; }
.ebene-1 > li:last-child::before { right: 50%; }
.ebene-1 > li::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 26px;
  background: var(--petrol);
}

.knoten {
  display: block;
  border: 1px solid var(--navy);
  color: var(--navy);
  padding: 11px 14px;
  line-height: 1.4;
}

/* Die drei unmittelbaren Töchter stehen gleichrangig — also auch gleich hoch,
   obwohl Forst Gelbensande zweizeilig umbricht. */
.ebene-1 > li > .knoten {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.6em;
}

.ebene-2 {
  display: flex;
  margin: 26px 0 0;
  padding: 0;
  position: relative;
}
.ebene-2::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 1px;
  height: 26px;
  background: var(--petrol);
}
.ebene-2 > li {
  position: relative;
  flex: 1 1 0;
  padding: 22px 6px 0;
  text-wrap: balance;
}
.ebene-2 > li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--petrol);
}
.ebene-2 > li:first-child::before { left: 50%; }
.ebene-2 > li:last-child::before { right: 50%; }
.ebene-2 > li::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 22px;
  background: var(--petrol);
}
/* Die Enkelgesellschaften tragen keinen eigenen Rahmen — die Anbindungslinie
   genügt und hält die Hierarchie ablesbar. */
.ebene-2 .knoten {
  border: 0;
  padding: 0;
  font-size: 15px;
}
.ort {
  display: block;
  font-size: 14px;
  color: var(--graphit);
  line-height: 1.5;
}

/* ---------- Rechtstexte ---------- */

.recht .text { font-size: 15px; }

.recht h3 {
  margin: 1.9em 0 0.5em;
  color: var(--navy);
  font-size: 15px;
  font-weight: 500;
}
.recht h3:first-of-type { margin-top: 0; }


/* ---------- Fuß ---------- */

.fuss {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 32px;
  padding-top: var(--luft);
  border-top: 1px solid var(--linie);
  font-size: 14px;
}
.fuss nav { display: flex; gap: 24px; }

/* ---------- Schmale Fenster ---------- */

@media (max-width: 800px) {
  .block {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .block h2,
  .block .text,
  .schluss .text {
    grid-column: 1;
  }
  .block .text { max-width: none; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }

  /* Zentrierter Fließtext trägt auf dieser Breite nicht mehr — der Kopf
     richtet sich mit dem übrigen Dokument nach links aus. */
  .kopf { text-align: left; }
  .lead { margin-left: 0; }

  /* Baum kippt in eine eingerückte Liste */
  .struktur-wurzel {
    max-width: none;
    text-align: left;
  }
  /* Bündig mit der Astlinie der Liste darunter, sonst versetzt sich der Strang. */
  .struktur-wurzel::after { left: 0; }

  .ebene-1,
  .ebene-2 { display: block; }

  .ebene-1 > li,
  .ebene-2 > li {
    padding: 0 0 0 20px;
    margin-top: 0;
    text-align: left;
    border-left: 1px solid var(--petrol);
  }
  .ebene-1 > li { padding-top: 26px; }
  .ebene-1 > li:last-child { border-left-color: transparent; }
  .ebene-1 > li > .knoten {
    justify-content: flex-start;
    min-height: 0;
  }

  .ebene-1 > li::before,
  .ebene-2 > li::before {
    top: 38px;
    left: 0;
    right: auto;
    width: 20px;
    height: 1px;
  }
  .ebene-1 > li::after,
  .ebene-2 > li::after {
    left: 0;
    top: 0;
    width: 1px;
    height: 38px;
  }
  .ebene-1 > li:first-child::before,
  .ebene-1 > li:last-child::before,
  .ebene-2 > li:first-child::before,
  .ebene-2 > li:last-child::before { left: 0; right: auto; }

  .ebene-2 {
    margin: 0;
    padding: 0 0 0 20px;
  }
  .ebene-2::before { display: none; }
  .ebene-2 > li {
    padding-top: 22px;
    border-left: 0;
  }
  .ebene-2 > li::before { top: 32px; }
  .ebene-2 > li::after { height: 32px; }
  .ebene-2 .knoten { border-top: 0; padding-top: 0; }
}

/* ---------- Druck ---------- */

@media print {
  body { background: #fff; padding: 0; }
  .rahmen-aussen { border: 0; max-width: none; }
  .rahmen-innen { border: 0; padding: 0; }
  .skip, .fuss nav { display: none; }
  .block { break-inside: avoid; }
  a { text-decoration: none; }
}
