.gallery-intro,
.contact-intro {
  text-align: center;
  display: grid;
  gap: var(--space-xs);
  max-width: 980px;
  margin: 0 auto var(--space-md);
  justify-items: center;
}

.gallery-intro h2,
.gallery-intro p {
  color: var(--c-blue);
}

.gallery-intro .eyebrow {
  color: var(--c-terracotta);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.gallery-item {
  margin: 0;
  position: relative;
  isolation: isolate;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: pointer;
  background: #d6ddd1;
  box-shadow: 0 10px 24px rgba(38, 51, 60, 0.12);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.02);
}

.gallery-item__zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(15, 22, 40, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 20px rgba(15, 22, 40, 0.2);
  pointer-events: none;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.gallery-item__zoom svg {
  width: 16px;
  height: 16px;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  background: #cfd3cb;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  touch-action: none;
}

.gallery-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gallery-lightbox__dialog {
  position: relative;
  width: 100vw;
  height: 100vh;
}

.gallery-lightbox__media {
  width: 100%;
  height: 100%;
  max-height: calc(100dvh - 8px);
  display: grid;
  place-items: center;
  padding: 24px;
  background: #cfd3cb;
  overflow: hidden;
}

.gallery-lightbox__media img {
  max-width: 100%;
  max-height: calc(100dvh - 56px);
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-lightbox__close,
.gallery-lightbox__nav {
  position: absolute;
  color: #fff;
}

.gallery-lightbox__close {
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: 14px;
  z-index: 10;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(16, 33, 51, 0.34);
  box-shadow: 0 10px 24px rgba(16, 33, 51, 0.28);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.gallery-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  z-index: 9;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  font-size: 0;
}

.gallery-lightbox__nav::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 22, 40, 0.14);
  z-index: -1;
}

.gallery-lightbox__nav::after {
  content: "\2039";
  font-size: 22px;
  line-height: 1;
  transform: none;
}

.gallery-lightbox__nav--next::after {
  content: "\203A";
}

.gallery-lightbox__nav--prev {
  left: 14px;
}

.gallery-lightbox__nav--next {
  right: 14px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 2.5vw, 34px);
}

.contact-card {
  background: rgba(227, 228, 225, 0.88);
  box-shadow: 0 16px 36px rgba(38, 51, 60, 0.14);
  padding: clamp(20px, 2.3vw, 32px);
  display: grid;
  align-content: start;
  gap: var(--space-xs);
}

.contact-card h3 {
  font-size: var(--title-md);
  line-height: 1.06;
}

.contact-form {
  display: grid;
  gap: 14px;
}

.contact-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.contact-form label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--c-blue);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 0;
  padding: 14px 16px;
  background: rgba(214, 221, 209, 0.64);
  color: var(--c-blue);
}

.contact-form textarea {
  min-height: 170px;
  resize: vertical;
}

.contact-form__choices {
  margin: 0;
  border: 0;
  padding: 0;
}

.contact-form__choices legend {
  margin: 0 0 7px;
  padding: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--c-blue);
}

.contact-form__choices-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 14px;
}

.contact-form__choices-grid label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  letter-spacing: 0;
  color: rgba(38, 51, 60, 0.92);
}

.contact-form__choices-grid input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
}

.contact-form__choices-grid input[type="checkbox"],
.contact-form .contact-privacy input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  border-radius: 3px;
  border: 0;
  background: rgba(38, 51, 60, 0.24);
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.contact-form__choices-grid input[type="checkbox"]::before,
.contact-form .contact-privacy input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: transform 0.12s ease-in-out;
  box-shadow: inset 1em 1em var(--c-light);
  clip-path: polygon(14% 44%, 0 58%, 40% 100%, 100% 24%, 84% 10%, 39% 72%);
}

.contact-form__choices-grid input[type="checkbox"]:checked,
.contact-form .contact-privacy input[type="checkbox"]:checked {
  background: var(--c-terracotta);
}

.contact-form__choices-grid input[type="checkbox"]:checked::before,
.contact-form .contact-privacy input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.contact-form__choices-grid input[type="checkbox"]:hover,
.contact-form .contact-privacy input[type="checkbox"]:hover {
  background: rgba(38, 51, 60, 0.38);
}

.contact-form__choices-grid input[type="checkbox"]:focus-visible,
.contact-form .contact-privacy input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 78, 39, 0.32);
}

.contact-form .contact-privacy {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(38, 51, 60, 0.86);
}

.contact-form .contact-privacy input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  padding: 0;
}

.contact-status {
  display: none;
  padding: 12px 14px;
  font-size: 15px;
}

.contact-status.is-visible {
  display: block;
}

.contact-status.is-success {
  background: rgba(33, 155, 121, 0.12);
  color: #115b46;
}

.contact-status.is-error {
  background: rgba(193, 18, 31, 0.12);
  color: #8e0e1a;
}

@media (max-width: 1180px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .contact-form__row {
    grid-template-columns: 1fr;
  }
}

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

  #wohnungen-galerie .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-lightbox__media {
    padding: 20px;
  }

  .gallery-lightbox__media img {
    max-height: calc(100dvh - 44px);
  }
}

.contact-hero__grid {
  min-height: calc(75vh - var(--header-height));
  height: calc(75vh - var(--header-height));
  max-height: calc(75vh - var(--header-height));
  background: rgba(241, 242, 240, 0.88);
}

.contact-hero__copy {
  background: rgba(241, 242, 240, 0.92);
}

@media (max-width: 1180px) {
  .contact-hero__grid {
    min-height: auto;
    height: auto;
    max-height: none;
  }
}

.contact-intro__links,
.contact-intro__links a {
  font-weight: 500;
}

.contact-intro__links a:hover,
.contact-intro__links a:focus-visible {
  color: var(--c-terracotta);
}
