/* ===== Grundlagen & Scrollverhalten ===== */
html {
  scroll-padding-top: 1rem;
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #fffbf0;
  color: #4e2e0e;
}
/* Hintergrund als eigene fixierte Ebene statt "background-attachment: fixed":
   gleiche Optik, aber der Browser muss beim Scrollen nicht mehr die ganze Seite neu zeichnen
   (und es funktioniert auch auf iPhone/iPad). */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('img/orange1.webp') center/cover no-repeat, #fffbf0;
  background-blend-mode: lighten;
  pointer-events: none;
}
body.menu-open {
  overflow: hidden;
}

/* ===== Header ===== */
.header-bg {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  filter: brightness(0.5) saturate(1.1);
}
.header-overlay {
  position: relative;
  z-index: 2;
  color: #fff;
  text-shadow: 0 2px 12px #a0522d, 0 1px 2px #000;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 152, 0, 0.15);
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}
.header-overlay h1 {
  font-size: 2.2rem;
  margin: 0;
  letter-spacing: 1px;
}
header {
  color: #fff;
}
header nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}
header nav a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s;
}
header nav a:hover,
header nav a.is-active {
  color: #ffd600;
}

/* ===== Inhaltsboxen ===== */
.container {
  max-width: 1100px;
  margin: 2.5rem auto;
  padding: 2.2rem 1.5rem;
  background: rgba(255, 251, 240, 0.85);
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(160,82,45,0.13);
  position: relative;
  z-index: 1;
  /* backdrop-filter entfernt: kostete beim Scrollen viel Rechenleistung,
     brachte über dem fast einfarbigen Hintergrund optisch nichts */
}
.container h2, .container h3,
.section-narrow h2, .section-narrow h3 {
  color: #b45309;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.container p, .container li {
  color: #3a2a13;
  font-size: 1.13rem;
  line-height: 1.7;
  font-weight: 400;
}

/* ===== Abschnitte mit Hintergrundbild (vorher 4x identischer Code) ===== */
.bg-section {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.bg-section::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0.32;
  filter: blur(4px) brightness(1.1);
}
#praxis::before            { background-image: url('img/arzt.webp'); }
#fussambulanz::before      { background-image: url('img/fuss.webp'); }
#ernaehrungsmedizin::before { background-image: url('img/obst.webp'); }
#schulungszentrum::before  { background-image: url('img/schulung.webp'); }
.bg-section .container {
  background: rgba(255, 251, 240, 0.9);
}

/* ===== Team ===== */
#team h2 {
  color: #b45309;
}
#team .team-grid {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.team-card {
  background: #fffbf0;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(160,82,45,0.10);
  padding: 2rem 1rem 1.5rem 1rem;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid #ffb300;
}
.team-card:hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 6px 24px rgba(255,152,0,0.18);
}
.team-card img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 1rem;
  border: 3px solid #ff9800;
  background: #fff3e0;
}
.team-card h4 {
  margin: 0.5rem 0 0.2rem 0;
  color: #b45309;
  font-size: 1.15rem;
}
.team-card p {
  color: #4e2e0e;
  font-size: 1rem;
  margin: 0;
}

/* ===== Kontakt & Impressum ===== */
#kontakt h2 {
  color: #b45309;
}
#kontakt a {
  color: inherit;
}
.section-narrow {
  max-width: 1100px;
  margin: 2.5rem auto;
  padding: 2.2rem 1.5rem;
  background: rgba(255, 251, 240, 0.85);
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(160,82,45,0.13);
  position: relative;
  z-index: 1;
}
.kontakt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: flex-start;
  margin-top: 1.5rem;
}
.kontakt-info p, .kontakt-adresse p {
  margin-top: 0;
  margin-bottom: 1.1rem;
}
.kontakt-adresse {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  padding: 1.2rem 1rem;
  box-shadow: 0 2px 8px rgba(160,82,45,0.07);
  color: #3a2a13;
  font-size: 1.08rem;
}

/* ===== Footer ===== */
footer {
  background: #b45309;
  color: #fff;
  padding: 2rem 1.5rem 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
}
footer a {
  color: #fff;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.footer-a11y h2 {
  font-size: 1.2rem;
  margin: 0 0 0.6rem;
  color: #fff;
}
.footer-a11y p, .footer-a11y li {
  margin: 0 0 0.6rem;
}
.footer-a11y ul {
  margin: 0 0 0.8rem;
  padding-left: 1.2rem;
}
.footer-copy {
  text-align: center;
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.4);
}

/* ===== Menü-Button (Hamburger) ===== */
.hamburger {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 10000001;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #b45309; /* Kontrast Weiß 5:1 (vorher #ff9800 = 2,2:1) */
  box-shadow: 0 4px 16px rgba(160,82,45,0.25);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: opacity 0.3s, visibility 0.3s, background 0.2s;
}
.hamburger:hover {
  background: #a0522d;
}
.hamburger span {
  display: block;
  height: 3px;
  width: 24px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}
/* Desktop: Menü-Button erst zeigen, wenn die Kopfzeile mit dem Menü weggescrollt ist */
@media (min-width: 901px) {
  body:not(.scrolled) .hamburger:not(.active) {
    opacity: 0;
    visibility: hidden;
  }
}

/* ===== Vollbild-Menü ===== */
#floating-menu {
  position: fixed;
  inset: 0;
  background: #b45309;
  z-index: 10000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden; /* geschlossenes Menü ist nicht mehr per Tab-Taste erreichbar */
  transition: opacity 0.3s, visibility 0s linear 0.3s;
}
#floating-menu.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s, visibility 0s;
}
#floating-menu ul {
  list-style: none;
  padding: 2rem 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  align-items: center;
}
#floating-menu li {
  font-size: 2rem;
}
#floating-menu a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  letter-spacing: 1px;
  transition: color 0.2s;
}
#floating-menu a:hover,
#floating-menu a.is-active {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
}

