/* ==========================================================================
   Bauprojekt Landingpage – Storytelling
   Robustes Layout, responsive für alle Endgeräte
   ========================================================================== */

/* --- Variablen --- */
:root {
  --color-bg: #f8f6f3;
  --color-bg-alt: #eeeae5;
  --color-text: #1a1a1a;
  --color-text-muted: #5c5c5c;
  --color-accent: #2d5a4a;
  --color-accent-hover: #234a3d;
  --color-border: #ddd9d3;
  --font-heading: "DM Serif Display", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --container-max: 72rem;
  --section-padding-y: clamp(2.5rem, 6vw, 6rem);
  --section-padding-x: clamp(1rem, 4vw, 1.5rem);
  --header-height: 3.5rem;
  --touch-min: 44px;
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --safe-left: env(safe-area-inset-left, 0);
  --safe-right: env(safe-area-inset-right, 0);
}

@media (min-width: 768px) {
  :root {
    --header-height: 4rem;
  }
}

/* --- Reset / Basis --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(0.9375rem, 2.5vw, 1rem);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent-hover);
}

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding-top: var(--safe-top);
  background: rgba(248, 246, 243, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 max(var(--section-padding-x), var(--safe-right)) 0 max(var(--section-padding-x), var(--safe-left));
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-text);
}

.logo:hover {
  color: var(--color-accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  padding: 0.5rem;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle-bar {
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.2s, opacity 0.2s;
}

.main-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 2rem;
}

.main-nav a {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.9375rem;
}

.main-nav a:hover {
  color: var(--color-text);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
    transform: translateY(-100%);
    visibility: hidden;
    opacity: 0;
    transition: transform 0.25s, visibility 0.25s, opacity 0.25s;
  }

  .main-nav.is-open {
    transform: translateY(0);
    visibility: visible;
    opacity: 1;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
  }
}

/* --- Container --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 max(var(--section-padding-x), var(--safe-left)) 0 max(var(--section-padding-x), var(--safe-right));
}

/* --- Sections --- */
.section {
  padding-top: var(--section-padding-y);
  padding-bottom: max(var(--section-padding-y), var(--safe-bottom));
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 400;
  margin: 0 0 1.5rem;
  color: var(--color-text);
  word-wrap: break-word;
}

.section-intro {
  color: var(--color-text-muted);
  margin: 0 0 2rem;
  max-width: 40rem;
}

.prose {
  max-width: 50rem;
  overflow-wrap: break-word;
}

.prose p {
  margin: 0 0 1rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: 1.125rem;
  color: var(--color-text-muted);
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: calc(var(--header-height) + var(--safe-top));
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  padding-bottom: var(--safe-bottom);
  overflow: hidden;
}

@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-top: calc(var(--header-height) + var(--safe-top) + 2rem);
    padding-bottom: 2rem;
  }

  .hero-scroll-hint {
    display: none;
  }
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(45, 90, 74, 0.4) 0%, rgba(30, 61, 51, 0.5) 100%);
  background-size: cover;
  background-position: center;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1.5rem var(--section-padding-x) 2rem;
  max-width: 36rem;
  width: 100%;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 5vw + 1rem, 3.5rem);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  color: #fff;
  word-wrap: break-word;
}

.hero-lead {
  font-size: clamp(0.9375rem, 2.5vw, 1.125rem);
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 1.5rem;
}

.hero-cta {
  display: inline-block;
  min-height: var(--touch-min);
  padding: 0.75rem 1.5rem;
  line-height: 1.2;
  background: #fff;
  color: var(--color-accent);
  font-weight: 500;
  font-size: 1rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.hero-cta:hover {
  background: var(--color-bg);
  color: var(--color-accent-hover);
}

.hero-scroll-hint {
  position: absolute;
  bottom: max(1.5rem, var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --- Highlights / Projektübersicht --- */
.section-highlights {
  background: var(--color-bg);
}

.highlights-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.highlight-card {
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-align: center;
}

.highlight-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
}

.highlight-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

.highlight-card h3 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.highlight-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

@media (min-width: 640px) {
  .highlights-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 900px) {
  .highlights-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }

  .highlight-card {
    padding: 2rem;
  }
}

/* --- Wohnungen --- */
.section-wohnungen {
  background: var(--color-bg-alt);
}

.wohnungen-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
  margin-left: auto;
  margin-right: auto;
  max-width: 1200px;
}

