/* Unser Team – Layout */
.team-page {
  /* style.css setzt global main { display: flex; flex-wrap: wrap }.
     Ohne dieses display:block waeren H1, Intro, Raster und Abschluss
     Flex-Items in einer Reihe – und .team-grid bekaeme keine definierte
     Breite mehr, wodurch das Raster auf eine Spalte zusammenfaellt. */
  display: block;
  max-width: 1060px;
  margin: 0 auto;
  padding: 30px 20px 50px;
  box-sizing: border-box;
}

.team-page > h1 {
  color: var(--accent-color);
  text-align: center;
  margin-bottom: 8px;
}

.team-page .intro {
  color: var(--accent-color);
  text-align: center;
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

/* Gruppen-Block */
.team-group {
  background-color: var(--inner-bg);
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, .05);
  padding: 24px;
  margin-bottom: 32px;
  box-sizing: border-box;
}

.team-group h2 {
  color: var(--accent-color);
  margin: 0 0 4px;
}

.team-group .group-time {
  color: var(--primary-color);
  font-weight: bold;
  margin: 0 0 20px;
}

/* Karten-Raster */
.team-grid {
  display: grid;
  /* 240px Mindestbreite ergibt auf 1060px drei bis vier Spalten,
     auf dem Tablet zwei, auf dem Handy eine. */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin-bottom: 24px;
  align-items: start;
}

.team-card {
  text-align: center;
  color: var(--accent-color);
}

.team-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  display: block;
  background-color: var(--secondary-color);
  border: 3px solid var(--secondary-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}

.team-card h3 {
  margin: 0 0 6px;
  color: var(--accent-color);
  font-size: 1.05em;
}

.team-card p {
  margin: 0;
  font-size: 0.9em;
  line-height: 1.5;
}

/* Anmelde-Button */
.team-signup-btn {
  background: var(--primary-color);
  color: #fff;
  border: 1px solid transparent;
  padding: 10px 22px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
}

.team-signup-btn:hover {
  background: var(--secondary-color);
  color: var(--accent-color);
  border: 1px solid var(--primary-color);
  text-decoration: none;
}

/* Mobile */
@media (max-width: 600px) {
  .team-page { padding: 20px 15px 40px; }
  .team-group { padding: 18px; }
  .team-grid { gap: 16px; }
}


/* =========================================================
   PROFILE (Unser Team)
   - Anker-Ziel der Links von online-gruppen.html
   - Geschichte in <details>: funktioniert ohne JavaScript,
     Tastatur und Screenreader gratis (Projektregel)
   - :hover nur für feine Zeiger, Touch nutzt :active
   ========================================================= */

/* Hinweis-Kasten, solange die Geschichten fehlen */
.team-hint {
  max-width: 640px;
  margin: 0 auto 32px;
  padding: 12px 16px;
  background: var(--inner-bg);
  border: 1px solid var(--accent-color);
  border-radius: 6px;
  color: var(--accent-color);
  font-size: 0.9em;
  line-height: 1.5;
  text-align: center;
}

.team-hint strong {
  color: var(--accent-color);
}

/* Karte */
.team-card {
  background: var(--inner-bg);
  border-radius: 10px;
  padding: 22px 18px 18px;
  box-shadow: 0 4px 14px rgba(64, 73, 134, 0.08);
  /* Der Header ist position: fixed – ohne diesen Abstand landet ein
     Anker-Sprung (team.html#ilter) unter dem Header. */
  scroll-margin-top: 110px;
}

/* Portrait: Rundung und oranger Ring wie auf freundeskreise-baden
   (.member-ticker__box). Die PNGs sind 400x400, width/height stehen im
   HTML, damit beim Laden nichts springt – CSS skaliert auf 140px. */
.team-photo {
  width: 140px;
  height: 140px;
  border: 3px solid rgba(242, 135, 29, 0.6);
  box-shadow: 0 8px 20px rgba(64, 73, 134, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06);
}

.team-card__name {
  margin: 0 0 8px;
  color: var(--accent-color);
  font-size: 1.15em;
  font-weight: 700;
  text-align: center;
}

