/* =========================================================
   Elektro Bollmann – Teamseite (Farb-Sektion #team2026)
   Ablage im Childtheme: css/team-2026.css
   Wird per functions.php nur auf der Testseite /team-2026/ (ID 24793) geladen.

   Aufbau im Layout-Builder (alles in der Sektion "team2026"):
   1. Code-Block mit der Sprungmarken-Leiste (.team-chips)
   2. Spezialüberschrift (ID: team-meister) + 1/4-Spalten
   3. Spezialüberschrift (ID: team-technik) + 1/4-Spalten
   4. Spezialüberschrift (ID: team-fachgeschaeft) + 1/4-Spalten
   5. Spezialüberschrift (ID: team-azubis) + 1/5-Spalten
   Jede Spalte: Teammitglied + Toggle "mehr" (wie bisher).
   ========================================================= */

:root {
  --team-text: #1F1F1F;               /* Namen, Pill-Text */
  --team-muted: #555555;              /* Funktion */
  --team-red: #D60000;                /* Hover, Fokus, Akzente (Navigationsrot der Seite) */
  --team-overlay: rgba(192, 0, 0, .94); /* Foto-Überlagerung, weißer Text gut lesbar */
  --team-chip-bg: #F2F2F2;
  --team-line: #E5E5E5;
  --team-ratio: 3 / 4;          /* einheitlicher Bildzuschnitt */
}

#team2026 {
  --team-gap-x: 28px;
  --team-gap-y: 44px;
}

/* Enfold setzt overflow:hidden auf #wrap_all – das verhindert
   position:sticky für die Sprungmarken. "clip" schneidet genauso ab,
   erlaubt aber Sticky. */
#top.page-id-24793 #wrap_all {
  overflow: clip;
}

/* ---------- Raster: Flexbox statt Float-Spalten ---------- */
html #top #team2026 .entry-content-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--team-gap-y) var(--team-gap-x);
}
html #top #team2026 .entry-content-wrapper::before,
html #top #team2026 .entry-content-wrapper::after {
  display: none;
}

/* Alles, was keine Spalte ist (Überschriften, Code-Block), volle Breite */
html #top #team2026 .entry-content-wrapper > * {
  flex: 0 0 100%;
  margin: 0;
}

html #top #team2026 .flex_column {
  float: none;
  margin: 0 !important;
  width: auto;
  min-width: 0;
}
/* Teammitglieder: 4 pro Zeile */
html #top #team2026 .flex_column.av_one_fourth {
  flex: 0 0 calc((100% - 3 * var(--team-gap-x)) / 4);
}
/* Auszubildende: 5 pro Zeile */
html #top #team2026 .flex_column.av_one_fifth {
  flex: 0 0 calc((100% - 4 * var(--team-gap-x)) / 5);
}

/* ---------- Bereichsüberschriften ---------- */
html #top #team2026 .av-special-heading {
  padding-top: 40px;
  margin-bottom: calc(24px - var(--team-gap-y));
  scroll-margin-top: 96px;
}
html #top #team2026 .avia_codeblock_section + .av-special-heading {
  padding-top: 8px;
}

/* ---------- Karte ---------- */
html #top #team2026 .avia-team-member {
  margin: 0;
  text-align: left;
}
html #top #team2026 .team-img-container {
  position: relative;
  margin: 0 0 14px;
  border-radius: 8px;
  overflow: hidden;
  background: #EFEFEF;
}
html #top #team2026 .team-img-container img {
  display: block;
  width: 100%;
  height: auto !important;
  aspect-ratio: var(--team-ratio);
  object-fit: cover;
  object-position: center 15%;
}
html #top #team2026 .team-member-name {
  font-size: 20px;
  line-height: 1.25;
  margin: 0 0 4px;
  hyphens: auto;
  overflow-wrap: break-word;
}
html #top #team2026 .team-member-job-title {
  font-size: 15px;
  line-height: 1.4;
  color: var(--team-muted);
  hyphens: auto;
}
html #top #team2026 .team-member-job-title strong {
  display: block;
  color: var(--team-text);
}
/* Azubi-Karten kompakter */
html #top #team2026 .av_one_fifth .team-member-name {
  font-size: 17px;
}
html #top #team2026 .av_one_fifth .team-member-job-title {
  font-size: 14px;
}

