/* ============================================================
   TEAM – Liquid Glass Design
   ============================================================ */

/* ── Seitencontainer: kein max-width-Overflow für Hero ───── */
.team-page {
  padding-top: 0;
}

.main:has(.team-page) {
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
  max-width: 100%;
  padding-bottom: 0;
}

/* ── Hero: Gruppenfoto (volle Breite, kein overflow-clip nötig) ── */
.team-hero {
  position: relative;
  width: 100%;
  /* Kein overflow:hidden hier – Overlap-Card liegt als Geschwister darunter */
}

.team-hero-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  min-height: 320px;
  max-height: 600px;
  overflow: hidden; /* Nur die Bild-Box clippt */
}

.team-hero-img-wrap img {
  width: 100%;
  height: 110%; /* Extra Höhe für Parallax-Bewegung */
  object-fit: cover;
  object-position: center top;
  display: block;
  will-change: transform;
  /* Kein CSS-Hover-Zoom – Parallax übernimmt die Bewegung */
}

/* Subtiler Gradient am unteren Bildrand */
.team-hero-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(17, 28, 16, 0.45) 100%
  );
  pointer-events: none;
}

/* ── Überlappendes Glas-Element ──────────────────────────── */
/* Negatives margin-top zieht die Karte über das Bild;
   die obere Hälfte liegt über dem Bild, die untere über dem Seiteninhalt. */
.team-overlap-wrap {
  max-width: var(--max-w);
  margin: -8rem auto 3rem;
  padding: 0 var(--pad-x);
  position: relative;
  z-index: 10;
}

.team-overlap-card {
  border-radius: var(--r-xl);
  overflow: hidden;
  /* Einheitlicher Glaseffekt – kein unterschiedlicher Hintergrund pro Sektion */
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(26px) saturate(1.8);
  -webkit-backdrop-filter: blur(26px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.18),
    0 4px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Obere Hälfte: weißer Text (liegt über dem Bild) */
.team-overlap-title {
  padding: 2rem 2.25rem 1.75rem;
  /* Kein eigener Hintergrund – Glaseffekt der Card wirkt durch */
}

.team-overlap-heading {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.team-overlap-sub {
  margin-top: 0.4rem;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

/* Untere Hälfte: dunkler Text (liegt über dem Seiteninhalt) */
.team-overlap-text {
  padding: 1.75rem 2.25rem 2rem;
  /* Kein eigener Hintergrund – Glaseffekt wirkt einheitlich durch */
  font-size: 1.025rem;
  line-height: 1.75;
  color: var(--c-text);
}

.team-page-header {
  padding: calc(var(--header-h) + 2.5rem) var(--pad-x) 1.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ── Inner-Container ─────────────────────────────────────── */
.team-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

/* ── Glass-Card (für Fallback) ───────────────────────────── */
.team-glass-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--r-xl);
  box-shadow:
    0 4px 24px rgba(120, 196, 58, 0.08),
    var(--sh-m);
}

.team-intro-card {
  padding: 2rem 2.25rem;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--c-text);
}

/* ── Sektion-Header ──────────────────────────────────────── */
.team-section {
  margin-bottom: 4rem;
}

.team-section-header {
  margin-bottom: 2rem;
}

.team-section-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(120, 196, 58, 0.12);
  border: 1px solid rgba(120, 196, 58, 0.3);
  color: var(--c-brand-hover);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

.team-section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

/* ── Ärzte-Grid ──────────────────────────────────────────── */
.team-doctors-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 42rem) {
  .team-doctors-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 64rem) {
  .team-doctors-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Arzt-Karte ──────────────────────────────────────────── */
.team-person-card {
  cursor: pointer;
}

.team-doctor-card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.07),
    0 1px 4px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform var(--tr-slow),
    box-shadow var(--tr),
    border-color var(--tr);
  display: flex;
  flex-direction: column;
}

.team-doctor-card:hover,
.team-doctor-card:focus-visible {
  transform: translateY(-6px) scale(1.01);
  box-shadow:
    0 16px 48px rgba(120, 196, 58, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-color: rgba(120, 196, 58, 0.4);
  outline: none;
}

.team-doctor-photo-wrap {
  position: relative;
  overflow: hidden;
}

.team-doctor-photo {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--c-light);
}

.team-doctor-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform var(--tr-slow);
  will-change: transform;
}

.team-doctor-card:hover .team-doctor-photo img {
  transform: scale(1.07);
}

.team-doctor-photo-glow {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.7), transparent);
  pointer-events: none;
}

.team-doctor-body {
  padding: 1.5rem 1.5rem 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

.team-doctor-specialty {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-brand-hover);
}

.team-doctor-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* Bio und Kontakt nur im Popup sichtbar, nicht auf der Übersicht */
.team-doctor-bio,
.team-doctor-contact {
  display: none;
}

.team-doctor-contact {
  display: none;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(120, 196, 58, 0.15);
}

