/** ***************************
   Abteilungs Toggle
******************************/

.sci-abteilungen-nav{
  --icon: 38px;
  --pad: 10px;
  --gap: 2px;
  --expand: 200px;                /* Max, wird aber vom Label begrenzt */
  --pill-radius: 9999px;
  /* Label-Breite in Zeichen -> Pixel/Em (Feinjustierfaktor): */
  --ch-unit: 0.63em;              /* 0.60–0.65 je nach Font */
  --label-w: calc(var(--label-ch, 10) * var(--ch-unit));

  --icon-color: var(--wp--preset--color--palette-color-1);
  --icon-color-active: #000;

  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  z-index: 9999;
}
@media (max-width: 768px){
  .sci-abteilungen-nav{ right: 10px; gap: 8px; }
}

/* Item: nur Icon-breit, alles fährt nach LINKS überlappt aus */
.sci-abt-item{
  position: relative;
  width: var(--icon);
  overflow: visible;
}

/* Unsichtbare Hover-Brücke LINKS vom Icon (ersetzt padding-left) */
.sci-abt-item.has-children::after{
  content:"";
  position:absolute;
  right: 100%;                    /* links neben dem Item */
  top: 0;
  height: 100%;
  width: 12px;                    /* „Brücke“ */
}

/* Link */
.sci-abt-link{
  display: inline-flex;
  align-items: center;
  position: relative;
  text-decoration: none;
  color: inherit;
  outline: none;
  width: var(--icon);             /* klickbare Breite = Icon */
  justify-content: flex-start;
}

/* Weißer KREIS hinter dem Icon (immer) */
.sci-abt-link::before{
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: var(--icon);
  height: var(--icon);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  z-index: 0;
}

/* Ausfahrender PILL links – Breite passend zum Label */
.sci-abt-link::after{
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) scaleX(0);
  transform-origin: right center;
  width: calc(var(--icon) + var(--gap) + var(--pad) + min(var(--label-w), var(--expand)));
  height: var(--icon);
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  transition: transform .28s ease;
  will-change: transform;
  z-index: 0;
}

/* Icon immer oben */
.sci-abt-icon{
  width: var(--icon);
  height: var(--icon);
  display: inline-grid;
  place-items: center;
  position: relative;
  z-index: 1;
  border-radius: 50%;
  color: var(--icon-color);
}
.sci-abt-icon img,
.sci-abt-icon svg{
  width: calc(var(--icon) * 1);
  height: calc(var(--icon) * 1);
  display: block;
}

/* 3) Inline-SVG auf currentColor „ummappen“ */
.sci-abt-icon svg { display:block; }
.sci-abt-icon svg [fill]:not([fill="none"]),
.sci-abt-icon svg path,
.sci-abt-icon svg rect,
.sci-abt-icon svg circle,
.sci-abt-icon svg polygon,
.sci-abt-icon svg ellipse {
  fill: currentColor !important;
}
.sci-abt-icon svg [stroke]:not([stroke="none"]),
.sci-abt-icon svg line,
.sci-abt-icon svg polyline {
  stroke: currentColor !important;
}

.sci-abt-item.is-active .sci-abt-icon { color: var(--icon-color-active); }

/* Label links vom Icon; ohne fixe Breite */
.sci-abt-label{
  position: absolute;
  right: calc(var(--icon) + var(--gap));
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  padding-right: var(--pad);
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease, max-width .28s ease;
  font-weight: 700;
  font-size: .8em;
  z-index: 1;
}