.wohnung-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.wohnung-image {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.wohnung-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wohnung-content {
  padding: 1.5rem;
}

.wohnung-content h3 {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.wohnung-specs {
  color: var(--color-accent);
  font-weight: 500;
  margin: 0 0 0.75rem;
}

.wohnung-content p {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
}

.wohnung-status {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

/* „Mehr Details“ öffnet Galerie-Popup */
.wohnung-card-more__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.15rem 0 1rem;
  padding: 0.2rem 0;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
  text-align: left;
}

.wohnung-card-more__btn::before {
  content: "";
  display: block;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  margin-top: -0.15rem;
  opacity: 0.65;
  flex-shrink: 0;
}

.wohnung-card-more__btn:hover {
  color: var(--color-accent);
}

.wohnung-card-more__btn:hover::before {
  opacity: 1;
}

.wohnung-card-more__btn:focus {
  outline: none;
}

.wohnung-card-more__btn:focus-visible {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  border-radius: 2px;
}

.wohnung-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.wohnung-card-actions .button {
  display: block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.button-outline {
  background: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}

.button-outline:hover {
  background: rgba(45, 90, 74, 0.08);
  color: var(--color-accent);
}

.status-frei {
  background: #e5f5ee;
  color: #1f6b53;
  font-size: 1.125rem;
  padding: 0.375rem 0.975rem;
}

.status-reserviert {
  background: #fff3dc;
  color: #8a5a00;
  font-size: 1rem;
  padding: 0.375rem 0.975rem;
}

.status-verkauft {
  background: #efefef;
  color: #5b5b5b;
}

.wohnung-content .button {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.wohnungen-table-wrap {
  margin-top: 2.5rem;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
}

.wohnungen-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.wohnungen-table caption {
  text-align: left;
  padding: 1rem 1.25rem 0.75rem;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--color-text);
}

.wohnungen-table th,
.wohnungen-table td {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--color-border);
  text-align: left;
  font-size: 0.95rem;
}

.wohnungen-table thead th {
  background: #f7f7f7;
  font-weight: 600;
  color: var(--color-text);
}

.wohnungen-table tbody tr:hover {
  background: #fafafa;
}

.button-small {
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
}

@media (min-width: 640px) {
  .wohnungen-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .wohnungen-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  .wohnung-content {
    padding: 2rem;
  }
}

/* --- Lage & Infrastruktur --- */
.section-lage {
  background: var(--color-bg);
}

.lage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

.lage-placeholder {
  aspect-ratio: 4/3;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-border);
}

.lage-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lage-karte {
  position: relative;
  aspect-ratio: 4/3;
  min-height: 280px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-border);
}