/* ===== Nach-oben-Button ===== */
#scrollTopBtn {
  position: fixed;
  right: 2.2rem;
  bottom: 2.2rem;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #b45309;
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(160,82,45,0.18);
  font-size: 2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background 0.2s, transform 0.2s;
  z-index: 9999999;
}
body.scrolled #scrollTopBtn {
  opacity: 1;
  visibility: visible;
}
#scrollTopBtn:hover {
  background: #a0522d;
  transform: scale(1.08);
}

/* ===== Tablet & Handy ===== */
@media (max-width: 900px) {
  header nav {
    display: none; /* auf kleinen Bildschirmen übernimmt das Vollbild-Menü */
  }
  .kontakt-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .kontakt-adresse {
    padding: 1rem 0.5rem;
    font-size: 1rem;
  }
}
@media (max-width: 700px) {
  .header-bg {
    height: 80px;
  }
  .header-overlay {
    padding: 1rem 0.5rem;
  }
  .header-overlay h1 {
    font-size: 1.1rem;
  }
  .hamburger {
    top: 16px;
    right: 12px;
    width: 44px;
    height: 44px;
  }
  #team .team-grid {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
  }
  .container {
    padding: 1.2rem 0.5rem;
    margin: 1.2rem 0.2rem;
  }
  .team-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .team-card {
    padding: 1.2rem 0.5rem 1rem 0.5rem;
  }
  .team-card img {
    width: 70px;
    height: 70px;
  }
  .container p, .container li {
    font-size: 1rem;
  }
  .section-narrow {
    padding: 1.2rem 0.5rem;
    margin: 1.2rem 0.2rem;
  }
  #scrollTopBtn {
    right: 1rem;
    bottom: 1rem;
    width: 48px;
    height: 48px;
    font-size: 1.6rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
  }
}

/* ===== Barrierefreiheit ===== */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100000000;
  background: #4e2e0e;
  color: #fff;
  padding: 0.8rem 1.2rem;
  border-radius: 0 0 8px 8px;
  font-weight: bold;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
}
main:focus {
  outline: none;
}
/* Deutlich sichtbarer Tastatur-Fokus */
:focus-visible {
  outline: 3px solid #4e2e0e;
  outline-offset: 3px;
  border-radius: 4px;
}
header :focus-visible,
#floating-menu :focus-visible,
footer :focus-visible,
.skip-link:focus-visible {
  outline-color: #fff;
}
.hamburger:focus-visible,
#scrollTopBtn:focus-visible {
  outline: 3px solid #4e2e0e;
  outline-offset: 3px;
  border-radius: 50%;
}
.container h4 {
  color: #b45309;
}
#impressum a {
  color: #7a3a12;
}

/* ===== Werdegang-Popup der Ärzte ===== */
.team-card.has-bio {
  position: relative;
  cursor: help;
}
.team-card.has-bio:hover,
.team-card.has-bio:focus-within,
.team-card.has-bio.bio-open {
  z-index: 50;
}
.bio-hint {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: #b45309;
  font-weight: bold;
}
.bio-popup {
  position: absolute;
  left: 50%;
  top: calc(100% + 12px);
  transform: translateX(-50%);
  width: min(420px, 90vw);
  background: #fff;
  color: #3a2a13;
  text-align: left;
  border: 2px solid #b45309;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(160,82,45,0.28);
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.bio-popup::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 16px;
  height: 16px;
  background: #fff;
  border-left: 2px solid #b45309;
  border-top: 2px solid #b45309;
}
.team-card.has-bio:hover .bio-popup,
.team-card.has-bio:focus .bio-popup,
.team-card.has-bio.bio-open .bio-popup {
  opacity: 1;
  visibility: visible;
}
.team-card.has-bio.bio-dismissed .bio-popup {
  opacity: 0;
  visibility: hidden;
}
.bio-popup .bio-title {
  margin: 0 0 0.5rem;
  font-weight: bold;
  color: #b45309;
  font-size: 1.05rem;
}
.bio-popup ul {
  margin: 0;
  padding-left: 1.1rem;
}
.bio-popup li {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  line-height: 1.5;
}
/* Handy: Popup unter der Karte im Textfluss statt schwebend */
@media (max-width: 700px) {
  .bio-popup {
    position: static;
    transform: none;
    width: auto;
    margin-top: 0.8rem;
    box-shadow: none;
    display: none;
  }
  .bio-popup::before { display: none; }
  .team-card.has-bio.bio-open .bio-popup { display: block; }
  .team-card.has-bio:hover:not(.bio-open) .bio-popup { display: none; }
}

/* ===== Aktuelles ===== */
.news-box {
  border: 3px solid #b45309;
}
.news-item {
  border-left: 5px solid #ff9800;
  padding: 0.2rem 0 0.2rem 1rem;
  margin: 1.2rem 0;
}
.news-item h3 {
  margin: 0 0 0.3rem;
  font-size: 1.2rem;
}
.news-item p {
  margin: 0 0 0.3rem;
}
/* Kopfzeile: Praxisname nicht umbrechen, Menü bei mittlerer Breite enger */
.header-overlay {
  gap: 1.5rem;
}
.header-overlay h1 {
  white-space: nowrap;
}
@media (max-width: 1200px) {
  header nav ul { gap: 1rem; }
  header nav a { font-size: 0.95rem; }
  .header-overlay h1 { font-size: 1.8rem; }
}
@media (max-width: 700px) {
  .header-overlay h1 { font-size: 1.1rem; }
}
