:root {
  --af-red: #c32020;
  --af-blue: #28558e;
  --af-beige: #efdfbb;
  --af-gold: #e19c2e;
  --af-text: #111111;
  --af-muted: #222222;
  --af-form: #d3d3d3;
  --af-form-deep: #cccccc;
  --af-white: #ffffff;
  --af-max: 1040px;
  --af-pad: clamp(1.25rem, 4vw, 2.5rem);
  --af-font: "Open Sans", Arial, Helvetica, sans-serif;
}

/* Anchor-Offset unter Sticky-Header */
:root {
  --af-header-offset: 120px;
}

html {
  scroll-padding-top: var(--af-header-offset);
  scroll-behavior: smooth;
}

[id] {
  scroll-margin-top: var(--af-header-offset);
}


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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--af-font);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--af-text);
  background: var(--af-white);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--af-blue);
}

a:hover {
  color: var(--af-red);
}

.af-skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: #000;
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
}

.af-skip:focus {
  left: 0;
}

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

.af-container {
  width: min(100% - (var(--af-pad) * 2), var(--af-max));
  margin-inline: auto;
}

/* Header */
.af-header {
  background: var(--af-white);
  border-bottom: 1px solid #ececec;
  position: sticky;
  top: 0;
  z-index: 100;
}

.af-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  min-height: 92px;
  padding-block: 0.65rem;
}

.af-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.af-logo img {
  width: 160px;
  height: auto;
  display: block;
}

.af-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.af-nav a {
  color: var(--af-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
}

.af-nav a:hover {
  color: var(--af-red);
}

.af-social {
  color: var(--af-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.af-social:hover {
  color: var(--af-red);
}

.af-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  padding: 10px;
  cursor: pointer;
}

.af-nav-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: #111;
}

/* Elementor helpers */
.af-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--af-muted);
  font-weight: 700;
}

.af-presse-list {
  margin-top: 0.35rem;
}

.af-presse-link {
  color: var(--af-blue);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  font-weight: 700;
}

.af-presse-link:hover {
  color: var(--af-red);
}

.af-list li {
  margin-bottom: 0.85rem;
}

.af-more a,
.af-inline-more {
  color: var(--af-text);
  font-weight: 700;
  text-decoration: none;
}

.af-more a:hover,
.af-inline-more:hover {
  color: var(--af-red);
}

#projekte .elementor-widget-image img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  width: 100%;
  height: auto;
}

#partner .elementor-widget-image img,
#partner + .elementor-section .elementor-widget-image img {
  max-height: 90px;
  width: auto;
  object-fit: contain;
  margin-inline: auto;
}

/* Beige Kacheln: gleicher Seitenabstand wie übrige Sections (20px) */
#leitgedanken + .e-con.e-parent,
#themen + .e-con.e-parent {
  --padding-left: 20px;
  --padding-right: 20px;
  --content-width: 1040px;
}

/* Partner-Logos: Mobile – zwei oben, drittes darunter */
@media (max-width: 767px) {
  #partner + .elementor-section > .elementor-container {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1rem;
    align-items: center;
    justify-items: center;
  }

  #partner + .elementor-section > .elementor-container > .elementor-column {
    width: 100% !important;
    max-width: none !important;
  }

  #partner + .elementor-section > .elementor-container > .elementor-column:nth-child(3) {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 50% !important;
  }

  #partner + .elementor-section .elementor-widget-image img {
    max-height: 88px;
    width: 100%;
    height: 88px;
    object-fit: contain;
  }
}

/* Formular */
.af-form-wrap {
  max-width: 560px;
  margin-inline: auto;
  margin-top: 1.25rem;
  padding: clamp(1.35rem, 3.5vw, 2rem);
  background: #fff;
  border: 1px solid rgba(40, 85, 142, 0.12);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(40, 85, 142, 0.06);
}

.af-form {
  display: grid;
  gap: 1.15rem;
}

