/* ========================================================================== 
   1. DESIGN-TOKENS UND BASIS
   ========================================================================== */

:root {
  --bg: #f8f6f2;
  --surface: #fff;
  --muted: #eee7de;
  --text: #2b2b2b;
  --soft: #645c55;
  --accent: #9c7a4d;
  --accent-dark: #755a37;
  --border: #ded4c8;
  --dark: #1f1f1f;

  --max: 1440px;
  --gutter: clamp(20px, 5vw, 88px);
  --radius: 22px;
  --shadow: 0 16px 44px rgb(43 43 43 / 11%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3 {
  line-height: 1.12;
}

h1 {
  margin: 0.1em 0 0.35em;
  font-size: clamp(2.3rem, 6vw, 4.5rem);
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

/* Barrierefreiheit */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 99;
  padding: 10px;
  background: var(--surface);
}

.skip-link:focus {
  top: 20px;
}

/* ========================================================================== 
   2. HEADER UND NAVIGATION
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 80px;
  padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2));
  background: rgb(248 246 242 / 94%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.brand {
  margin-right: auto;
}

.brand img {
  width: auto;
  height: 68px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 26px);
  font-size: 0.94rem;
}

.main-nav a {
  padding: 8px 0;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 700;
}

.language-switch {
  display: flex;
  gap: 4px;
}

.language-switch button,
.nav-toggle {
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.language-switch button {
  padding: 5px 8px;
}

.language-switch button.is-active {
  color: #fff;
  background: var(--accent);
}

.nav-toggle {
  display: none;
  padding: 8px 11px;
  font-size: 1.2rem;
}

/* ========================================================================== 
   3. HERO-BEREICH – ALLE SEITEN
   ========================================================================== */

.hero {
  display: grid;
  min-height: clamp(480px, 65vh, 720px);
  align-items: center;
  background:
    linear-gradient(
      100deg,
      rgb(248 246 242 / 97%),
      rgb(248 246 242 / 55%)
    ),
    var(--hero) center / cover no-repeat;
}

.hero-inner,
.section-inner {
  width: min(100%, var(--max));
  margin: auto;
  padding: clamp(48px, 8vw, 110px) var(--gutter);
}

.hero-content {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.lead {
  color: var(--soft);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  padding: 12px 20px;
  font-weight: 700;
  border: 1px solid var(--accent);
  border-radius: 999px;
  transition: transform 0.2s ease;
}

.btn.primary {
  color: #fff;
  background: var(--accent);
}

.btn:hover {
  transform: translateY(-1px);
}

/* ========================================================================== 
   4. ALLGEMEINE SEKTIONSLAYOUTS
   ========================================================================== */

.section {
  background: var(--surface);
}

.section:nth-child(even) {
  background: var(--bg);
}

.section-header {
  max-width: 780px;
  margin-bottom: 34px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  gap: clamp(30px, 6vw, 80px);
  align-items: center;
}

.split img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.check-list {
  padding: 0;
  list-style: none;
}

.check-list li {
  margin: 10px 0;
}

.check-list li::before {
  margin-right: 10px;
  color: var(--accent);
  font-weight: 700;
  content: "✓";
}

.cta {
  text-align: center;
}

.cta p {
  max-width: 700px;
  margin: 0 auto 24px;
  color: var(--soft);
}

/* ========================================================================== 
   5. STARTSEITE UND LEISTUNGEN – KARTEN
   ========================================================================== */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}

.card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgb(43 43 43 / 6%);
}

.section:nth-child(odd) .card {
  background: var(--bg);
}

.card p {
  color: var(--soft);
}

/* Verlinkte Karten auf der Leistungsseite */
.card--linked {
  display: block;
  color: inherit;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.card--linked:hover,
.card--linked:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgb(0 0 0 / 12%);
}

.card--linked:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.card-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 600;
}

/* ========================================================================== 
   6. REFERENZEN – PROJEKTKARTEN UND BILDSLIDER
   ========================================================================== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.gallery-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Nur direkt eingebundene Coverbilder, nicht die Sliderbilder */
.gallery-card > img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-card-content {
  padding: 20px;
}

