/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --font-base: -apple-system, BlinkMacSystemFont, "Quicksand", sans-serif;

  /* Animation */
  --transition-smooth: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.15);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: transform 1s
    linear(
      0 0%,
      0.22 2.1%,
      0.86 6.5%,
      1.11 8.6%,
      1.3 10.7%,
      1.35 11.8%,
      1.37 12.9%,
      1.37 13.7%,
      1.36 14.5%,
      1.32 16.2%,
      1.03 21.8%,
      0.94 24%,
      0.89 25.9%,
      0.88 26.85%,
      0.87 27.8%,
      0.87 29.25%,
      0.88 30.7%,
      0.91 32.4%,
      0.98 36.4%,
      1.01 38.3%,
      1.04 40.5%,
      1.05 42.7%,
      1.05 44.1%,
      1.04 45.7%,
      1 53.3%,
      0.99 55.4%,
      0.98 57.5%,
      0.99 60.7%,
      1 68.1%,
      1.01 72.2%,
      1 86.7%,
      1 100%
    );
  interpolate-size: allow-keywords;

  /* Layout */
  --nav-height: 60px;
  --nav-height-small: 56px;
  --trustbar-min-height: 116px;
  @media screen and (max-width: 1230px) {
    --trustbar-min-height: 177px;
  }
  @media screen and (max-width: 360px) {
    --trustbar-min-height: 267px;
  }
  --nav-bar-box-shadow:
    0 2px 8px rgba(20, 23, 32, 0.08), 0 1px 2px rgba(20, 23, 32, 0.04);
  --br: 1rem;

  /* Scrollbar */
  --sb-track-color: #dbeafe;
  --sb-thumb-color: #5278e0;

  --fs-body: clamp(15px, calc(12.677px + 0.645vw), 23px);
  --fs-box-title: clamp(1.3125rem, 1.1827rem + 0.5769vw, 1.875rem);
  --fs-headline: clamp(26.8px, calc(18.613px + 2.274vw), 55px);
  --fs-headline-2: clamp(23.8px, calc(16.484px + 2.032vw), 49px);
  --fs-sep-hero: clamp(15.6px, calc(13.452px + 0.597vw), 23px);
  --fs-sep: clamp(1.2rem, 0.6231rem + 2.5641vw, 3.7rem);
  --fs-input: clamp(0.75rem, 0.6923rem + 0.2564vw, 1rem);

  /* Farben */
  --primary-color: #1a1f2e;
  --label-color: #fff;
  --cta: rgba(255, 255, 255, 0.72);
  /* --overlay: radial-gradient(rgba(240, 242, 250, 0.55) 0%, rgba(220, 226, 245, 0.8) 100%); */
  --overlay: linear-gradient(
    45deg,
    rgba(244, 246, 251, 0.9) 0%,
    rgba(244, 246, 251, 0.9) 60%,
    rgba(244, 246, 251, 0) 80%
  );

  --primary-color-a0: #2d5be3;
  --primary-color-a10: #2450cc;
  --primary-color-a20: #1c45b5;
  --primary-color-a30: #163a9e;
  --primary-color-a40: #102f88;
  --primary-color-a50: #0b2472;

  --clr-surface-a0: #ffffff;
  --clr-surface-a10: #f4f5f8;
  --clr-surface-a20: #e9ebf2;
  --clr-surface-a30: #dde0eb;
  --clr-surface-a40: #d2d6e4;
  --clr-surface-a50: #c6cbdd;

  --clr-surface-tonal-a0: #eef0f9;
  --clr-surface-tonal-a10: #e3e6f4;
  --clr-surface-tonal-a20: #d8ddef;
  --clr-surface-tonal-a30: #ced3ea;
  --clr-surface-tonal-a40: #c3c9e4;
  --clr-surface-tonal-a50: #b9bfdf;

  --clr-success-a0: #1a7a52;
  --clr-success-a10: #1d9163;
  --clr-success-a20: #20a874;

  --clr-warning-a0: #8a5c00;
  --clr-warning-a10: #a06d00;
  --clr-warning-a20: #b67e00;

  --clr-danger-a0: #b91c1c;
  --clr-danger-a10: #c72626;
  --clr-danger-a20: #d63030;

  --clr-info-a0: #1252a3;
  --clr-info-a10: #1a5fb8;
  --clr-info-a20: #2270cc;

  /* Icons (als Maske verwendbar) */
  /* --icon-chevron: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"%3E%3Cpath d="M528 320C528 434.9 434.9 528 320 528C205.1 528 112 434.9 112 320C112 205.1 205.1 112 320 112C434.9 112 528 205.1 528 320zM64 320C64 461.4 178.6 576 320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320zM451.3 331.3C457.5 325.1 457.5 314.9 451.3 308.7L347.3 204.7C342.7 200.1 335.8 198.8 329.9 201.2C324 203.6 320 209.5 320 216L320 288L216 288C202.7 288 192 298.7 192 312L192 328C192 341.3 202.7 352 216 352L320 352L320 424C320 430.5 323.9 436.3 329.9 438.8C335.9 441.3 342.8 439.9 347.3 435.3L451.3 331.3z"/%3E%3C/svg%3E'); */
  --icon-chevron: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-circle-chevron-right preview-icon"><circle cx="12" cy="12" r="10"/><path d="m10 8 4 4-4 4"/></svg>')
  
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

/* Formularfelder müssen bedienbar bleiben (Safari blockiert Eingabe bei user-select: none) */
input,
textarea,
select {
  -webkit-user-select: text;
  user-select: text;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--sb-thumb-color) var(--sb-track-color);
}

*::-webkit-scrollbar {
  width: 2px;
  height: 2px;
}

*::-webkit-scrollbar-track {
  background-color: var(--sb-track-color);
  border-radius: 20px;
}

*::-webkit-scrollbar-track:hover {
  background-color: #bfdbfe;
}
*::-webkit-scrollbar-track:active {
  background-color: #93c5fd;
}

*::-webkit-scrollbar-thumb {
  background-color: var(--sb-thumb-color);
  border-radius: 20px;
  min-height: 10px;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: #1f52e0;
}
*::-webkit-scrollbar-thumb:active {
  background-color: var(--primary-color-a30);
}

*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

html {
  scroll-padding-top: var(--nav-height);
  scrollbar-gutter: stable;
  overscroll-behavior-y: none;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  overscroll-behavior-y: none;
  font-family: var(--font-base);
  background: var(--clr-surface-a10);
  color: var(--primary-color);
  line-height: 1.6;
}