/* Hover: nur dieses Item fährt aus */
.sci-abt-item:hover > .sci-abt-link::after,
.sci-abt-item:focus-within > .sci-abt-link::after{
  transform: translateY(-50%) scaleX(1);
}
.sci-abt-item:hover > .sci-abt-link .sci-abt-label,
.sci-abt-item:focus-within > .sci-abt-link .sci-abt-label{
  max-width: min(var(--label-w), var(--expand));
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Submenü: links (Overlay), nur bei Hover/Focus */
.sci-abt-sub{
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  color: inherit;
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
  display: none;
  min-width: 160px;
  z-index: 2;
  font-weight: 700;
  font-size: .8em;
}
.sci-abt-sub a{
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 2px 10px;
  border-radius: 8px;
  font-weight: 600;
}
.sci-abt-sub a:hover,
.sci-abt-sub a:focus-visible{ background: rgba(0,0,0,.06); }

.sci-abt-item.has-children:hover > .sci-abt-sub,
.sci-abt-item.has-children:focus-within > .sci-abt-sub{
  display: block;
}

/* Tastaturfokus */
.sci-abt-link:focus-visible,
.sci-abt-sub a:focus-visible{
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}

/* Bewegungen reduzieren */
@media (prefers-reduced-motion: reduce){
  .sci-abt-link::after, .sci-abt-label{ transition: none; }
}

/* Active: Kreis betonen, aber Hover darf den Pill zeigen (für Label-Hintergrund) */
.sci-abt-item.is-active .sci-abt-link::after,
.sci-abt-item.is-active > .sci-abt-link::before{
  background: #EFEDEA;
  /*box-shadow: 0 0 0 2px #EFEDEA, 0 2px 10px rgba(0,0,0,.08);*/
}

.sci-abt-item.is-active svg [fill="#EFEDEA"]{
  color: #EFEDEA;
  /*box-shadow: 0 0 0 2px #EFEDEA, 0 2px 10px rgba(0,0,0,.08);*/
}

.sci-abt-item.is-active .sci-abt-icon{ filter: saturate(1.05) contrast(1.03); }

/* ===============================
   Fussball-Spezial
   =============================== */

/* Label weg; nur Submenü bei Hover */
.sci-abt--fussball .sci-abt-label{ display: none !important; }

/* Fussball-Submenü: wie Standard (Overlay) */
.sci-abt--fussball.has-children:hover > .sci-abt-sub,
.sci-abt--fussball.has-children:focus-within > .sci-abt-sub{
  display: block;
}

/* Optional: Fussball etwas kürzer */
.sci-abt--leichtathletik .sci-abt-link::after{ width: 160px; }
.sci-abt--tischtennis .sci-abt-link::after{ width: 150px; }
.sci-abt--reha .sci-abt-link::after{ width: 235px; }
/* Beispiel-Feintuning: stärkere Shadow für Leichtathletik */
/* .sci-abt--leichtathletik .sci-abt-link::after{ box-shadow: 0 2px 14px rgba(0,0,0,.18); } */


/* ===============================
   Mobile ≤ 767px
   =============================== */
@media (max-width: 767px){
  /* 1) Leiste unten, horizontal, zentriert */
  .sci-abteilungen-nav{
    --icon: 35px;
    --gap: 5px;

    position: fixed;
    left: 0;
    right: 0;
    bottom: 0px;
    top: auto;
    transform: none;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: var(--gap);
    padding: 8px 0;
    margin-block-end: 0px;
    z-index: 9999;
    background-color: #fff;
    width: 100%;
  }

  /* Größere Touch-Ziele (optional anpassen) */
  .sci-abt-item{
    width: var(--icon);
    height: var(--icon);
  }

  /* Die „Hover-Brücke“ links braucht es mobil nicht */
  .sci-abt-item.has-children::after{ display: none; }

  /* 2) Keine ausfahrende Pill + keine Labels auf Mobil */
  .sci-abt-link{ width: var(--icon); } /* Klickfläche = Icon */
  .sci-abt-link::after{ display: none !important; }   /* Pill aus */
  .sci-abt-label{ display: none !important; }         /* Label aus */

  /* Weißer Icon-Kreis wie gehabt */
  .sci-abt-link::before{
    right: 50%;
    transform: translate(50%, -50%);
  }

  /* 3) Submenüs mobil: über dem Icon, mittig, nach OBEN ausklappen */
  .sci-abt-sub{
    right: auto;
    left: 10%;
    top: auto;
    bottom: calc(100% + 10px);         /* nach oben */
    transform: translateX(-10%);       /* mittig über dem Icon */
    min-width: 180px;
    max-width: min(260px, calc(100vw - 20px));
    display: none;                      /* standard: zu */
    z-index: 10000;
  }

  /* Anzeigen bei Fokus/Tap (und weiterhin bei Hover, falls vorhanden)
     + wenn aktiv (praktisch auf Fussball-Seiten) */
  .sci-abt-item.has-children:focus-within > .sci-abt-sub,
  .sci-abt-item.has-children:hover > .sci-abt-sub{
    display: block;
  }
  /*
  .sci-abt-item.has-children.is-active > .sci-abt-sub{
    display: block;
  }*/

  /* Speziell: Fussball – nur Submenü (Label ist ohnehin aus) */
  .sci-abt--fussball .sci-abt-sub{
    /* falls du es breiter willst: */
    min-width: 220px;
  }

  /* Optional: kleine „Tap-Verzögerungen“ glätten (keine Transition nötig) */
  .sci-abt-link::before{ transition: none; }
}
