/* https://fractaledmind.github.io/2018/03/05/css-tree/ */

/* Der Scroll-Container (Muss um das div#famtree liegen) */
.tree-scroll-area {
  *width: 100%;
  *overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  *padding: 20px 0;
  transform: scale(0.8);
  transform-origin: left top;
}

.fam-tree {
  display: inline-block;
  min-width: 100%;
  text-align: center;
  
  /* Zentrale Variable für die Linienlänge */
  --line-height: 15px; 

  &, ul, li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* Horizontale Ausrichtung der Ebenen */
.fam-tree ul {
  display: flex !important;
  flex-direction: row !important;
  *justify-content: center !important;
  align-items: flex-start !important;
  position: relative;
  padding-top: var(--line-height) !important; 
  width: max-content;
  *min-width: 100%;
}

/* Vertikale Linie vom Vater-Knoten nach unten */
.fam-tree ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 0.5px; /* Umgestellt auf 1px */
  height: var(--line-height);
  background: orange;
  z-index: 1;
  *transform: translateX(-50%);
}

.fam-tree li {
  position: relative;
  padding: var(--line-height) 2px 0 2px !important; 
  flex: 0 0 auto !important;
}

/* Horizontale Linien zwischen Geschwistern */
.fam-tree li::before, .fam-tree li::after {
  content: '';
  position: absolute;
  top: 0;
  width: 50%;
  height: 0.5px; /* Umgestellt auf 1px */
  background: orange;
  z-index: 0;
}
.fam-tree li::before { right: 50%; }
.fam-tree li::after { left: 50%; }

/* Ränder der Linien säubern */
.fam-tree li:first-child::before, 
.fam-tree li:last-child::after,
.fam-tree li:only-child::before,
.fam-tree li:only-child::after {
  display: none !important;
}

/* Deine speziellen DIV-Boxen */
.fam-tree li > a {
  display: inline-block;
  text-decoration: none;
  position: relative;
}

/* Vertikale Linie direkt über dem gelben Kasten */
.fam-tree li > a::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 0.5px; /* Umgestellt auf 1px */
  height: var(--line-height);
  background: orange;
  *transform: translateX(-50%);
}

/* Versteckt die unnötigen Linien vor dem allerersten Element */
.fam-tree > ul::before,
.fam-tree > ul > li::before,
.fam-tree > ul > li::after,
.fam-tree > ul > li > a::before {
  display: none !important;
  background: none !important;
}

/* Stellt sicher, dass das erste LI kein Padding-Top hat */
.fam-tree > ul > li {
  padding-top: 0px !important; 
}

/* Versteckt die vertikale Linie UNTER dem Kasten, wenn kein UL folgt */
.fam-tree li:not(:has(ul)) a::after,
.fam-tree li:not(:has(ul))::after {
    display: none !important;
}

/* Falls die Linie am UL-Anfang der nächsten Ebene hängt: 
   Versteckt die Linie, wenn das UL keine LI-Kinder hat */
.fam-tree ul:not(:has(li))::before {
    display: none !important;
}






/*#br-over-cont-2a { display: flex; justify-content: left;align-items: center; height: fit-content; }*/
/*.fam-tree {height: fit-content; width: fit-content;}*/