.lage-karte iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.lage-karte-link {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.lage-karte-link:hover {
  color: var(--color-accent);
  background: #fff;
}

.infrastruktur-list {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.infrastruktur-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.infrastruktur-item:last-child {
  border-bottom: none;
}

.infrastruktur-item strong {
  color: var(--color-accent);
}

@media (min-width: 900px) {
  .lage-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
  }
}

/* --- Bauträger --- */
.section-bautraeger {
  background: var(--color-bg-alt);
}

.bautraeger-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

.bautraeger-visual {
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
}

.bautraeger-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bautraeger-facts {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fact-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.fact-item:last-child {
  border-bottom: none;
}

.fact-item strong {
  color: var(--color-accent);
}

@media (min-width: 900px) {
  .bautraeger-content {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

/* --- Architektur --- */
.section-architektur {
  background: var(--color-bg);
}

.architektur-intro {
  margin-bottom: 2rem;
}

.architektur-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.architektur-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.architektur-visual {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.architektur-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.architektur-card h3 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1rem 1.5rem 0.5rem;
}

.architektur-card p {
  margin: 0 1.5rem 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

@media (min-width: 640px) {
  .architektur-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .architektur-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

/* --- Ablauf & Ansprechpartner --- */
.section-ablauf {
  background: var(--color-bg-alt);
}

.team-section {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--color-border);
}

.team-heading {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 2rem;
  text-align: center;
}

.team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

/* Eine einzelne Kontaktkarte zentrieren (nicht in Spalte 1 bei 2/3-Spalten-Grid) */
.team-grid:has(> .team-member:only-child) {
  justify-items: center;
}

.team-grid:has(> .team-member:only-child) .team-member {
  max-width: 22rem;
  width: 100%;
}

.team-member {
  text-align: center;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.team-photo {
  width: 120px;
  height: 120px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--color-accent);
}

.team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-member h4 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.team-member p {
  margin: 0 0 0.5rem;
  color: var(--color-text-muted);
}

.team-contact {
  font-size: 0.875rem;
  color: var(--color-accent);
}

@media (min-width: 640px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-grid:has(> .team-member:only-child) {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 900px) {
  .team-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  .team-grid:has(> .team-member:only-child) {
    grid-template-columns: 1fr;
  }
}

/* --- Testimonials --- */
.section-testimonials {
  background: var(--color-bg);
}

.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.testimonial-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 2rem;
}

.testimonial-content {
  margin-bottom: 1.5rem;
}

.testimonial-text {
  font-style: italic;
  color: var(--color-text);
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.testimonial-photo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.testimonial-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.testimonial-info strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.testimonial-info p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

@media (min-width: 640px) {
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* --- Ort (Legacy, für Kompatibilität) --- */
.section-ort {
  background: var(--color-bg-alt);
}

.ort-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

.ort-placeholder {
  aspect-ratio: 4/3;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-border);
}

.ort-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (min-width: 640px) {
  .ort-grid {
    gap: 2.5rem;
  }
}

@media (min-width: 900px) {
  .ort-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
  }
}

/* --- Timeline (Geschichte) --- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0.35rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  padding-left: 2.5rem;
  padding-bottom: 2rem;
}

@media (min-width: 640px) {
  .timeline-item {
    padding-left: 3rem;
    padding-bottom: 2.5rem;
  }
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  margin-left: -1px;
  border-radius: 50%;
  background: var(--color-accent);
}

.timeline-content h3 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.timeline-content p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

/* --- Konzept-Karten --- */
.konzept-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.konzept-card {
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

@media (min-width: 640px) {
  .konzept-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 900px) {
  .konzept-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  .konzept-card {
    padding: 2rem;
  }
}

.konzept-card h3 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.konzept-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}


/* --- Galerie --- */
.galerie-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.galerie-item {
  aspect-ratio: 4/3;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-border);
}

.galerie-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (min-width: 640px) {
  .galerie-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (min-width: 900px) {
  .galerie-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

/* --- Kontakt --- */
.section-kontakt {
  background: var(--color-bg);
}

.kontakt-intro {
  margin-bottom: 2rem;
}

.kontakt-form-wrapper {
  max-width: 28rem;
  margin: 0 auto;
}

.kontakt-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.kontakt-form label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
}

.kontakt-form .required {
  color: var(--color-accent);
}

.kontakt-form input[type="text"],
.kontakt-form input[type="email"],
.kontakt-form input[type="tel"],
.kontakt-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.4;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.kontakt-form input::placeholder,
.kontakt-form textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.8;
}

.kontakt-form input:focus,
.kontakt-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(45, 90, 74, 0.15);
}

.kontakt-form input:invalid:not(:placeholder-shown).form-touched,
.kontakt-form textarea:invalid:not(:placeholder-shown).form-touched {
  border-color: #b54;
}

.kontakt-form textarea {
  resize: vertical;
  min-height: 120px;
}

.form-error {
  font-size: 0.8125rem;
  color: #b54;
}

.form-error:empty {
  display: none;
}

.form-status {
  font-size: 0.9375rem;
  margin: 0;
  min-height: 1.4em;
}

.form-status.success {
  color: var(--color-accent);
}

.form-status.error {
  color: #b54;
}

.button-submit {
  margin-top: 0.25rem;
  min-height: var(--touch-min);
  padding: 0.875rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  cursor: pointer;
  border: none;
}

.button-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

button.button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  appearance: none;
}

.button {
  display: inline-block;
  min-height: var(--touch-min);
  padding: 0.75rem 1.5rem;
  line-height: 1.2;
  background: var(--color-accent);
  color: #fff;
  font-weight: 500;
  font-size: 1rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.button:hover {
  background: var(--color-accent-hover);
  color: #fff;
}

/* --- Modal: Wohnungsanfrage --- */
.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 35, 32, 0.55);
  cursor: pointer;
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  max-height: min(90vh, 640px);
  overflow-y: auto;
  margin: auto;
  padding: 1.5rem 1.5rem 1.75rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--color-border);
}

.modal__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.modal__close:hover,
.modal__close:focus-visible {
  color: var(--color-text);
  background: var(--color-bg-alt);
  outline: none;
}

.modal__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0 2rem 0.5rem 0;
  color: var(--color-text);
}

