/*
 * =============================================================================
 * SPEICHER 7 – Leistungsseiten (leistungen.css)
 * =============================================================================
 * Gemeinsame Styles für: das-wohnen.html, die-pflege.html, das-quartier.html
 * =============================================================================
 */

/* Galerie-Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.gallery-grid .gallery-item {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
}

.gallery-grid .gallery-item--large {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
}

.gallery-grid .gallery-item picture {
  display: block;
  width: 100%;
  height: 100%;
}

.gallery-grid .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-grid .gallery-item:hover img {
  transform: scale(1.04);
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-grid .gallery-item--large {
    grid-column: span 2;
    grid-row: span 1;
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid .gallery-item--large {
    grid-column: span 1;
  }
}

/* Content-Grid Bilder: Schatten und Border-Radius */
.content-grid picture {
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(30, 58, 95, 0.18);
}

.content-grid picture img {
  display: block;
  width: 100%;
  height: auto;
}

/* Portrait-Bilder im Content-Grid auf 4:3 begrenzen */
.content-grid picture.picture--cover {
  aspect-ratio: 4 / 3;
}

.content-grid picture.picture--cover img {
  height: 100%;
  object-fit: cover;
  object-position: center 65%;
}

/* Feature-Liste (Ausstattungsmerkmale) */
.feature-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  list-style: none;
  margin-top: var(--space-md);
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.feature-list li::before {
  content: '';
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23C8915A'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

@media (max-width: 640px) {
  .feature-list {
    grid-template-columns: 1fr;
  }
}

/* POI-Liste (Das Quartier) */
.poi-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  list-style: none;
}

.poi-item {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
  background-color: var(--color-white);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius);
}

.poi-item__icon {
  width: 36px;
  height: 36px;
  color: var(--color-accent);
  flex-shrink: 0;
}

.poi-item__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 2px;
}

.poi-item__text {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0;
  max-width: none;
}

@media (max-width: 640px) {
  .poi-list {
    grid-template-columns: 1fr;
  }
}

/* Pflegegrad-Tabelle */
.pflegegrad-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin-top: var(--space-md);
}

.pflegegrad-table th {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.pflegegrad-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: var(--border-width) solid var(--color-border);
  color: var(--color-text);
  vertical-align: top;
}

.pflegegrad-table tr:last-child td {
  border-bottom: none;
}

.pflegegrad-table tr:nth-child(even) td {
  background-color: var(--color-primary-light);
}

.pflegegrad-table .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

@media (max-width: 640px) {
  .pflegegrad-table thead {
    display: none;
  }

  .pflegegrad-table,
  .pflegegrad-table tbody,
  .pflegegrad-table tr,
  .pflegegrad-table td {
    display: block;
  }

  .pflegegrad-table tr {
    margin-bottom: var(--space-sm);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .pflegegrad-table tr:last-child {
    margin-bottom: 0;
  }

  .pflegegrad-table td {
    padding: var(--space-xs) var(--space-sm);
    border-bottom: var(--border-width) solid var(--color-border);
    background-color: transparent;
    font-size: var(--text-sm);
  }

  .pflegegrad-table td:last-child {
    border-bottom: none;
  }

  .pflegegrad-table td::before {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    margin-bottom: 2px;
  }

  .pflegegrad-table td:nth-child(1)::before { content: "Pflegegrad"; }
  .pflegegrad-table td:nth-child(2)::before { content: "Sachleistungsbetrag"; }
  .pflegegrad-table td:nth-child(3)::before { content: "Pflegestufe"; }
}

/* Lead-Text in Primary-Sections (CTA) */
.section--primary .lead {
  color: rgba(255, 255, 255, 0.82);
}

/* Zentrierte Button-Gruppe */
.btn-group--center {
  justify-content: center;
}

@media (max-width: 640px) {
  .btn-group--center {
    flex-direction: column;
    align-items: center;
  }

  .btn-group--center .btn {
    width: 100%;
    text-align: center;
  }
}

/* Google Maps Zwei-Klick-Komponente */
.map-wrapper {
  position: relative;
  aspect-ratio: 16 / 6;
  min-height: 320px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--color-primary-light);
}

.map-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-xl);
  text-align: center;
  z-index: 2;
}

.map-overlay__address {
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.map-overlay__notice {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 36ch;
  margin: 0 auto var(--space-md);
}

.map-overlay__notice a {
  color: var(--color-primary);
}

.map-frame-container {
  position: absolute;
  inset: 0;
  display: none;
}

.map-caption {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-sm);
  text-align: center;
}

@media (max-width: 640px) {
  .map-wrapper {
    aspect-ratio: 4 / 3;
    min-height: 260px;
  }

  .map-overlay {
    padding: var(--space-md) var(--space-sm);
    gap: var(--space-sm);
  }

  .map-overlay__notice {
    max-width: none;
    font-size: var(--text-xs);
    margin-bottom: var(--space-sm);
  }
}