/* ---------- Sprungmarken-Leiste (Code-Block) ---------- */
html #top #team2026 .entry-content-wrapper > .avia_codeblock_section {
  position: sticky;
  top: 0;
  z-index: 20;
  min-width: 0;                 /* verhindert, dass die Leiste die Seite verbreitert */
  max-width: 100%;
  border-bottom: 1px solid var(--team-line);
  background: rgba(255, 255, 255, .97);
  /* Hintergrund über die volle Fensterbreite ziehen */
  box-shadow: 0 0 0 100vmax rgba(255, 255, 255, .97);
  clip-path: inset(0 -100vmax);
}
html #top.admin-bar #team2026 .entry-content-wrapper > .avia_codeblock_section {
  top: 32px;
}
html #top #team2026 .avia_codeblock {
  min-width: 0;
  max-width: 100%;
}
.team-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0;
  min-width: 0;
  max-width: 100%;
}
html #top .team-chips a,
html #top .team-chips a:visited {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--team-chip-bg);
  color: var(--team-text);
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
html #top .team-chips a span {
  text-decoration: none !important;
}
html #top .team-chips a:hover,
html #top .team-chips a:focus-visible {
  background: var(--team-red);
  color: #FFFFFF;
}
html #top .team-chips a:focus-visible {
  outline: 2px solid var(--team-text);
  outline-offset: 2px;
}
.team-chips__count {
  font-weight: 400;
  opacity: .7;
}
.team-chips__short {
  display: none;
}

/* =========================================================
   Erweiterungen, die erst mit team-2026.js greifen (Klasse .team-js).
   Ohne JavaScript bleibt der normale "mehr"-Toggle erhalten.
   ========================================================= */

html.team-js #team2026 .togglecontainer {
  display: none;
}
html.team-js #team2026 .team-has-bio {
  cursor: pointer;
}
html.team-js #team2026 .team-has-bio:focus-visible {
  outline: 3px solid var(--team-red);
  outline-offset: 4px;
  border-radius: 8px;
}
/* Kleines i-Symbol: Hinweis, dass es eine Vorstellung gibt */
html.team-js #team2026 .team-has-bio .team-img-container::after {
  content: "i";
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--team-red);
  font: 700 16px/30px Georgia, "Times New Roman", serif;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  transition: opacity .2s ease;
  z-index: 4;                   /* Enfold legt das Foto auf z-index 3 */
}

/* ---------- Platzhalter: Initialen statt Silhouette ----------
   team-2026.js erkennt Bilder mit "platzhalter" im Dateinamen. */
html.team-js #team2026 .team-placeholder {
  background: #EFEFEF;
}
html.team-js #team2026 .team-placeholder img {
  visibility: hidden;           /* Bild behält die Fläche, wird aber nicht gezeigt */
}
html.team-js #team2026 .team-placeholder::before {
  content: attr(data-initials);
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #B5B5B5;
}
html.team-js #team2026 .av_one_fifth .team-placeholder::before {
  font-size: 38px;
}

/* ---------- Desktop mit Maus: Vorstellung als Überlagerung ---------- */
@media only screen and (min-width: 990px) and (hover: hover) {
  html.team-js #team2026 .team-has-bio {
    position: relative;
    cursor: default;
  }
  html.team-js #team2026 .team-has-bio .togglecontainer {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    aspect-ratio: var(--team-ratio);
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    border-radius: 8px;
    background: var(--team-overlay);
    opacity: 0;
    transition: opacity .2s ease;
    z-index: 5;                 /* über Foto (3) und i-Symbol (4) */
  }
  html.team-js #team2026 .team-has-bio:hover .togglecontainer,
  html.team-js #team2026 .team-has-bio:focus-within .togglecontainer {
    opacity: 1;
  }
  html.team-js #team2026 .team-has-bio:hover .team-img-container::after,
  html.team-js #team2026 .team-has-bio:focus-within .team-img-container::after {
    opacity: 0;
  }
  /* Enfold-Toggle neutralisieren: immer offen, ohne Rahmen und Titel */
  html.team-js #team2026 .togglecontainer .av_toggle_section {
    margin-top: auto;           /* Text unten im Bild ausrichten */
  }
  html.team-js #team2026 .togglecontainer .av_toggle_section,
  html.team-js #team2026 .togglecontainer .single_toggle,
  html.team-js #team2026 .togglecontainer .toggle_wrap,
  html.team-js #team2026 .togglecontainer .toggle_content {
    margin: 0;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
  }
  html.team-js #team2026 .togglecontainer .toggler {
    display: none;
  }
  /* Enfold versteckt geschlossene Toggles per
     ".js_active .toggle_wrap { visibility:hidden; position:absolute; left:120% }"
     – das wird hier vollständig zurückgesetzt. */
  html.team-js #team2026 .togglecontainer .toggle_wrap {
    display: block !important;
    position: static !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: auto;
  }
  html.team-js #team2026 .togglecontainer .toggle_content,
  html.team-js #team2026 .togglecontainer .toggle_content p,
	  html.team-js #team2026 .togglecontainer .toggle_content b {
    color: #FFFFFF !important;
    font-size: 14.5px;
    line-height: 1.5;
    margin: 0;
  }
}

