/* Project photographs and inquiry backgrounds only. */
.project-references {
  scroll-margin-top: 190px;
}

.project-gallery-intro {
  max-width: 780px;
  margin: 0 0 26px;
  color: var(--muted);
}

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

.project-photo {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(4, 59, 59, 0.06);
}

.project-photo-link {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  color: #fff;
  background: #e6efef;
  text-decoration: none;
}

.project-photo-link > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.project-photo-link:hover > img {
  transform: scale(1.025);
}

.project-photo-zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 9px;
  background: rgba(4, 59, 59, 0.92);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
  pointer-events: none;
}

.project-photo figcaption {
  padding: 17px 18px 20px;
}

.project-photo-category {
  display: block;
  margin-bottom: 5px;
  color: var(--turkis-dunkel);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-photo h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.06rem;
  line-height: 1.4;
}

.project-more {
  margin-top: 26px;
}

.project-more > summary,
.reference-directory > summary {
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--turkis);
  border-radius: 10px;
  background: #fff;
  color: var(--turkis-dunkel);
  font-weight: 700;
  cursor: pointer;
}

.project-more > summary::marker,
.reference-directory > summary::marker {
  color: var(--turkis);
}

.project-more > summary:hover,
.reference-directory > summary:hover {
  background: #e8f8f8;
}

.project-more[open] > summary {
  margin-bottom: 24px;
}

.project-gallery-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 30px;
  padding: 22px 24px;
  border-left: 4px solid var(--turkis-hell);
  border-radius: 0 12px 12px 0;
  background: #e9f5f5;
}

.project-gallery-cta p {
  flex: 1 1 260px;
  margin: 0;
}

.project-gallery-cta .btn {
  margin: 0;
}

.reference-directory {
  margin-top: 30px;
}

.reference-directory[open] > summary {
  margin-bottom: 18px;
}

.project-photo-link:focus-visible {
  outline: 4px solid var(--turkis-hell);
  outline-offset: -4px;
}

.project-more > summary:focus-visible,
.reference-directory > summary:focus-visible,
.project-gallery-cta a:focus-visible,
.inquiry-gallery-link:focus-visible {
  outline: 3px solid var(--turkis);
  outline-offset: 4px;
}

.project-viewer-open {
  overflow: hidden;
}

.project-photo-viewer {
  width: min(1120px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(0, 199, 195, 0.5);
  border-radius: 16px;
  background: #062b2b;
  color: #fff;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.4);
}

.project-photo-viewer[open] {
  display: flex;
  flex-direction: column;
}

.project-photo-viewer::backdrop {
  background: rgba(1, 19, 19, 0.84);
}

.project-viewer-toolbar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
}

.project-viewer-toolbar p {
  margin: 0;
  color: #d5eeee;
  font-size: 0.92rem;
}

.project-photo-viewer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.project-photo-viewer button:hover {
  border-color: var(--turkis-hell);
  background: #0c5353;
}

.project-photo-viewer button:focus-visible,
.project-photo-viewer a:focus-visible {
  outline: 3px solid var(--turkis-hell);
  outline-offset: 3px;
}

#project-photo-large {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  height: min(65vh, 780px);
  height: min(65dvh, 780px);
  min-height: 80px;
  object-fit: contain;
  background: #031b1b;
}

#project-photo-large[hidden],
#project-photo-error[hidden] {
  display: none;
}

#project-photo-error {
  margin: 0;
  padding: 32px 24px;
  background: #fff4e5;
  color: #38270c;
  line-height: 1.6;
}

#project-photo-error a {
  display: inline-block;
  min-height: 44px;
  padding: 8px 0;
  color: #005f5f;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-viewer-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  padding: 18px 22px 22px;
}

.project-viewer-footer > div:first-child {
  min-width: 0;
}

#project-photo-title {
  margin: 0 0 5px;
  color: #fff;
  font-size: 1.15rem;
  line-height: 1.35;
}

#project-photo-description {
  margin: 0;
  color: #d5eeee;
  font-size: 0.94rem;
  line-height: 1.5;
}

.project-viewer-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.project-inquiry .inquiry-hero {
  background-color: #f3f7f7;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.89) 48%, rgba(255, 255, 255, 0.65) 100%),
    url("assets/projekte/montage-industriehalle.jpg");
  background-position: center, center 42%;
  background-size: cover;
  background-repeat: no-repeat;
}

.project-inquiry .inquiry-form-section {
  background-color: #f3f7f7;
  background-image:
    linear-gradient(110deg, rgba(243, 247, 247, 0.97), rgba(243, 247, 247, 0.90)),
    url("assets/projekte/montage-industriehalle.jpg");
  background-position: center, center top;
  background-size: cover;
  background-repeat: no-repeat;
}

.inquiry-gallery-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-top: 8px;
  color: var(--turkis-dunkel);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 860px) {
  .project-references {
    scroll-margin-top: 220px;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .project-viewer-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .project-viewer-controls {
    align-self: stretch;
    justify-content: space-between;
  }

  #project-photo-large {
    height: 58vh;
    height: 58dvh;
  }
}

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

  .project-gallery-cta {
    padding: 20px 18px;
  }

  .project-gallery-cta .btn {
    width: 100%;
    text-align: center;
  }

  .project-photo-viewer {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 12px;
  }

  .project-viewer-toolbar {
    padding: 10px 12px;
  }

  .project-viewer-footer {
    padding: 14px 14px 18px;
  }

  .project-inquiry .inquiry-hero {
    background-image:
      linear-gradient(90deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.80)),
      url("assets/projekte/montage-industriehalle.jpg");
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-photo-link > img {
    transition: none;
  }

  .project-photo-link:hover > img {
    transform: none;
  }
}