.modal__unit {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-accent);
  margin: 0 0 0.75rem;
}

.modal__intro {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: 0 0 1.25rem;
  line-height: 1.45;
}

.modal__form-wrap {
  margin: 0;
  max-width: none;
}

.modal__form-wrap .kontakt-form textarea {
  min-height: 100px;
}

/* --- Modal: Wohnungsdetails (Galerie + Infos) --- */
.modal--details {
  z-index: 2100;
}

.modal__dialog--details {
  max-width: min(56rem, 96vw);
  max-height: min(92vh, 900px);
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

.modal__dialog--details .modal__close {
  position: sticky;
  top: 0;
  right: auto;
  left: auto;
  align-self: flex-end;
  z-index: 5;
  margin: 0.35rem 0.35rem 0 0;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.detail-modal__gallery {
  flex: 0 0 auto;
  background: #1c1c1c;
}

.detail-gallery-mosaic {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  min-height: 200px;
  max-height: min(42vh, 380px);
}

.detail-gallery-mosaic__hero {
  grid-row: 1 / -1;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: block;
  overflow: hidden;
  background: #222;
}

.detail-gallery-mosaic__hero img {
  width: 100%;
  height: 100%;
  min-height: 200px;
  object-fit: cover;
  display: block;
}

.detail-gallery-mosaic__hero:focus-visible,
.detail-gallery-mosaic__tile:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.detail-gallery-mosaic__col {
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
}

.detail-gallery-mosaic__tile {
  flex: 1;
  min-height: 0;
  border: none;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: #2a2a2a;
}

.detail-gallery-mosaic__tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  padding: 3px;
}

.detail-gallery-thumbs__btn {
  aspect-ratio: 1;
  border: none;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: #2a2a2a;
}

.detail-gallery-thumbs__btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-gallery-thumbs__btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.detail-gallery-thumbs__more {
  aspect-ratio: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
}

.detail-gallery-thumbs__more img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-gallery-thumbs__more span {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  padding: 0.35rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.detail-gallery-thumbs__more::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.detail-modal__body {
  flex: 0 0 auto;
  padding: 1.25rem 1.5rem max(1.5rem, env(safe-area-inset-bottom));
}

.detail-modal__title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 400;
  margin: 0 0 0.35rem;
  padding-right: 2rem;
  color: var(--color-text);
  line-height: 1.25;
}

.detail-modal__specs {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-accent);
  margin: 0 0 0.5rem;
}

#detail-modal-status {
  margin-bottom: 0.75rem;
}

.detail-modal__teaser {
  font-size: 0.9375rem;
  color: var(--color-text);
  margin: 0 0 0.65rem;
  line-height: 1.45;
}

.detail-modal__detail {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0 0 1.25rem;
  line-height: 1.55;
  white-space: pre-line;
}

.detail-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.detail-modal__actions .button {
  text-align: center;
}

@media (min-width: 480px) {
  .detail-modal__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .detail-modal__actions .button {
    flex: 1;
    min-width: 10rem;
  }
}

@media (max-width: 540px) {
  .detail-gallery-mosaic {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    max-height: none;
  }

  .detail-gallery-mosaic__hero {
    grid-row: auto;
    max-height: 40vh;
  }

  .detail-gallery-mosaic__hero img {
    min-height: 180px;
  }

  .detail-gallery-mosaic__col {
    flex-direction: row;
    min-height: 96px;
  }

  .detail-gallery-mosaic__tile {
    flex: 1;
  }
}

/* --- Footer --- */
.site-footer {
  padding: 1.5rem var(--section-padding-x) max(1.5rem, var(--safe-bottom));
  padding-left: max(var(--section-padding-x), var(--safe-left));
  padding-right: max(var(--section-padding-x), var(--safe-right));
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.site-footer p {
  margin: 0;
}

.footer-legal {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.footer-legal a {
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer-legal a:hover,
.footer-legal a:focus-visible {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  outline: none;
}

/* --- Rechtliche Seiten --- */
.legal-page {
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100dvh;
}

.legal-main {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.legal-main h1 {
  margin: 0 0 1rem;
  font-family: var(--font-heading);
}

.legal-main h2 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.1rem;
}

.legal-main p,
.legal-main li {
  color: var(--color-text-muted);
  line-height: 1.6;
}

.legal-back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.legal-back-link:hover,
.legal-back-link:focus-visible {
  border-bottom-color: var(--color-accent);
  outline: none;
}