.af-field {
  display: grid;
  gap: 0.4rem;
}

.af-field label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--af-blue);
}

.af-field--message label {
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.92rem;
  line-height: 1.35;
}

.af-form input,
.af-form textarea {
  width: 100%;
  border: 1.5px solid rgba(40, 85, 142, 0.28);
  border-radius: 10px;
  background: #fff;
  color: var(--af-text);
  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.4;
  padding: 0.85rem 1rem;
  outline: none;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.af-form textarea {
  min-height: 148px;
  resize: vertical;
  line-height: 1.55;
}

.af-form input:hover,
.af-form textarea:hover {
  border-color: rgba(40, 85, 142, 0.5);
}

.af-form input:focus,
.af-form textarea:focus {
  border-color: var(--af-gold);
  box-shadow: 0 0 0 3px rgba(225, 156, 46, 0.2);
}

.af-form input::placeholder,
.af-form textarea::placeholder {
  color: transparent;
}

.af-form button {
  justify-self: center;
  margin-top: 0.55rem;
  border: 0;
  border-radius: 10px;
  background: var(--af-gold);
  color: #fff;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.85rem 2.4rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.28s ease,
    background-color 0.28s ease;
}

.af-form button span {
  position: relative;
  z-index: 1;
}

.af-form button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.28) 45%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
}

.af-form button:hover {
  background: #d48f22;
  transform: translateY(-2px);
}

.af-form button:hover::after {
  transform: translateX(120%);
}

.af-form button:focus-visible {
  outline: 2px solid var(--af-blue);
  outline-offset: 3px;
}

.af-form button:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.af-form-status:empty {
  display: none;
}

.af-form-status:not(:empty) {
  margin-bottom: 1rem;
  animation: af-form-notice-in 0.35s ease;
}

@keyframes af-form-notice-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.af-hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.af-form-notice {
  padding: 0.85rem 1rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.af-form-notice--success {
  background: rgba(232, 246, 234, 0.95);
  border-color: rgba(27, 94, 32, 0.18);
  color: #1b5e20;
}

.af-form-notice--error {
  background: rgba(253, 236, 234, 0.95);
  border-color: rgba(138, 31, 17, 0.18);
  color: #8a1f11;
}

@media (max-width: 600px) {
  .af-form-wrap {
    padding: 1.15rem 1rem 1.35rem;
  }

  .af-form button {
    width: 100%;
  }
}

.af-footer {
  border-top: 1px solid #ececec;
  padding: 1.25rem 0 2rem;
  color: #666;
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 900px) {
  .af-nav-toggle {
    display: block;
    justify-self: end;
    grid-column: 2;
    grid-row: 1;
  }

  .af-social {
    grid-column: 3;
  }

  .af-nav {
    display: none;
    grid-column: 1 / -1;
    padding-bottom: 0.75rem;
  }

  .af-nav.is-open {
    display: block;
  }

  .af-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }
}

@media (max-width: 520px) {
  .af-logo img {
    width: 120px;
  }
}

/* Globaler Fließtext */
body,
.elementor-widget-text-editor,
.elementor-widget-text-editor p,
.elementor-widget-text-editor li,
.af-list {
  font-size: 20px;
  font-weight: 600;
}

@media (max-width: 767px) {
  body,
  .elementor-widget-text-editor,
  .elementor-widget-text-editor p,
  .elementor-widget-text-editor li,
  .af-list {
    font-size: 16px;
  }
}

/* h3 ExtraBold 24px */
h3,
.elementor-widget-heading h3.elementor-heading-title {
  font-family: "Open Sans", Arial, Helvetica, sans-serif !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  line-height: 1.3;
}

/* Projekte: Desktop 3-spaltig, Mobile Slideshow + Accordion */
.af-projects-grid > .elementor-container {
  align-items: stretch;
}

.af-projects-grid .af-project-card {
  display: flex;
  flex-direction: column;
}