/* Seite hinter Modals / offenem Multiselect nicht scrollen */
html:has(dialog[open], .multiselect-container.open) {
  overflow-y: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

ul {
  padding-left: 2rem;
  list-style: outside;
}

button {
  padding: 0;
  border: 1px solid currentColor;
  border-radius: var(--br);
  font: inherit;
  color: inherit;
  background-color: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

strong,
strong u {
  color: var(--primary-color-a20);
}

#top.home::before {
  content: "";
  position: fixed;
  width: 100%;
  height: 100%;
  background:
    var(--overlay),
    url(/assets/img/web/startseite.webp) center / cover no-repeat fixed;
  filter: blur(1px);
}

@supports (-webkit-touch-callout: none) {
   #top.home::before {
      height: 100dvh; 
      top: 0;
      left: 0;
      background-size: cover;
      background-position: center center;
   }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.balance {
  text-wrap: balance;
}

.hidden-msg,
.referenz.hidden {
  display: none !important;
}

.unset {
  all: unset;
  cursor: pointer;
}

.ta-right {
  text-align: right;
}

.full-size {
  width: 100%;
  text-align: center;
}

.fonty {
  font-family: "fa-solid";
  color: var(--primary-color-a20);
}

.icon {
  font-family: "fa-solid";
}

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

/* Honeypot-Feld */
.visually-hidden {
  position: absolute;
  left: -9999px;
}

.mobile {
  display: none;
}

@media (max-width: 600px) {
  .mobile {
    display: block;
  }

  .to-top{
    display: none !important;
  }
}

@media screen and (max-width: 1024px) and (orientation: landscape) {
  .to-top{
    display: none !important;
  }
}

.to-top {
  position: fixed;
  bottom: 5px;
  right: 20px;
  z-index: 950;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 45px;
  width: 45px;
  background: var(--primary-color-a30);
  color: var(--clr-surface-a0);
  border: 2px solid var(--clr-surface-a0);
  border-radius: 50%;
  cursor: pointer;
  font-weight: 900;
  font-size: 1.1rem;
  text-decoration: none;
  opacity: 0;
  translate: 0 80px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition:
    translate 0.4s var(--ease-smooth),
    opacity 0.4s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.navbar--scrolled + .to-top {
  translate: 0 0;
  opacity: 1;
}

@media (hover: hover) {
  .to-top:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-3px);
  }
}

@media (max-width: 480px) {
  .to-top {
    bottom: 30px;
    right: 5px;
  }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.nav-btn {
  display: inline-block;
  padding: 7px 14px;
  border-radius: var(--br);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: var(--br);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.secondary {
  color: var(--primary-color-a20);
  background: transparent;
  border: 2px solid var(--primary-color-a20);
}

.secondary:hover {
  color: var(--clr-surface-a0);
  background: var(--primary-color-a30);
  border-color: var(--primary-color-a30);
}

.primary {
  color: #fff;
  background: var(--primary-color-a20);
  border: 2px solid var(--primary-color-a20);
}

.primary:hover {
  background: var(--primary-color-a30);
  border-color: var(--primary-color-a30);
}

.cta-button {
  display: flex;
  gap: 5px;
  margin-top: 5px;
}

.cta-button button {
  flex-basis: 200%;
}

/* ============================================================
   DIALOGE (global: Ein-/Ausblenden)
   ============================================================ */
dialog {
  padding: 0;
  border: none;
  border-radius: var(--br);
  background: var(--clr-surface-a10);
  color: var(--primary-color);
  opacity: 0;
  transform: scale(0.9);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    display 0.3s allow-discrete,
    overlay 0.3s allow-discrete;
}

dialog[open] {
  opacity: 1;
  transform: scale(1);
}

dialog:focus-visible {
  outline: none;
}

dialog::backdrop {
  opacity: 0;
  background-color: rgb(0 0 0 / 70%);
  transition:
    opacity 0.3s ease-out,
    display 0.3s allow-discrete,
    overlay 0.3s allow-discrete;
}

dialog[open]::backdrop {
  opacity: 1;
}

@starting-style {
  dialog[open] {
    opacity: 0;
    transform: scale(0.9);
  }

  dialog[open]::backdrop {
    opacity: 0;
  }
}

/* Schließen-Button (Basis für alle Modals, Lightbox und Referenz-Modal überschreiben ihn) */
.modal {
  position: relative;
}

/* ============================================================
   HOME
   ============================================================ */
/* #home {
  display: flex;
  position: relative;
  align-items: stretch;
  margin: auto;
  padding-top: var(--nav-height);
  width: 95vw;
  max-width: 1600px;
  overflow: hidden;
  background: unset;
}

.edinner {
  display: block;
  margin: 0 2rem;
  padding-top: 2.5em;
  flex-basis: calc(50% - 4rem);
}

.edleft.edinner {
  display: flex;
  flex: 1 0 50%;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.edright.edinner {
  display: flex;
  flex: 0 1 30%;
  justify-content: center;
  align-items: flex-end;
}

.edright.edinner img {
  max-height: 100vh;
}
*/

#home{
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--nav-height));   /* Fallback */
  min-height: calc(100svh - var(--nav-height));
}

#hero {
  flex: 1 0 auto;
  position: relative;
  height: auto;
  margin: 1rem auto 0;
  overflow: hidden;
  display: grid;
  width: 95vw;
  background: none;
  max-width: 1600px;
  min-height: min-content;
}

#home{
  background: none;
  margin: var(--nav-height) auto auto auto;
}

#hero .edleft,
#hero .edright {
  grid-area: 1 / 1;
  margin: 0;
}

/* BILD: Höhe = Section-Höhe, Breite ergibt sich aus dem Seitenverhältnis */
#hero .edright {
  position: relative;
  z-index: 1;
}
#hero .edright .eddinner {
  position: absolute;
  inset: 0;
  overflow: hidden;
  margin-top: 2rem;
}
#hero .edright img {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 100%;
  width: auto;
  max-width: none;
}

/* TEXT */
#hero .edleft {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
}

.call-action {
  display: block;
  width: 100%;
  font-size: var(--fs-body);
  line-height: normal;
  animation: myAnim 0.4s ease-in 0.5s 1 normal both;
}

.call-action {
  display: inline-grid;
  grid-template-columns: min-content;
}

.call-action > * {
  grid-column: 1;
  width: 100%;
  box-sizing: border-box;
  letter-spacing: -0.02em;
}

.call-action h1 {
  font-size: var(--fs-headline);
  color: var(--primary-color);
  /* margin: 0 0 18px; */
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.01em;
  width: fit-content;
}

