:root {
  /* Colors */
  --primary-color: #ceccd7;
  --text-color: #000000;
  --text-secondary: #555;
  --background-color: #f4f4f4;
  --link-color: #6D8CB2;
  --link-hover-color: #B7C4D4;
  --border-color: #ddd;
  --therapist-border: #b5b3c0;

  /* Typography */
  --font-primary: 'Montserrat', Arial, sans-serif;
  --h1-size: 2.5em;
  --h2-size: 2em;
  --body-size: 16px;
  --small-size: 14px;

  /* Spacing */
  --section-padding: 20px;
  --container-max-width: 1200px;
  --section-margin: 40px;
  --gap-small: 10px;
  --gap-medium: 15px;
  --gap-large: 30px;

  /* Layout */
  --border-radius: 10px;
  --box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  color: var(--text-color);
  background-color: var(--background-color);
  line-height: 1.6;
  font-size: var(--body-size);
}

/* Layout Components */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--section-padding);
}

.section {
  margin: var(--section-margin) auto;
}

/* Header Styles */
header {
  background-color: var(--primary-color);
  padding: var(--gap-large);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--section-padding);
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.logo-container {
  max-width: 600px;
}

.logo {
  max-width: 100%;
  height: auto;
}

/* Address Styles */
.address-container {
  text-align: right;
  font-size: 1.1em;
  color: var(--text-secondary);
}

.address-container p {
  margin: 0;
}

/* Section Styles */
.content-section {
  max-width: 800px;
  margin: var(--section-margin) auto;
  padding: var(--section-padding);
}

.content-section h1 {
  text-align: center;
  font-size: var(--h1-size);
  margin-bottom: var(--gap-medium);
}

.content-section p {
  font-size: 1.1em;
  color: var(--text-secondary);
  margin-bottom: var(--gap-medium);
  text-align: justify;
}

/* Therapist Cards */
.therapists {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-medium);
}

.therapists .row {
  display: flex;
  gap: var(--gap-medium);
  width: 100%;
}

/* Therapist Cards - Updated Styles */
.therapist {
  background: var(--primary-color);
  border-radius: var(--border-radius);
  padding: var(--section-padding);
  flex: 1 1 300px;
  max-width: calc(50% - var(--gap-medium));
  display: flex;
  flex-direction: column;
  gap: var(--gap-medium);
  box-shadow: var(--box-shadow);
  height: 100%;
  /* Ensure all cards are the same height */
}

/* Three-column layout for specific rows */
.three-columns {
  display: flex;
  gap: var(--gap-medium);
  width: 100%;
}

.three-columns .therapist {
  flex: 1 1 calc(33.333% - var(--gap-medium));
  max-width: calc(33.333% - var(--gap-medium));
}

.therapist img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  align-self: center;
  /* filter: grayscale(100%); */
  transition: filter 0.3s ease;
}

.therapist img:hover {
  filter: grayscale(0%);
}

.therapist .name {
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 0px;
}

.therapist .designation {
  margin-top: 0px;
  font-size: 0.9em;
  /* Reduced from var(--body-size) */
  color: var(--text-secondary);
  text-align: center;
  flex-grow: 0;
  line-height: 1.3;
  /* Tighter line spacing */
}

.therapist .designation p {
  margin-bottom: 3px;
  /* Reduced spacing between lines */
}

/* Create a spacer to push offer and contact to bottom */
.therapist-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Container for offer and contact to keep them aligned */
.therapist-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--gap-small);
}

.therapist .offer {
  font-size: var(--small-size);
  text-align: center;
  padding: var(--gap-small) 0;
  border: none;
  /* Remove border */
}

.therapist .contact {
  text-align: center;
  font-size: var(--small-size);
  padding: var(--gap-small) 0;
  border: none;
  /* Remove border */
}

/*
.button {
  margin-top: var(--gap-small);
}
*/
/* Links and Buttons */

.button {
  display: inline-block;
  padding: 8px 12px;
  background-color: var(--link-color);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s ease;
  text-align: center;
  width: 250px;
  /* Add fixed width to make button narrower */
  margin: 0 auto;
  /* Center the button */
  display: block;
  /* Make button take full width for margin auto to work */
}