.tag {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.project-slider {
  position: relative;
  overflow: hidden;
  background: var(--muted);
}

.project-slider-images {
  position: relative;
  aspect-ratio: 4 / 3;
}

.project-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.project-slide.is-active {
  visibility: visible;
  opacity: 1;
}

.project-gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  background: rgb(0 0 0 / 45%);
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
  place-items: center;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.project-gallery-nav--prev {
  left: 0.75rem;
}

.project-gallery-nav--next {
  right: 0.75rem;
}

.project-gallery-nav:hover {
  background: rgb(0 0 0 / 70%);
  transform: translateY(-50%) scale(1.06);
}

.project-gallery-nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.project-gallery-counter {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 2;
  padding: 0.3rem 0.55rem;
  color: #fff;
  font-size: 0.8rem;
  background: rgb(0 0 0 / 50%);
  border-radius: 999px;
}

/* ========================================================================== 
   7. IMPRESSIONEN – MASONRY-GALERIE
   ========================================================================== */

.masonry {
  columns: 3 260px;
  column-gap: 20px;
}

.masonry figure {
  margin: 0 0 20px;
  overflow: hidden;
  break-inside: avoid;
  background: var(--surface);
  border-radius: var(--radius);
}

.masonry img {
  width: 100%;
}

.masonry figcaption {
  padding: 12px 16px;
  color: var(--soft);
}

/* ========================================================================== 
   8. KONTAKTSEITE – INFO LINKS, FORMULAR RECHTS
   ========================================================================== */

.contact-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.contact-intro {
  align-self: start;
}

.contact-intro h3 {
  margin-top: 0.5rem;
}

.contact-details {
  margin-top: 2rem;
}

.contact-details p {
  margin-bottom: 1.25rem;
}

.contact-details a {
  color: inherit;
}

/*
 * Das Formular wird auf Desktop immer in der rechten Spalte platziert.
 * Dadurch bleibt die linke Hälfte frei oder kann später mit .contact-intro
 * für Kontaktdaten und einen Einführungstext genutzt werden.
 */
.contact-form {
  display: grid;
  grid-column: 2;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  min-width: 0;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field.full,
.checkbox,
.contact-form button {
  grid-column: 1 / -1;
}

.field input,
.field textarea {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: 2px solid rgb(156 122 77 / 18%);
  outline-offset: 1px;
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.checkbox input[type="checkbox"] {
  flex: 0 0 auto;
  width: auto;
  min-width: auto;
  padding: 0;
  margin-top: 0.35em;
}

.checkbox span {
  flex: 1;
}

.contact-form button {
  justify-self: start;
  cursor: pointer;
  border: 0;
}

/* ========================================================================== 
   9. DATENSCHUTZ UND IMPRESSUM
   ========================================================================== */

.legal {
  max-width: 900px;
}

.legal article {
  margin-bottom: 34px;
}

.imprint-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 12px 28px;
}

.imprint-grid dt {
  font-weight: 700;
}

.imprint-grid dd {
  margin: 0;
}

/* ========================================================================== 
   10. DANKE-SEITE
   ========================================================================== */

.thank-you-card {
  max-width: 760px;
  margin: 6rem auto;
  padding: clamp(2rem, 5vw, 4rem);
  text-align: center;
  background: var(--surface);
  border-radius: 1rem;
  box-shadow: 0 16px 45px rgb(0 0 0 / 8%);
}

.thank-you-card h1 {
  margin-bottom: 1rem;
}

.thank-you-card > p:not(.eyebrow) {
  max-width: 620px;
  margin-right: auto;
  margin-left: auto;
}

.thank-you-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.thank-you-footer {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  padding: 2rem;
  font-size: 0.9rem;
}

/* ========================================================================== 
   11. FOOTER UND SYSTEMMELDUNGEN
   ========================================================================== */

.site-footer {
  color: #ddd;
  background: var(--dark);
}

.site-footer > div {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  width: min(100%, var(--max));
  margin: auto;
  padding: 26px var(--gutter);
}

.footer-links {
  display: flex;
  gap: 18px;
}

.loading,
.error,
.noscript {
  padding: 60px var(--gutter);
}

/* ========================================================================== 
   12. RESPONSIVE – TABLET
   ========================================================================== */

@media (max-width: 980px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    right: var(--gutter);
    left: var(--gutter);
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
  }

  .main-nav.open {
    display: flex;
  }

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

  .contact-form {
    grid-column: 1;
  }

  .language-switch {
    order: 2;
  }
}

/* ========================================================================== 
   13. RESPONSIVE – MOBILE
   ========================================================================== */

@media (max-width: 620px) {
  .site-header {
    min-height: 72px;
    gap: 10px;
  }

  .brand img {
    height: 58px;
  }

  .language-switch {
    display: none;
  }

  .hero {
    min-height: 520px;
  }

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

  .field.full,
  .checkbox,
  .contact-form button {
    grid-column: auto;
  }

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

  .imprint-grid dd {
    margin-bottom: 12px;
  }

  .thank-you-card {
    margin-block: 3rem;
  }
}