.call-action h1 span {
  display: block;
  color: var(--primary-color-a20);
  font-size: var(--fs-headline-2);
}

.call-action .checks {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 15px 0;
}

.call-action .trust {
  font-size: .95rem;
  font-weight: 600;
}

.trust > span:nth-child(1) {
  margin-right: 1rem;
}

.call-action .trust .stars {
  color: #d97706;
  letter-spacing: 2px;
  font-size: 1.1rem;
}

.call-action .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 13px;
}

.call-action .btn{ 
  font-size: var(--fs-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  flex: 1;
}
.call-action .btn.tel{
    display: none;
}

@media (max-width: 600px) {

    .call-action .btn.secondary{
    flex: 0 0 100%
}

.call-action .btn.tel, .call-action .btn{
  display: flex;
}

}

#hero-sub-title {
  display: block;
  color: var(--primary-color-a20);
  font-size: var(--fs-headline-2);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.01em;
  max-width: fit-content;
  margin: 0 0 5px;
  white-space: nowrap;
}

.call-action .sep-hero {
  font-size: var(--fs-sep-hero);
}

.call-action h2 {
  text-wrap: nowrap;
}

@media screen and (max-width: 1032px) and (orientation: portrait) {

  .call-action h2 {
    text-wrap: balance;
  }

  .call-btn {
    font-size: var(--fs-body);
  }

  :root {
    --overlay: radial-gradient(
      ellipse at center,
      rgba(244, 246, 251, 0.85) 0%,
      rgba(244, 246, 251, 0.85) 100%
    );
  }

  .edinner {
    display: flex;
    position: relative;
    justify-content: center;
    width: 100%;
  }

  .edright.edinner {
    display: none;
    flex-basis: calc(100% - 4rem);
    padding-top: 2rem;
  }

  .call-action {
    display: block;
  }

}

@media screen and (max-width: 990px) {

  #hero-sub-title{
    text-wrap: wrap;
  }

  .call-action h2 {
    text-wrap: balance;
  }

  .call-btn {
    font-size: var(--fs-body);
  }

  :root {
    --overlay: radial-gradient(
      ellipse at center,
      rgba(244, 246, 251, 0.85) 0%,
      rgba(244, 246, 251, 0.85) 100%
    );
  }

  .edinner {
    display: flex;
    position: relative;
    justify-content: center;
    width: 100%;
  }

  .edright.edinner {
    display: none;
    flex-basis: calc(100% - 4rem);
    padding-top: 2rem;
  }

  .call-action {
    display: block;
  }
}

@media (orientation: landscape) and (max-height: 520px) {

    #hero .call-action {
        padding-block: 12px;
    }

    .cta-row .btn {
        padding-block: 8px;
    }

    /* Trustbar: eine Zeile, nur Icon + Titel */
    .ij-trustbar__inner {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: calc(100% - 32px);
        padding: 0;
    }
    .ij-trustbar__item {
        padding: 10px 12px;
        gap: 10px;
        align-items: center;
    }
    .ij-trustbar__item + .ij-trustbar__item,
    .ij-trustbar__item:nth-child(3),
    .ij-trustbar__item:nth-child(n+3) {
        border-top: none;
        border-left: 1px solid #e5e8ef;
    }
    .ij-trustbar__icon {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
        border-radius: 8px;
    }
    .ij-trustbar__icon svg {
        width: 20px;
        height: 20px;
    }
    .ij-trustbar__content h3 {
        margin: 0;
        font-size: 13px;
    }
}

@keyframes myAnim {
  0% {
    animation-timing-function: ease-in;
    opacity: 0;
    transform: translateY(-400px);
  }
  38% {
    animation-timing-function: ease-out;
    opacity: 1;
    transform: translateY(0);
  }
  55% {
    animation-timing-function: ease-in;
    transform: translateY(-65px);
  }
  72% {
    animation-timing-function: ease-out;
    transform: translateY(0);
  }
  81% {
    animation-timing-function: ease-in;
    transform: translateY(-28px);
  }
  90% {
    animation-timing-function: ease-out;
    transform: translateY(0);
  }
  95% {
    animation-timing-function: ease-in;
    transform: translateY(-8px);
  }
  100% {
    animation-timing-function: ease-out;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .call-action {
    animation: none;
  }
}

.ij-trustbar {
    position: relative;
    bottom: 0;
    z-index: 2;
    width: 100%;
    background: #ffffff;
    flex: 0 0 auto;
}

.ij-trustbar__inner {
    width: 95vw;
    margin: auto;
    padding: 1.5rem 0;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}

/* Einzelner Vorteil */
.ij-trustbar__item {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 8px 24px;
}

/* Trennlinien */
.ij-trustbar__item + .ij-trustbar__item {
    border-left: 1px solid #e5e8ef;
}

/* Icon */
.ij-trustbar__icon {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #2049b5;
    background: #edf2ff;
    border-radius: 12px;

    transition: background .25s ease,
                color .25s ease,
                transform .25s ease;
}

.ij-trustbar__icon svg {
    display: block;
    width: 28px;
    height: 28px;
}

/* Text */
.ij-trustbar__content h3 {
    margin: 0 0 6px;
    color: #172033;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.3;
}

.ij-trustbar__content p {
    margin: 0;
    color: #687184;
    font-size: 13px;
    line-height: 1.5;
}

/* Dezenter Hover-Effekt */
.ij-trustbar__item:hover .ij-trustbar__icon {
    color: #ffffff;
    background: #2049b5;
    transform: translateY(-2px);
}

/* =========================================
   TABLET
========================================= */

@media (max-width: 1230px) {
    .ij-trustbar__inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0;
    }

    .ij-trustbar__item {
        padding: 18px 20px;
    }

    .ij-trustbar__item:nth-child(3) {
        border-left: none;
    }

    .ij-trustbar__item:nth-child(n+3) {
        border-top: 1px solid #e5e8ef;
    }
}

/* =========================================
   SMARTPHONE
========================================= */

@media (max-width: 550px) {
    .ij-trustbar__inner {
        width: calc(100% - 32px);
        padding: 0;
    }

    .ij-trustbar__item {
        gap: 13px;
        padding: 16px 10px;
        align-items: flex-start;
    }

    .ij-trustbar__icon {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
        border-radius: 10px;
    }

    .ij-trustbar__icon svg {
        width: 23px;
        height: 23px;
    }

    .ij-trustbar__content h3 {
        font-size: 14px;
    }

    .ij-trustbar__content p {
        font-size: 12px;
        line-height: 1.4;
    }
}