.team-contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(120, 196, 58, 0.1);
  border: 1px solid rgba(120, 196, 58, 0.25);
  color: var(--c-brand-hover);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  transition:
    background var(--tr-fast),
    border-color var(--tr-fast),
    transform var(--tr-fast);
  text-decoration: none;
}

.team-contact-chip:hover {
  background: rgba(120, 196, 58, 0.2);
  border-color: var(--c-brand);
  transform: translateY(-1px);
}

/* ── Mitarbeitende Sektion ───────────────────────────────── */
.team-staff-section {
  padding-bottom: 4rem;
}

/* ── Karussell-Wrapper ───────────────────────────────────── */
/* Outer hat kein overflow:hidden → Schatten der Karten sichtbar */
.team-carousel-outer {
  position: relative;
  padding: 12px 0 16px; /* Platz für Box-Schatten */
}

.team-carousel {
  overflow-x: scroll;
  overflow-y: clip; /* clip ≠ hidden: kein Scroll-Container, Y-Overflow bleibt sichtbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Padding schafft Platz für Schatten der Karten;
     negatives Margin kompensiert den Layoutversatz */
  padding: 35px 0;
  margin: -35px 0;
  cursor: grab;
}

.team-carousel::-webkit-scrollbar {
  display: none;
}

.team-carousel:active {
  cursor: grabbing;
}

.team-carousel-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
}

/* ── Mitarbeitende Grid-Variante ─────────────────────────── */
/*
 * Spaltenanzahl wird per CSS Custom Properties übergeben:
 * --staff-cols-mobile  (Default 2)
 * --staff-cols-desktop (Default 5)
 * Beide Werte werden serverseitig als style-Attribut am Grid gesetzt.
 */
.team-staff-grid {
  display: grid;
  grid-template-columns: repeat(var(--staff-cols-mobile, 2), 1fr);
  gap: 1rem;
}

@media (min-width: 64rem) {
  .team-staff-grid {
    grid-template-columns: repeat(var(--staff-cols-desktop, 5), 1fr);
  }
}

/* Im Grid füllt die Karte die Spalte */
.team-staff-grid .team-staff-card {
  width: auto;
}

/* Foto im Grid etwas kleiner auf Mobile, damit mehrere Karten gut passen */
@media (max-width: 63.9rem) {
  .team-staff-grid .team-staff-photo-wrap {
    width: 72px;
    height: 72px;
  }
}

/* ── Mitarbeiter-Karte ───────────────────────────────────── */
.team-staff-card {
  flex: 0 0 auto;
  width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--r-xl);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform var(--tr),
    box-shadow var(--tr),
    border-color var(--tr);
  text-align: center;
}

.team-staff-card:hover,
.team-staff-card:focus-visible {
  transform: translateY(-5px) scale(1.03);
  box-shadow:
    0 12px 32px rgba(120, 196, 58, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-color: rgba(120, 196, 58, 0.4);
  outline: none;
}

.team-staff-photo-wrap {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(120, 196, 58, 0.3);
  box-shadow: 0 0 0 4px rgba(120, 196, 58, 0.08);
  background: var(--c-light);
  transition:
    border-color var(--tr),
    box-shadow var(--tr);
}

.team-staff-card:hover .team-staff-photo-wrap {
  border-color: var(--c-brand);
  box-shadow: 0 0 0 4px rgba(120, 196, 58, 0.18);
}

.team-staff-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform var(--tr-slow);
}

.team-staff-card:hover .team-staff-photo-wrap img {
  transform: scale(1.08);
}

.team-staff-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-muted);
  background: var(--c-light);
}

.team-staff-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.team-staff-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.3;
}

.team-staff-role {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--c-brand-hover);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* Weichblende links + rechts */
.team-carousel-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 5rem;
  pointer-events: none;
  z-index: 2;
}

.team-carousel-fade--left {
  left: 0;
  background: linear-gradient(to right, var(--c-bg), transparent);
}

.team-carousel-fade--right {
  right: 0;
  background: linear-gradient(to left, var(--c-bg), transparent);
}

/* ══════════════════════════════════════════════════════════
   POPUP MODAL
   ══════════════════════════════════════════════════════════ */

/* Overlay */
.team-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
}

.team-modal.is-open {
  pointer-events: auto;
}

/* Backdrop: Blur + Abdunkelung – animiert unabhängig vom Dialog */
.team-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 28, 16, 0);
  backdrop-filter: blur(0px) saturate(1);
  -webkit-backdrop-filter: blur(0px) saturate(1);
  transition:
    background 320ms ease,
    backdrop-filter 320ms ease,
    -webkit-backdrop-filter 320ms ease;
}

.team-modal.is-open .team-modal-backdrop {
  background: rgba(17, 28, 16, 0.55);
  backdrop-filter: blur(8px) saturate(0.9);
  -webkit-backdrop-filter: blur(8px) saturate(0.9);
}