/* ---------- Tablet: 3 bzw. 4 pro Zeile ---------- */
@media only screen and (min-width: 768px) and (max-width: 989px) {
  html #top #team2026 .flex_column.av_one_fourth {
    flex-basis: calc((100% - 2 * var(--team-gap-x)) / 3);
  }
  html #top #team2026 .flex_column.av_one_fifth {
    flex-basis: calc((100% - 3 * var(--team-gap-x)) / 4);
  }
}

/* ---------- Mobil: 2 bzw. 3 pro Zeile ---------- */
@media only screen and (max-width: 767px) {
  #team2026 {
    --team-gap-x: 14px;
    --team-gap-y: 28px;
  }
  html #top #team2026 .flex_column.av_one_fourth {
    flex-basis: calc((100% - var(--team-gap-x)) / 2);
  }
  html #top #team2026 .flex_column.av_one_fifth {
    flex-basis: calc((100% - 2 * var(--team-gap-x)) / 3);
  }
  html #top #team2026 .av-special-heading {
    padding-top: 24px;
    margin-bottom: calc(16px - var(--team-gap-y));
    scroll-margin-top: 80px;
  }
  html #top #team2026 .team-img-container {
    margin-bottom: 10px;
  }
  html #top #team2026 .team-member-name {
    font-size: 16px;
    overflow-wrap: anywhere;
  }
  html #top #team2026 .team-member-job-title {
    font-size: 13px;
    line-height: 1.35;
  }
  html #top #team2026 .av_one_fifth .team-member-name {
    font-size: 14px;
  }
  html #top #team2026 .av_one_fifth .team-member-job-title {
    font-size: 12px;
  }
  html.team-js #team2026 .team-has-bio .team-img-container::after {
    right: 8px;
    bottom: 8px;
    width: 26px;
    height: 26px;
    font-size: 14px;
    line-height: 26px;
  }

  /* Sprungmarken: eine Zeile, seitlich wischbar, Kurzbezeichnungen */
  .team-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-right: 32px;        /* letzte Pill nicht unter dem Verlauf */
    scrollbar-width: none;
    /* Verlauf am rechten Rand: zeigt, dass man wischen kann */
    -webkit-mask-image: linear-gradient(to right, #000 82%, transparent);
    mask-image: linear-gradient(to right, #000 82%, transparent);
  }
  .team-chips::-webkit-scrollbar {
    display: none;
  }
  html #top .team-chips a {
    flex: 0 0 auto;
    padding: 0 16px;
    font-size: 15px;
  }
  .team-chips__long {
    display: none;
  }
  .team-chips__short {
    display: inline;
  }
}

/* =========================================================
   Bottom-Sheet (Mobil und Tablet) – wird von team-2026.js erzeugt
   ========================================================= */
html.team-sheet-open,
html.team-sheet-open body {
  overflow: hidden;
}
.team-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  transition: opacity .25s ease;
}
.team-sheet-backdrop.is-open {
  opacity: 1;
}
.team-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100001;
  max-height: 80vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 12px 20px calc(28px + env(safe-area-inset-bottom));
  background: #FFFFFF;
  color: var(--team-text);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
  transform: translateY(100%);
  transition: transform .3s ease;
}
.team-sheet.is-open {
  transform: translateY(0);
}
.team-sheet[hidden],
.team-sheet-backdrop[hidden] {
  display: none;
}
@media only screen and (min-width: 600px) {
  .team-sheet {
    left: 50%;
    right: auto;
    width: 560px;
    transform: translate(-50%, 100%);
  }
  .team-sheet.is-open {
    transform: translate(-50%, 0);
  }
}
.team-sheet__handle {
  width: 40px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 2px;
  background: #D0D0D0;
}
.team-sheet__head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.team-sheet__img {
  flex: 0 0 88px;
  width: 88px;
  height: auto;
  aspect-ratio: var(--team-ratio);
  object-fit: cover;
  object-position: center 15%;
  border-radius: 8px;
}
.team-sheet__titles {
  flex: 1 1 auto;
  min-width: 0;
}
#top .team-sheet__name {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  color: var(--team-text);
}
.team-sheet__job {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--team-muted);
}
.team-sheet__close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--team-chip-bg);
  color: var(--team-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.team-sheet__bio {
  margin-top: 18px;
  font-size: 16px;
  line-height: 1.55;
}
.team-sheet__bio p {
  margin: 0 0 .8em;
}
.team-sheet__bio p:last-child {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  .team-sheet,
  .team-sheet-backdrop,
  html.team-js #team2026 .togglecontainer {
    transition: none;
  }
}