/* =========================================
   SEHR KLEINE DISPLAYS
========================================= */

@media (max-width: 460px) {
    :root{
    --trustbar-min-height: 267px !important;
}

    .ij-trustbar__inner {
        grid-template-columns: 1fr;
    }

    .ij-trustbar__item + .ij-trustbar__item {
        border-left: none;
        border-top: 1px solid #e5e8ef;
    }

    .ij-trustbar__item {
        align-items: center;
        padding: 12px 8px;
    }
}

/* =========================================
   BARRIEREFREIHEIT
========================================= */

@media (prefers-reduced-motion: reduce) {
    .ij-trustbar__icon {
        transition: none;
        transform: none;
    }
}

.icons {
  font-size: clamp(2.5rem, 2.3846rem + 0.5128vw, 3rem);
}

.headline,
.headline-s {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
  line-height: 1;
}

.headline {
  font-size: var(--fs-headline);
}
.headline-s {
  font-size: var(--fs-body);
}

/* ============================================================
   TRENNER (Separator)
   ============================================================ */
.separator,
.separator-after {
  position: absolute;
  width: 100%;
  height: 4rem;
}

.separator {
  top: -3.99rem;
}
.separator-after {
  bottom: -3.99rem;
}

.separator::after,
.separator-after::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--clr-surface-a0);
  z-index: 1;
}

.separator::after {
  clip-path: polygon(100% 0, 0% 100%, 100% 100%);
}

.separator-after::after {
  z-index: 7;
  clip-path: polygon(0 100%, 100% 0, 0 0);
}

section:nth-child(even) > .separator::after,
section:nth-child(even) > .separator-after::after {
  background: var(--clr-surface-a10);
}

.separator-title {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: calc(110px + 10rem);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.separator-title::before,
.separator-title::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 5rem;
  background: var(--clr-surface-a0);
  z-index: 1;
}

.separator-title::before {
  top: 0;
  clip-path: polygon(0% 0%, 100% 0%, 0% 100%);
}

.separator-title::after {
  bottom: 0;
  clip-path: polygon(100% 0, 0% 100%, 100% 100%);
}

.separator-title h2 {
  font-size: var(--fs-sep);
  line-height: 1;
}

.sep-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 0;
}

@media (max-width: 35.9375rem) {
  .separator {
    height: 2rem;
    top: -1.99rem;
  }

  .separator-title {
    height: 7rem;
  }

  .separator-title::before,
  .separator-title::after {
    height: 2rem;
  }
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--clr-surface-a10);
  box-shadow: var(--nav-bar-box-shadow);
  transition: box-shadow 0.3s ease;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 95vw;
  height: var(--nav-height);
  margin: auto;
}

#navBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 23, 32, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 998;
  backdrop-filter: blur(4px);
}

#navBackdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 20px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  stroke-width: 2;
}

.logo-text {
  letter-spacing: -0.5px;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.hamburger-line {
  width: 100%;
  height: 3px;
  background: var(--primary-color);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(11px) rotate(45deg);
  height: 5px;
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-11px) rotate(-45deg);
  height: 5px;
}

/* Menü & Links */
.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 48px);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  list-style: none;
  padding-left: 0;
}

.nav-link {
  position: relative;
  display: block;
  padding: 15px 0;
  color: var(--primary-color);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color-a0);
  transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color-a0);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (min-width: 769px) and (max-width: 1024px) {
  .nav-list {
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(320px, 85vw);
    height: 100dvh;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 32px;
    padding: 65px 16px 0;
    background: var(--clr-surface-a10);
    box-shadow: -4px 0 24px rgba(20, 23, 32, 0.12);
    overflow-y: auto;
    z-index: 999;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-item {
    border-bottom: 1px solid var(--clr-surface-a30);
  }

  .nav-link {
    padding: 16px 0;
    font-size: 16px;
  }

  .nav-link::after {
    display: none;
  }

  .nav-actions {
    flex-direction: column;
    width: 100%;
  }

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

/* ============================================================
   SEITENABSCHNITTE
   ============================================================ */
.bg {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

section:nth-child(even) {
  position: relative;
  background: var(--clr-surface-a10);
}

section:nth-child(odd) {
  position: relative;
  background: var(--clr-surface-a0);
}

section > .content-inner {
  display: block;
  width: 95vw;
  margin: auto;
  padding: 1.25rem 0;
}

body > section:first-of-type .content-inner {
  position: relative;
  padding-top: calc(var(--nav-height) + 1rem);
}

body.impressum > section:first-of-type .content-inner,
body.datenschutz > section:first-of-type .content-inner {
  padding: 0 0 1.25rem;
}

section.impressum,
section.datenschutz {
  background: unset;
}

.impressum,
.datenschutz {
  margin: auto;
  padding-top: var(--nav-height);
}

.impressum p + :is(h1, h2, h3, h4, h5, h6),
.datenschutz p + :is(h1, h2, h3, h4, h5, h6) {
  margin-top: 1em;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  position: relative;
  background: #edf2ff;
}

.footer-flex-container {
  display: flex;
  gap: 6%;
  margin: auto;
  width: 95vw;
  padding: 20px 0;
}

.footer-flex-container figure {
  flex-basis: 50%;
}

#socket {
  display: block;
  position: relative;
  text-align: center;
  padding: 15px 0;
}

@media (max-width: 990px) {
  .footer-flex-container {
    flex-direction: column;
    flex-wrap: wrap;
  }

  .footer-flex-container figure {
    flex-basis: 100%;
  }
  .footer-flex-container figure.left {
    margin-bottom: 6%;
  }
}

@media (max-width: 545px) {
  .copyright {
    display: flex;
    flex-direction: column-reverse;
    flex-wrap: wrap;
  }
}

/* ============================================================
   LEISTUNGEN
   ============================================================ */
container-leist {
  display: flex;
  gap: 5px;
  width: 100%;
  margin-inline: auto;
  border-radius: 25px;
  overflow: hidden;
}

container-leist article {
  position: relative;
  display: flex;
  flex-flow: column wrap;
  align-items: flex-start;
  justify-content: flex-end;
  width: 100%;
  height: 300px;
  padding: 1rem;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
}

container-leist article::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 1), transparent 70%);
  pointer-events: none;
  z-index: 5;
}

container-leist article > * {
  position: relative;
  z-index: 15;
  color: #fff;
}

container-leist article img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: all 0.3s ease-in-out;
}