.af-projects-grid .af-project-image,
.af-projects-grid .af-project-image .elementor-widget-container {
  width: 100%;
}

.af-projects-grid .af-project-image img {
  width: 100% !important;
  height: 280px !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
}

.af-projects-grid .af-project-title .elementor-heading-title {
  min-height: 3.2em;
  display: flex;
  align-items: flex-end;
}

.af-projects-grid .af-inline-more,
.af-projects-grid .af-project-more {
  color: var(--af-text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 700;
}

.af-projects-grid .af-inline-more:hover,
.af-projects-grid .af-project-more:hover {
  color: var(--af-red);
}





.af-projects-grid .af-proj-nav {
  display: none;
}

@media (max-width: 767px) {
  .af-projects-grid > .elementor-container {
    display: block;
    position: relative;
  }

  .af-projects-grid .af-project-card {
    width: 100% !important;
    max-width: 100% !important;
    display: none !important;
  }

  /* Aktiver Slide (JS) */
  .af-projects-grid .af-project-card.is-active {
    display: flex !important;
  }

  /* Fallback falls JS noch nicht gelaufen ist / fehlschlägt */
  .af-projects-grid:not(:has(.af-project-card.is-active)) .af-project-card:first-child {
    display: flex !important;
  }

  .af-projects-grid .af-project-image img {
    height: 220px !important;
  }

  .af-projects-grid .af-proj-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.1rem;
  }

  .af-projects-grid .af-proj-btn {
    appearance: none;
    border: 1px solid #d7d7d7;
    background: #fff;
    color: var(--af-blue);
    width: 42px;
    height: 42px;
    border-radius: 999px;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
  }

  .af-projects-grid .af-proj-dots {
    display: flex;
    gap: 0.45rem;
  }

  .af-projects-grid .af-proj-dot {
    appearance: none;
    border: 0;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #cfcfcf;
    cursor: pointer;
    padding: 0;
  }

  .af-projects-grid .af-proj-dot.is-active {
    background: var(--af-blue);
  }
}

@media (min-width: 768px) {
  .af-projects-grid .af-project-card {
    display: flex !important;
  }

  .af-projects-grid .af-proj-nav {
    display: none !important;
  }
}

/* Projekt-Text Accordion: gesamter Teaser (auch mehrere <p>) auf 3 Zeilen */
.af-projects-grid .af-project-pate,
.af-projects-grid .af-project-text p.af-project-pate {
  display: block !important;
  margin-top: 0.5rem;
}

.af-projects-grid .af-project-teaser {
  display: block;
  line-height: 1.55;
  max-height: calc(1.55em * 3);
  overflow: hidden;
  margin: 0 0 0.35rem;
}

.af-projects-grid .af-project-teaser > p {
  margin: 0;
  line-height: inherit;
}

.af-projects-grid .af-project-card.is-open .af-project-teaser {
  max-height: none;
  overflow: visible;
}

.af-projects-grid .af-project-card.is-open .af-project-teaser > p + p {
  margin-top: 0.55em;
}

.af-projects-grid .af-project-more-wrap {
  margin: 0 0 0.35rem;
}

/* Footer + Impressum */
.af-footer p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  justify-content: center;
  align-items: center;
}
.af-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.af-footer a:hover {
  color: var(--af-red);
}
.af-footer__sep {
  opacity: 0.55;
}

.af-page {
  padding: 3rem 1.25rem 4rem;
  max-width: 720px;
  margin-inline: auto;
}
.af-page h1 {
  margin: 0 0 1rem;
  color: var(--af-red);
  font-size: 32px;
  font-weight: 800;
}
.af-page h2 {
  margin: 1.75rem 0 0.6rem;
  color: var(--af-blue);
  font-size: 24px;
  font-weight: 800;
}
.af-page p {
  margin: 0 0 1rem;
  line-height: 1.55;
}
.af-page a {
  color: var(--af-blue);
}