/* Treffen, die die Person begleitet */
.team-card__groups {
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.team-badge {
  display: inline-block;
  background: var(--secondary-color);
  color: var(--accent-color);
  border: 1px solid rgba(64, 73, 134, 0.18);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.74em;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

/* Optionaler Kurzsatz unter den Badges (noch nicht im HTML gefüllt) */
.team-card__lead {
  margin: 0 0 12px;
  font-size: 0.88em;
  line-height: 1.5;
  color: var(--accent-color);
  text-align: center;
}

/* --- Geschichte: <details> ------------------------------------------ */
.team-bio {
  border-top: 1px solid rgba(64, 73, 134, 0.12);
  padding-top: 10px;
  text-align: left;
}

.team-bio > summary {
  /* Standard-Dreieck entfernen, eigener Chevron unten */
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 0.9em;
  padding: 6px 4px;
  border-radius: 4px;
}

.team-bio > summary::-webkit-details-marker {
  display: none;
}

/* Chevron, dreht sich beim Aufklappen */
.team-bio > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  flex-shrink: 0;
  margin-top: -2px;
}

.team-bio[open] > summary::after {
  transform: rotate(-135deg);
  margin-top: 2px;
}

.team-bio > summary:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.team-bio__body {
  padding: 4px 2px 6px;
  font-size: 0.9em;
  line-height: 1.6;
  color: var(--accent-color);
}

.team-bio__body p {
  margin: 0 0 10px;
}

.team-bio__body p:last-child {
  margin-bottom: 0;
}

@media (hover: hover) and (pointer: fine) {
  .team-bio > summary:hover {
    background: var(--secondary-color);
  }
}

.team-bio > summary:active {
  background: var(--secondary-color);
}

@media (prefers-reduced-motion: reduce) {
  .team-bio > summary::after { transition: none; }
}

/* Abschluss-Absatz */
.team-outro {
  max-width: 640px;
  margin: 8px auto 0;
  text-align: center;
  font-size: 0.9em;
  line-height: 1.6;
  color: var(--accent-color);
}

.team-outro a {
  color: var(--primary-color);
  font-weight: bold;
}

@media (max-width: 600px) {
  .team-card { scroll-margin-top: 90px; }
  .team-hint { margin-bottom: 24px; }
}

/* Profile, deren Geschichte noch fehlt: gedämpfte Beschriftung plus
   ein kleines "in Kürze"-Label. Ehrlicher als ein Aufklapper, der
   aussieht als läge Text dahinter. */
.team-bio__soon {
  display: inline-block;
  background: var(--secondary-color);
  color: var(--accent-color);
  border: 1px solid rgba(64, 73, 134, 0.18);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.team-bio--leer > summary {
  color: var(--accent-color);
  opacity: 0.85;
}

/* --- Aufgeklapptes Profil über die ganze Breite ---------------------
   Eine 12-Absatz-Geschichte in einer 240px-Spalte liest sich schlecht.
   Sobald ein <details> offen ist, spannt die Karte über alle Spalten
   und der Text bekommt eine lesbare Zeilenlänge.
   :has() wird von allen aktuellen Browsern unterstützt; wo nicht,
   bleibt die Karte in ihrer Spalte – funktioniert, nur enger.
------------------------------------------------------------------- */
.team-card:has(.team-bio[open]) {
  grid-column: 1 / -1;
}

.team-card:has(.team-bio[open]) .team-bio__body {
  max-width: 68ch;
  margin-left: auto;
  margin-right: auto;
}

/* Auf breiten Schirmen das offene Profil zweispaltig: Portrait und
   Kopfdaten links, Geschichte rechts. */
@media (min-width: 900px) {
  .team-card:has(.team-bio[open]) {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 8px 28px;
    align-items: start;
    text-align: left;
  }
  .team-card:has(.team-bio[open]) .team-photo {
    grid-column: 1;
    grid-row: 1 / span 3;
    margin: 0 auto;
  }
  .team-card:has(.team-bio[open]) .team-card__name,
  .team-card:has(.team-bio[open]) .team-card__groups,
  .team-card:has(.team-bio[open]) .team-card__lead {
    grid-column: 2;
    text-align: left;
  }
  .team-card:has(.team-bio[open]) .team-card__groups {
    justify-content: flex-start;
  }
  .team-card:has(.team-bio[open]) .team-bio {
    grid-column: 2;
  }
  .team-card:has(.team-bio[open]) .team-bio > summary {
    justify-content: flex-start;
  }
  .team-card:has(.team-bio[open]) .team-bio__body {
    margin-left: 0;
  }
}

/* --- Beschriftung wechselt beim Auf- und Zuklappen ------------------
   <details> klappt nativ wieder zu, aber die Beschriftung sagte im
   offenen Zustand weiter "Meine Geschichte" – man sah nicht, dass
   derselbe Klick wieder schließt. Beide Varianten stehen im HTML, das
   Umschalten läuft rein über [open]. Kein JavaScript.
------------------------------------------------------------------- */
.team-bio__less {
  display: none;
}

.team-bio[open] > summary .team-bio__more {
  display: none;
}

.team-bio[open] > summary .team-bio__less {
  display: inline;
}

/* Im offenen Zustand als klar erkennbare Schaltfläche, damit der Weg
   zurück nicht gesucht werden muss. */
.team-bio[open] > summary {
  background: var(--secondary-color);
  border: 1px solid rgba(64, 73, 134, 0.18);
}