container-leist article h2 {
  margin-bottom: 0.5rem;
  font-size: 1.75em !important;
  line-height: 1em !important;
  word-break: break-word;
  hyphens: auto;
  transition: all 0.3s ease-in-out;
}

container-leist article p {
  margin-bottom: 1rem;
  font-size: 10px;
  line-height: normal;
  opacity: 0;
  transition: all 0.3s ease-in-out;
}

container-leist article .leist-text {
  max-height: 1px;
  transition: all 0.3s ease-in-out;
}

container-leist article .btn-container {
  align-self: flex-end;
  max-height: 0;
  overflow: hidden;
  transition: all 0.5s ease-in-out;
}

container-leist article .btn {
  align-self: flex-end;
  color: #fff;
  font-size: var(--fs-body);
  text-decoration: none;
  -webkit-font-smoothing: antialiased;
}

/* Aktiv (Klick/Touch) */
container-leist article.active img {
  scale: 1.1;
}
container-leist article.active .leist-text {
  max-height: 600px;
}
container-leist article.active .btn-container {
  max-height: 60px;
}

container-leist article.active p {
  font-size: 16px;
  line-height: 1.7em;
  opacity: 1;
}

@media (max-width: 1199px) {
  container-leist {
    flex-flow: column wrap;
  }
  container-leist article.active {
    height: 500px;
  }

  container-leist article,
  container-leist article h2,
  container-leist article p,
  container-leist article img {
    transition: all 0.5s ease-in-out;
  }
}

@media (min-width: 1200px) {
  container-leist article {
    flex: 1 1 0;
    height: 600px;
  }

  container-leist article.active,
  container-leist article:hover {
    flex-grow: 2;
  }

  container-leist article:hover img {
    scale: 1.1;
  }
  container-leist article:hover .leist-text {
    max-height: 600px;
  }
  container-leist article:hover .btn-container {
    max-height: 60px;
  }

  container-leist article:hover p {
    font-size: 16px;
    line-height: 1.7em;
    opacity: 1;
  }
}

/* PDF-Vorschau */
.pdf-wraper {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 20px;
}

.pdf-wraper img {
  max-height: 300px;
  transform-origin: bottom left;
  transition: transform 0.2s ease-in-out;
}

.pdf-wraper img:hover {
  transform: scale(1.01);
  cursor: zoom-in;
}

@media (max-width: 480px) {
  .pdf-wraper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

.card-container.desktop .card {
  background-color: var(--clr-surface-a10);
  background-image: var(--card-bg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* ============================================================
   FAQ
   ============================================================ */
.faq-container {
  width: 100%;
  border-radius: 10px;
}

.faq-container h2 {
  text-align: center;
  color: var(--primary-color);
}

.faq-item {
  border-bottom: 1px solid var(--primary-color);
}
.faq-item:not(:has(+ .faq-item)) {
  border-bottom: none;
}

.faq-angebot_und_planung:first-child {
  padding: 0 0 16px;
}

.faq-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.faq-gruppe {
  flex: 1 1 33.33%;
  min-width: calc(25% - 2rem);
  padding: 12px 24px;
  background: var(--clr-surface-tonal-a20);
  border-radius: 10px;
}

.faq-gruppe h3:first-of-type {
  margin-bottom: 16px;
}

.faq-content {
  line-height: 1.6;
}

summary {
  display: grid;
  grid-template-columns: 1fr 24px;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  list-style: none;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "";
  display: inline-block;
  min-width: 24px;
  min-height: 24px;
  vertical-align: middle;
  background-color: var(--primary-color-a0);
  -webkit-mask: var(--icon-chevron) center / contain no-repeat;
  mask: var(--icon-chevron) center / contain no-repeat;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}

details[open] summary {
  padding: 16px 0 0;
}
details[open] summary::after {
  transform: rotate(90deg);
}

@media (max-width: 990px) {
  .faq-inner {
    flex-direction: column;
  }
  .faq-gruppe {
    flex-basis: 100%;
  }
}

/* ============================================================
   FORMULAR
   ============================================================ */
#kontakt {
  background: none;
}

.kontakt-section {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.contactForm {
  margin-top: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.25rem;
  position: relative;
}

.field.two {
  flex-direction: row;
  gap: 1rem;
}

.field.two .input-field {
  flex-basis: 50%;
}

@media (max-width: 480px) {
  .field.two {
    flex-wrap: wrap;
  }
  .field.two .input-field {
    flex-basis: 100%;
  }
}

.input-field {
  position: relative;
}

.field .field-label{
  position: absolute;
  top: -0.7em;
  left: 1em;
  z-index: 3;
  padding: 0 0.5em;
  background: var(--primary-color-a20);
  border-radius: var(--br);
  color: var(--label-color);
  font-size: 0.7rem;
  font-weight: bold;
}

.field-label.has-error {
  background: var(--clr-danger-a0);
  color: var(--label-color);
}

/* Eingabefelder (inkl. Suchfeld im Multiselect) */
.field input,
.field textarea,
.field select,
.multiselect-search-box input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 2px solid var(--clr-surface-a30);
  border-radius: var(--br);
  background: var(--clr-surface-a0);
  color: var(--primary-color);
  font-family: inherit;
  font-size: var(--fs-input);
  font-weight: bolder;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.field select {
  appearance: base-select;
}

.field select option {
  font-family: inherit;
  font-weight: normal;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.multiselect-search-box input:focus,
.field input:hover, .field textarea:hover, .field select:hover, .multiselect-search-box input:hover {
  outline: none;
  border-color: var(--primary-color-a0);
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--primary-color-a0) 20%, transparent);
}

.field input.is-invalid,
.field textarea.is-invalid,
.field select.is-invalid {
  border-color: var(--clr-danger-a0);
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--clr-danger-a0) 15%, transparent);
  color: var(--clr-danger-a0);
}

.field textarea {
  resize: none;
  min-height: 120px;
}

.field-error {
  display: none;
  min-height: 1.1em;
  margin-top: 0.35rem;
  color: var(--clr-danger-a0);
  font-size: 0.82rem;
}

.btn.full{
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  pointer-events: none;
  cursor: not-allowed;
  transform: none;
}

/* Statusmeldungen */
.form-status {
  display: none;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--br);
  font-size: 0.95rem;
}

.form-status:not(:empty) {
  display: block;
}

.form-status.success {
  background: #eafaf1;
  color: var(--clr-success-a0);
  border: 1px solid #9fddc5;
}

.form-status.error {
  background: #fdedec;
  color: var(--clr-danger-a0);
  border: 1px solid #f1a9a0;
}