.button:hover {
  background-color: var(--link-hover-color);
}

.mail-link {
  color: inherit;
  text-decoration: none;
}

.mail-link:hover {
  text-decoration: underline;
}

/* Map Container */
.map-container {
  display: flex;
  justify-content: center;
  margin: var(--section-margin) var(--section-padding);
}

.map-container iframe {
  width: 80%;
  height: 400px;
  border: 0;
  border-radius: var(--border-radius);
}

/* Map Section */
section.map-section {
  margin-top: 80px;
  /* Increased top margin for more space */
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: var(--section-padding);
  margin-top: var(--section-margin);
}

footer #impressum-link {
  color: white;
  text-decoration: none;
  cursor: pointer;
}

footer #impressum-link:hover {
  text-decoration: underline;
}

.footer-logo {
  width: 400px;
  height: auto;
}

/* Modal/Popup Styles */
.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: var(--border-radius);
  padding: var(--section-padding) var(--section-padding) calc(var(--section-padding) * 2);
  box-shadow: var(--box-shadow);
  z-index: 1000;
  max-width: 90%;
  max-height: 80%;
  overflow-y: auto;
}

.modal h3 {
  font-size: 1.5em;
  margin-bottom: 20px;
  color: var(--text-color);
}

.modal h4 {
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--text-color);
}

.modal p {
  margin-bottom: 5px;
  color: var(--text-secondary);
}

.modal #close-popup {
  margin-top: 30px;
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

a:focus,
button:focus {
  outline: 2px solid var(--link-color);
  outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --h1-size: 1.8em;
    --h2-size: 1.6em;
    --body-size: 14px;
    --section-padding: 15px;
    --gap-medium: 10px;
  }

  .header-container {
    flex-direction: column;
    text-align: center;
    gap: var(--gap-large);
    padding: var(--gap-medium);
  }

  .logo-container {
    max-width: 100%;
  }

  .logo {
    width: 100%;
    max-width: 400px;
  }

  .address-container {
    text-align: center;
    margin-top: 0;
    font-size: 0.9em;
  }

  .content-section {
    padding: var(--gap-medium);
  }

  .content-section h1 {
    font-size: 1.6em;
    line-height: 1.3;
  }

  .content-section p {
    font-size: 1em;
    line-height: 1.5;
  }

  .therapists .row {
    flex-direction: column;
  }

  .three-columns {
    flex-direction: column;
  }

  .therapist {
    max-width: 100%;
    padding: var(--gap-medium);
  }

  .three-columns .therapist {
    max-width: 100%;
  }

  .therapist .name {
    font-size: 18px;
  }

  .therapist .designation {
    font-size: 0.85em;
  }

  .button {
    width: 100%;
    max-width: 280px;
    padding: 10px;
    font-size: 0.9em;
  }

  .map-container iframe {
    width: 100%;
    height: 300px;
  }
}

@media (max-width: 480px) {
  :root {
    --h1-size: 1.4em;
    --h2-size: 1.2em;
    --body-size: 13px;
    --section-padding: 10px;
  }

  .header-container {
    padding: var(--gap-small);
  }

  .logo {
    max-width: 300px;
  }

  .address-container {
    font-size: 0.85em;
  }

  .therapist {
    padding: var(--gap-small);
  }

  .therapist img {
    width: 100px;
    height: 100px;
  }

  .therapist .name {
    font-size: 16px;
  }

  .therapist .designation {
    font-size: 0.8em;
  }

  .therapist .offer,
  .therapist .contact {
    font-size: 0.85em;
  }

  .button {
    padding: 8px;
    font-size: 0.85em;
  }

  .map-container iframe {
    height: 250px;
  }

  .footer-logo {
    width: 180px;
  }
}

/* Verbesserte Touch-Interaktion für mobile Geräte */
@media (hover: none) {
  .button {
    padding: 12px;
    /* Größere Touch-Fläche */
  }

  .button:active {
    background-color: var(--link-hover-color);
    transform: scale(0.98);
  }
}