/* Dialog-Wrapper: overflow:visible damit Pfeile außen sichtbar bleiben */
.team-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  overflow: visible;
  /* Einflug-Animation */
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition:
    transform 360ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 320ms ease;
}

.team-modal.is-open .team-modal-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Innere Box: Glaseffekt + overflow:hidden für border-radius-Clip */
.team-modal-inner {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--r-xl);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.22),
    0 8px 24px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Schließen-Button */
.team-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 2.25rem;
  height: 2.25rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text);
  cursor: pointer;
  transition:
    background var(--tr-fast),
    transform var(--tr-fast),
    color var(--tr-fast);
  box-shadow: var(--sh-s);
}

.team-modal-close:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: scale(1.1) rotate(90deg);
  color: var(--c-brand-hover);
}

/* Navigationspfeile */
.team-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 2.75rem;
  height: 2.75rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text);
  cursor: pointer;
  transition:
    background var(--tr-fast),
    transform var(--tr-fast),
    color var(--tr-fast),
    box-shadow var(--tr-fast);
  box-shadow: var(--sh-s);
}

.team-modal-nav--prev {
  left: -1.375rem;
}
.team-modal-nav--next {
  right: -1.375rem;
}

.team-modal-nav:hover {
  background: var(--c-brand);
  color: #fff;
  border-color: var(--c-brand);
  box-shadow: 0 4px 16px rgba(120, 196, 58, 0.35);
}

.team-modal-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Inhalt */
.team-modal-content {
  overflow-x: hidden; /* Verhindert horizontalen Scrollbalken bei Slide-Animation */
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
}

/* Personen-Panel */
.team-modal-person {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 360px;
}

@media (max-width: 560px) {
  .team-modal-person {
    grid-template-columns: 1fr;
  }
}

/* Foto-Seite */
.team-modal-photo {
  position: relative;
  overflow: hidden;
  background: var(--c-light);
  border-radius: var(--r-xl) 0 0 var(--r-xl);
}

@media (max-width: 560px) {
  .team-modal-photo {
    aspect-ratio: 3 / 4;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
  }
}

.team-modal-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Kein Foto: Platzhalter */
.team-modal-photo-placeholder {
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-muted);
  background: var(--c-light);
}

/* Info-Seite */
.team-modal-info {
  padding: 2rem 2rem 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
}

@media (max-width: 560px) {
  .team-modal-info {
    padding: 1.5rem;
  }
}

.team-modal-specialty {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-brand-hover);
}

.team-modal-name {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.25rem;
}

.team-modal-bio {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--c-text-muted);
  flex: 1;
  margin-top: 0.5rem;
}

/* Vertikal zentriert wenn keine Bio/Kontakt vorhanden (z.B. MFAs) */
.team-modal-info--centered {
  justify-content: center;
}

.team-modal-bio p {
  margin-bottom: 0.75rem;
}
.team-modal-bio p:last-child {
  margin-bottom: 0;
}

.team-modal-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(120, 196, 58, 0.15);
}

/* Seitenübergangs-Animation bei Pfeil-Navigation */
.team-modal-person {
  animation: modal-person-in 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modal-person-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.team-modal-person.slide-prev {
  animation-name: modal-person-in-prev;
}

@keyframes modal-person-in-prev {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Hintergrund-Dekoration ──────────────────────────────── */
.team-page::before,
.team-page::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(80px);
  opacity: 0.25;
}

.team-page::before {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(120, 196, 58, 0.5), transparent 70%);
  top: 10%;
  right: -10%;
}

.team-page::after {
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(120, 196, 58, 0.35),
    transparent 70%
  );
  bottom: 20%;
  left: -8%;
}

/* ── Reduced Motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .team-modal,
  .team-modal-dialog,
  .team-modal-backdrop {
    transition: none;
  }
  .team-modal-person {
    animation: none;
  }
  .team-hero-img-wrap img {
    will-change: auto;
  } /* Parallax deaktivieren */

  .team-doctor-card:hover,
  .team-staff-card:hover {
    transform: none;
  }

  .team-doctor-card:hover .team-doctor-photo img,
  .team-staff-card:hover .team-staff-photo-wrap img {
    transform: none;
  }
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 48rem) {
  .team-hero-img-wrap {
    aspect-ratio: auto;
    max-height: none;
    min-height: 0;
    margin-top: var(--header-h);
  }

  .team-hero-img-wrap img {
    height: auto;
    object-fit: contain;
  }
  .team-overlap-wrap {
    margin-top: -5rem;
  }
  .team-overlap-title {
    padding: 1.25rem 1.5rem 1.25rem;
  }
  .team-overlap-text {
    padding: 1.25rem 1.5rem 1.5rem;
  }
  .team-modal-nav--prev {
    left: -0.75rem;
  }
  .team-modal-nav--next {
    right: -0.75rem;
  }
  .team-modal {
    padding: 1rem;
  }
}