#contactForm-modal:has(.form-status.success) > :not(.form-status) {
  display: none;
}

/* Firmenname nur bei Bedarf */
[data-field="firmenname-field"] {
  display: none;
}
[data-field="firmenname-field"].is-visible {
  display: flex;
}

/* ============================================================
   REFERENZEN: Filter / Multiselect
   ============================================================ */
.btn-filter {
  flex-shrink: 0;
  padding: 10px 14px;
  border: 1px solid var(--clr-surface-a50);
  border-radius: 40px;
  background: transparent;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.btn-filter.active {
  background: var(--clr-surface-a50);
}

@media (max-width: 600px) {
  .btn-filter {
    padding: 10px 14px;
    font-size: var(--fs-body);
  }
}

.multiselect-container {
  position: relative;
  top: var(--nav-height);
  z-index: 5;
  width: 95.05vw;
  margin: auto;
  padding: 1rem 0 0.5rem;
  /* background: var(--clr-surface-a0); */
}

.multiselect-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: none;
  background: transparent;
}

.multiselect-backdrop.open {
  display: block;
}

.multiselect-trigger-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: #edf2ff;
}

.multiselect-trigger {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 0 8px;
  border: 2px solid var(--clr-surface-a30);
  border-radius: var(--br);
  background: transparent;
  cursor: pointer;
}

.multiselect-container.open #multiselect-trigger {
  border-radius: var(--br) var(--br) 0 0;
}

.multiselect-trigger::after {
  content: "";
  display: inline-block;
  flex-shrink: 0;
  width: 0;
  height: 0;
  margin-left: 15px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid currentColor;
  transition: var(--transition-smooth);
}

.multiselect-container.open .multiselect-trigger::after {
  transform: rotate(180deg);
}

.chips-container {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 6px;
  min-width: 0;
  margin-right: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  z-index: 7;
}

.chips-container::-webkit-scrollbar {
  display: none;
}

#placeholder-text {
  display: block;
}
.multiselect-container[data-has-filters="true"] #placeholder-text {
  display: none;
}

.placeholder-text {
  position: absolute;
  font-size: 15px;
  white-space: nowrap;
  pointer-events: none;
}

.filter-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--clr-surface-a50);
  border: 1px solid #fff;
  border-radius: 15px;
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-smooth);
  -webkit-tap-highlight-color: transparent;
}

.filter-chip:hover,
.filter-chip:active {
  background: var(--clr-danger-a20);
  border-color: var(--clr-danger-a20);
  color: #fff;
}

.chip-remove {
  text-overflow: ellipsis;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.multiselect-reset {
  min-width: fit-content;
  padding: 6px 12px;
  background: var(--primary-color-a20);
  border: 2px solid var(--clr-surface-a30);
  border-radius: var(--br);
  color: #fff;
  font-size: var(--fs-input);
  font-weight: bold;
  cursor: pointer;
  opacity: 0.55;
  pointer-events: none;
  transition: var(--transition-smooth);
  -webkit-tap-highlight-color: transparent;
}

.multiselect-container[data-has-filters="true"] .multiselect-reset {
  display: block;
  opacity: 1;
  pointer-events: all;
}

@media (hover: hover) and (pointer: fine) {
  .multiselect-reset:hover {
    background: var(--clr-danger-a20);
    border-color: var(--clr-danger-a20);
    color: #fff;
  }
}

@media (hover: none), (pointer: coarse) {
  .multiselect-reset:active {
    background: var(--clr-danger-a20);
    border-color: var(--clr-danger-a20);
    color: #fff;
  }
}

.multiselect-dropdown {
  position: absolute;
  left: 0;
  display: none;
  width: 100%;
  max-height: 350px;
  overflow-y: auto;
  background: #edf2ff;
  border: 2px solid var(--clr-surface-a30);
  border-top-width: 0;
  border-radius: 0 0 var(--br) var(--br);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  z-index: 100;
}

.multiselect-container.open .multiselect-dropdown {
  display: block;
}

.multiselect-search-box {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 12px;
  padding: 8px;
  backdrop-filter: blur(10px);
}

.multiselect-option,
.msg-option {
  display: flex;
  align-items: center;
  padding: 12px 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.multiselect-option:hover {
  background: var(--clr-surface-a40);
}
.multiselect-option.hidden-option {
  display: none !important;
}

.multiselect-option input {
  position: absolute;
  opacity: 0;
}

.checkbox-custom {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-right: 12px;
  border: 2px solid var(--primary-color-a20);
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.multiselect-option input:checked ~ .checkbox-custom {
  background: var(--primary-color-a20);
  border-color: var(--primary-color-a20);
}

.multiselect-option input:checked ~ .checkbox-custom::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--clr-surface-a30);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.option-text {
  font-size: 15px;
  font-weight: 500;
}

#no-results {
  pointer-events: none;
}

/* ============================================================
   REFERENZEN: Karten
   ============================================================ */
.referenz-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  justify-items: center;
  gap: 20px;
}

.referenz {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #edf2ff;
  border: 2px solid var(--clr-surface-a30);
  border-radius: var(--br);
  overflow: hidden;
  animation: bild-einblenden 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.referenz:hover {
  outline: none;
  border-color: var(--primary-color-a0);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color-a0) 20%, transparent);
}

.ref-mod {
  all: unset;
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: pointer;
  box-sizing: border-box;
}

.titel-bild {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  background: url("/assets/img/skeleton-loader.svg") center / auto no-repeat;
}

.lightbox {
  background: url(/assets/img/skeleton-loader.svg) center / contain no-repeat;
}

.referenz-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  overflow: hidden;
}

.referenz-content {
  position: relative;
}

.referenz-content .titel {
  margin: 5px 0;
  padding: 10px 12px 0;
  font-size: 18px;
  hyphens: auto;
}

.referenz-content .wowas {
  margin-bottom: 10px;
  padding: 0 12px;
  font-size: 13px;
}

.referenz-content .kbeschreibung {
  min-height: calc(1.6em * 3);
  padding: 0 12px 10px;
  font-size: 14px;
  line-height: 1.6;
}

.referenz-links {
  margin-top: auto;
  margin-bottom: 12px;
  padding: 0 12px;
}

/* Kategorie-Badges an der Karte (im Referenz-Modal überschrieben) */
.referenz-content .kategorien {
  position: absolute;
  top: -11.8px;
  display: flex;
  gap: 8px;
  width: 100%;
  padding: 0 8px;
  overflow: hidden;
}

.referenz-content .kategorien .kategorie {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--primary-color-a20);
  color: var(--clr-surface-a0);
  font-size: 11px;
  font-weight: 500;
}

@keyframes bild-einblenden {
  from {
    translate: 0 40px;
    opacity: 0;
  }
  to {
    translate: 0 0;
    opacity: 1;
  }
}

/* Galerie-Seite */
.gallery-img {
  animation: bild-einblenden 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
	  
.gallery-container {
  column-width: 240px;
  column-gap: 1rem;
}

/* Spezielle Regel für Mobilgeräte (Bildschirme bis ca. 480px Breite) */
@media (max-width: 480px) {
  .gallery-container {
    /* Deaktiviert die feste Breitenberechnung und erzwingt genau 2 Spalten */
    column-count: 2; 
    column-gap: 0.5rem; /* Optional: Etwas weniger Abstand auf kleinen Bildschirmen */
  }
}

.gallery-container img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 1rem;
  border-radius: var(--br);
  break-inside: avoid;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.gallery-container img:hover {
  scale: 1.05;
}

@media (max-width: 600px) {
  .ref-section {
    width: 100vw;
  }

  .referenz-container {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* ============================================================
   MODAL: Referenz (Galerie + Text)
   ============================================================ */
.ref-modal {
  width: min(960px, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--br);
  background: var(--clr-surface-a0);
  color: var(--primary-color);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.4);
  overflow: hidden;
}

/* Inhalt scrollt, nicht der Dialog selbst */
.ref-modal > section {
  position: relative;
  display: block;
  background: none; /* überschreibt section:nth-child(odd/even) */
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ref-modal .close-modal,
.close-modal {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--primary-color);
  transition:
    background 0.2s,
    transform 0.2s;
  border: 2px solid var(--clr-surface-a30);
  cursor: pointer;
}

.ref-modal .close-modal:hover,
.close-modal:hover {
  border-color: var(--primary-color-a20);
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--primary-color-a0) 20%, transparent);
}

.ref-modal .close-modal:active,
.close-modal:active {
  transform: scale(0.92);
}

/* Medien-Spalte: Hauptbild + Thumbnails gehören zusammen */
.ref-modal .modal-media {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* Galerie */
.ref-modal .modal-gallery {
  position: relative;
  flex: none;
  aspect-ratio: 4 / 3;
  background: #111;
  overflow: hidden;
  touch-action: pan-y; /* vertikal scrollen, horizontal = Wischgeste */
}

.ref-modal .gallery-main {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  object-position: attr(
    data-position type(<length-percentage> +),
    center
  ); /* z. B. data-position="50% 30%" */
  cursor: zoom-in;
  -webkit-user-drag: none;
  will-change: transform;
}

.ref-modal .gallery-main[data-position="top"] {
  object-position: top;
}
.ref-modal .gallery-main[data-position="bottom"] {
  object-position: bottom;
}
.ref-modal .gallery-main[data-position="left"] {
  object-position: left;
}
.ref-modal .gallery-main[data-position="right"] {
  object-position: right;
}

.ref-modal .gallery-arrow {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  z-index: 2;
  transition:
    background 0.2s,
    transform 0.2s;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 2px solid rgb(255 255 255 / 0.28);
  cursor: pointer;
}

.ref-modal .gallery-arrow.left {
  left: 0.5rem;
}
.ref-modal .gallery-arrow.right {
  right: 0.5rem;
}

.ref-modal .gallery-arrow:hover {
  border-color: var(--primary-color-a20);
}
.ref-modal .gallery-arrow:active {
  transform: scale(0.92);
}

.ref-modal .gallery-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.ref-modal .gallery-arrow:focus-visible,
.ref-modal .close-modal:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Kategorie-Tags auf dem Bild */
.ref-modal .kategorien {
  width: auto;
  padding: 0 0.5rem;
  overflow: visible;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  pointer-events: none;
}

.ref-modal .kategorie {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--primary-color-a20);
  color: var(--clr-surface-a0);
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Inhalt */
.ref-modal .modal-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem;
  color: var(--primary-color);
}

.img-body {
  position: absolute;
  width: 100%;
  bottom: 0;
  z-index: 1;
}

.ref-modal .gallery-thumbs {
  display: flex;
  flex: none;
  gap: 0.5rem;
  padding: 0.6rem 0.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 0.35) transparent;
  scroll-snap-type: x proximity;
}

/* zentriert, solange alle passen; scrollt sauber, sobald es mehr werden */
/* .ref-modal .gallery-thumb:first-child {
  margin-left: auto;
}
.ref-modal .gallery-thumb:last-child {
  margin-right: auto;
} */

.ref-modal .gallery-thumb {
  flex: 0 0 auto;
  width: 84px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  opacity: 0.5;
  outline: 2px solid transparent;
  outline-offset: -2px; /* Rahmen innen, wird nicht abgeschnitten */
  cursor: pointer;
  background: url(/assets/img/skeleton-loader.svg) center / contain no-repeat;
  scroll-snap-align: center;
  transition:
    opacity 0.2s,
    outline-color 0.2s;
  outline-color: var(--label-color);
}

.ref-modal .gallery-thumb.active {
  opacity: 1;
  outline-color: var(--primary-color-a20);
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--primary-color-a0) 20%, transparent);
}

@media (hover: hover) and (pointer: fine) {
  .ref-modal .gallery-thumb:hover {
    opacity: 0.85;
  }
  .ref-modal .gallery-thumb.active:hover {
    opacity: 1;
  }
}

.ref-modal .modal-title {
  margin-top: 0.25rem;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.2;
}

.ref-modal .modal-meta {
  font-size: 0.9rem;
  color: color-mix(in srgb, var(--primary-color) 65%, transparent);
}

.ref-modal .modal-body .btn {
  margin-top: 0.5rem;
}

.ref-modal .modal-text {
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.7;
}

/* Desktop: Galerie links, Inhalt rechts */
@media (min-width: 860px) {
  .ref-modal > section {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    height: min(640px, calc(100dvh - 2rem));
    overflow: hidden;
  }

  .ref-modal .modal-gallery {
    flex: 1 1 0;
    min-height: 0;
    aspect-ratio: auto;
    max-height: none;
  }

  .ref-modal .modal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (max-width: 860px) {
  .ref-modal .close-modal {
    top: max(0.5rem, env(safe-area-inset-top));
    right: max(0.5rem, env(safe-area-inset-right));
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    border-color: rgb(255 255 255 / 0.28);
  }
}

/* Mobil: Vollbild */
@media (max-width: 600px) {
  .ref-modal {
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .ref-modal > section {
    height: 100%;
    max-height: none;
  }

  .ref-modal .close-modal {
    top: max(0.5rem, env(safe-area-inset-top));
    right: max(0.5rem, env(safe-area-inset-right));
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    border-color: rgb(255 255 255 / 0.28);
  }

  .ref-modal .kategorie {
    font-size: 0.7rem;
  }

  .ref-modal .gallery-thumb {
    width: 64px;
    height: 48px;
  }

  .ref-modal .gallery-arrow {
    width: 38px;
    height: 38px;
  }

  .ref-modal .modal-body {
    padding: 0.5rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

/* ============================================================
   MODAL: Bild-Lightbox
   ============================================================ */
#imageModal {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(1rem, 4vw, 3rem);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  overflow: hidden;
  touch-action: pan-y;
}

#imageModal[open] {
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  gap: 0.75rem;
}

#modalImg {
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
  border-radius: var(--br);
  box-shadow: 0 10px 40px rgb(0 0 0 / 0.5);
  -webkit-user-drag: none;
  will-change: transform;
}

#modalCaption {
  max-width: 80ch;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.4;
  color: rgb(255 255 255 / 0.85);
}

#imageModal .close-modal,
#imageModal .modal-nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 2px solid rgb(255 255 255 / 0.28);
  font-size: 1rem;
  cursor: pointer;
}

#imageModal .close-modal:hover,
#imageModal .modal-nav:hover {
  background: rgba(0, 0, 0, 0.55);
  border-color: var(--primary-color-a0);
}

#imageModal .close-modal:active,
#imageModal .modal-nav:active {
  transform: scale(0.92);
}

#imageModal .close-modal:focus-visible,
#imageModal .modal-nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

#imageModal .close-modal {
  top: max(0.5rem, env(safe-area-inset-top));
  right: max(0.5rem, env(safe-area-inset-right));
  z-index: 2;
}

#imageModal .modal-nav {
  top: 50%;
  translate: 0 -50%;
  z-index: 1;
}

#imageModal .modal-nav.prev {
  left: max(0.5rem, env(safe-area-inset-left));
}
#imageModal .modal-nav.next {
  right: max(0.5rem, env(safe-area-inset-right));
}

#imageModal .modal-nav:disabled {
  display: none;
}

@media (max-width: 600px) {
  #imageModal {
    padding: 3.5rem 0.5rem 1rem;
  }

  #imageModal .modal-nav {
    top: auto;
    bottom: 1rem;
    translate: 0;
  }

  #imageModal .modal-nav.prev {
    left: 1rem;
  }
  #imageModal .modal-nav.next {
    right: 1rem;
  }

  #modalCaption {
    align-content: center;
    min-height: 44px;
    padding-inline: 3.5rem; /* Platz für die Pfeile */
  }
}

/* ============================================================
   MODAL: Leistung & Kontakt
   ============================================================ */
#kontaktModal {
  width: min(960px, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--br);
  color: var(--primary-color);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.4);
  overflow: hidden;
}

#kontaktModal:has(.file-list li){
  overflow: auto;
}

#kontaktModal .kontakt-modal-section,
.leist-modal-container {
  margin: 1rem;
  color: var(--primary-color);
}

#kontaktModal h3 {
  margin-right: calc(40px + 0.5rem - 12px);
  font-size: 22px;
  line-height: 1.4;
}

@media (max-width: 600px) {
  #kontaktModal {
    inset: 0;
    width: 100lvw;
    max-width: 100lvw;
    height: 100lvh;
    max-height: 100lvh;
    margin: 0;
    border-radius: 0;
    overflow-y: scroll;
  }

  #kontaktModal .kontakt-modal-section {
    height: 100%;
  }

  #kontaktModal h3 {
    font-size: 19px;
  }

  #kontaktModal .field.two {
    flex-direction: column;
    gap: 16px;
  }
}

/* ============================================================
   Reduced Motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .referenz,
  .gallery-img {
    animation: none;
  }

  dialog,
  dialog::backdrop,
  .ref-modal .close-modal,
  .ref-modal .gallery-arrow,
  .ref-modal .gallery-thumb {
    transition: none;
  }
}

/* ============================================================
   DARK MODE (deaktiviert – zum Aktivieren in @media einkommentieren
   und oben in :root `color-scheme: light dark;` setzen)
   ============================================================ */
/*
@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #e8ecf5;
    --label-color: #000;
    --cta: rgba(20, 23, 32, 0.75);
    --overlay: radial-gradient(rgba(14, 17, 30, 0.60) 0%, rgba(14, 17, 30, 0.85) 100%);
    --nav-bar-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.20);
    --sb-track-color: #1e2130;
    --sb-thumb-color: #7ba8ff;

    --primary-color-a0: #7ba8ff;
    --primary-color-a10: #8fb5ff;
    --primary-color-a20: #a3c2ff;
    --primary-color-a30: #b7d0ff;
    --primary-color-a40: #cbddff;
    --primary-color-a50: #dfe9ff;

    --clr-surface-a0: #141720;
    --clr-surface-a10: #1e2130;
    --clr-surface-a20: #282c3f;
    --clr-surface-a30: #33374f;
    --clr-surface-a40: #3e4360;
    --clr-surface-a50: #4a4f70;

    --clr-surface-tonal-a0: #181c2a;
    --clr-surface-tonal-a10: #222638;
    --clr-surface-tonal-a20: #2c3047;
    --clr-surface-tonal-a30: #373b57;
    --clr-surface-tonal-a40: #424667;
    --clr-surface-tonal-a50: #4e5278;

    --clr-success-a0: #4ade9a;
    --clr-success-a10: #3dce8b;
    --clr-success-a20: #2fbe7c;

    --clr-warning-a0: #fbbf24;
    --clr-warning-a10: #f0ac10;
    --clr-warning-a20: #e59900;

    --clr-danger-a0: #f87171;
    --clr-danger-a10: #ef5050;
    --clr-danger-a20: #e63030;

    --clr-info-a0: #60a5fa;
    --clr-info-a10: #4b95f8;
    --clr-info-a20: #3685f5;
  }

  #navBackdrop { background: rgba(0, 0, 0, 0.70); }

  @media (max-width: 768px) {
    .nav-menu { box-shadow: -4px 0 24px rgba(0, 0, 0, 0.45); }
  }

  .form-status.success { background: #0d2b1e; border-color: #1a7a52; }
  .form-status.error   { background: #2d1515; border-color: #b91c1c; }
}
*/
