/* =========================================================
   Ingenieurbüro für Baustatik Thomas Büchel
   Nachbau von www.ib-buechel.de
   Fonts: Quicksand (Headlines/Navigation), Assistant (Fließtext)
   ========================================================= */

/* ---------- Custom Properties ---------- */
:root {
  --color-red: #ff0408;
  --color-red-dark: #e60306;
  --color-text: #333333;
  --color-text-soft: #999999;
  --color-muted: #8a8a8a;
  --color-white: #ffffff;
  --color-page-bg: #333333;
  --color-box: #e4e4e4;
  --color-border: #dcdcdc;
  --color-border-soft: #ececec;

  --font-head: "Quicksand", "Century Gothic", "Trebuchet MS", sans-serif;
  --font-body: "Assistant", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --container: 1200px;
  --header-h: 168px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 16px;
  --sp-4: 24px;
  --sp-5: 32px;
  --sp-6: 48px;
  --sp-7: 64px;
  --sp-8: 96px;

  --transition: all .25s ease;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--color-page-bg);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 18px;
  line-height: 32px;
  color: var(--color-text-soft);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--color-red); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-red-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 400;
  margin: 0 0 var(--sp-3);
  line-height: 1.25;
}

p { margin: 0 0 28px; }

ul { margin: 0 0 28px; padding-left: 22px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-red);
  color: #fff;
  padding: 12px 20px;
  z-index: 999;
}
.skip-link:focus { left: 0; color: #fff; }

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

/* ---------- Layout ---------- */
.page {
  background: var(--color-white);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 56px 0; }
.section--top { padding-top: 118px; }
.section--flush { padding-top: 70px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border-soft);
  position: relative;
  z-index: 60;
}

.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--color-text);
  flex-shrink: 0;
}
.logo:hover { color: var(--color-text); }

.logo__mark { width: 110px; height: 148px; flex-shrink: 0; }

.logo__text {
  font-family: var(--font-head);
  line-height: 1.35;
}
.logo__line1 {
  display: block;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: .02em;
  color: #1a1a1a;
}
.logo__line2 {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: #111111;
}

/* Navigation */
.main-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-nav__link {
  display: block;
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 400;
  color: #6f6f6f;
  padding: 10px 18px;
  white-space: nowrap;
}
.main-nav__link:hover,
.main-nav__link:focus { color: var(--color-red); }

/* Dropdown */
.main-nav__item--has-sub { position: relative; }

.main-nav__caret {
  display: inline-block;
  width: 8px; height: 8px;
  margin-left: 7px;
  border-right: 1.5px solid #9a9a9a;
  border-bottom: 1.5px solid #9a9a9a;
  transform: translateY(-3px) rotate(45deg);
}

.main-nav__sub {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  position: absolute;
  top: 100%;
  left: 6px;
  min-width: 240px;
  background: var(--color-white);
  border: 1px solid var(--color-border-soft);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: var(--transition);
}
.main-nav__item--has-sub:hover > .main-nav__sub,
.main-nav__item--has-sub:focus-within > .main-nav__sub {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.main-nav__sub a {
  display: block;
  padding: 9px 20px;
  font-family: var(--font-head);
  font-size: 16px;
  color: #6f6f6f;
}
.main-nav__sub a:hover { color: var(--color-red); background: #f7f7f7; }

/* Burger */
.nav-toggle {
  display: none;
  width: 46px; height: 46px;
  border: 0;
  background: transparent;
  padding: 10px;
  cursor: pointer;
}
.nav-toggle__bar {
  display: block;
  height: 2px;
  background: #555;
  margin: 5px 0;
  transition: var(--transition);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 70;
}
.nav-backdrop.is-visible { opacity: 1; visibility: visible; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  width: 100%;
  height: 507px;
  overflow: hidden;
  background: #222;
}

.hero__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero__slide.is-active { opacity: 1; }

/* Hero-Motive */
.hero__slide--home { background-image: url("../../../images/001_klein2.jpeg"); }
.hero__slide--bau1 { background-image: url("../../../images/slider3/0041.jpeg"); }
.hero__slide--bau2 { background-image: url("../../../images/slider3/003.jpeg"); }
.hero__slide--bau3 { background-image: url("../../../images/slider3/002.jpeg"); }

/* Rote diagonale Fläche auf der Startseite */
.hero--home .hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 4, 8, .78);
  clip-path: polygon(63% 0, 100% 0, 100% 100%, 27% 100%);
  pointer-events: none;
}

.hero__caption {
  position: absolute;
  right: 12%;
  bottom: 20%;
  text-align: center;
  color: var(--color-white);
  z-index: 2;
}
.hero__title {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 48px;
  line-height: 1.15;
  margin: 0 0 6px;
  color: var(--color-white);
}
.hero__subtitle {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 30px;
  margin: 0;
  color: var(--color-white);
}

/* ---------- Überschriften mit rotem Dreieck ---------- */
.headline {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 35px;
  font-weight: 400;
  color: var(--color-red);
  margin: 0 0 10px;
}
.headline::before {
  content: "";
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background: var(--color-red);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.headline--plain::before { display: none; }

.subline {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 20px;
  color: #b5b5b5;
  margin: 0 0 34px;
}

.headline--small {
  font-size: 22px;
  color: var(--color-red);
  margin-bottom: 22px;
}

/* ---------- Text / Spalten ---------- */
.lead p,
.text p {
  font-size: 20px;
  line-height: 35px;
  color: var(--color-text-soft);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  align-items: start;
}

.media img { width: 100%; }

/* ---------- Timeline (über uns) ---------- */
.timeline { margin: 0; padding: 0; }
.timeline__date {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 20px;
  color: var(--color-red);
  margin: 0 0 6px;
}
.timeline__desc {
  font-size: 18px;
  line-height: 30px;
  color: var(--color-text);
  margin: 0 0 34px;
}

/* ---------- Akkordeon (Leistungen) ---------- */
.accordion { border: 0; }

.accordion__item + .accordion__item { margin-top: 12px; }

.accordion__header { margin: 0; }

.accordion__trigger {
  width: 100%;
  display: block;
  text-align: center;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  padding: 18px 24px;
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 400;
  color: var(--color-text);
  cursor: pointer;
  transition: var(--transition);
}
.accordion__trigger:hover { color: var(--color-red); }
.accordion__trigger[aria-expanded="true"] { color: var(--color-text); }

.accordion__panel {
  border: 1px solid var(--color-border);
  border-top: 0;
  background: #fafafa;
  padding: 0 34px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
}
.accordion__panel.is-open { padding: 26px 34px 14px; max-height: 600px; }

.accordion__panel ul { margin: 0; padding-left: 20px; }
.accordion__panel li {
  font-size: 18px;
  line-height: 30px;
  color: var(--color-text);
  margin-bottom: 16px;
}
.accordion__panel p {
  font-size: 18px;
  line-height: 30px;
  color: var(--color-text);
}

/* ---------- Referenzen-Übersicht ---------- */
.ref-box {
  background: var(--color-box);
  padding: 40px 40px 30px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.ref-box__col { padding: 0 30px; }
.ref-box__col:first-child { border-right: 1px solid #d0d0d0; padding-left: 0; }
.ref-box__col:last-child { padding-right: 0; }

.ref-box h2 {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 22px;
  color: var(--color-red);
  margin: 0 0 10px;
}
.ref-box h2 + ul { margin-bottom: 30px; }
.ref-box ul { padding-left: 22px; }
.ref-box li {
  font-size: 17px;
  line-height: 30px;
  color: var(--color-text);
}

/* ---------- Referenz-Projekte (Detailseiten) ---------- */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 32px;
  row-gap: 0;
  align-items: start;
}

.project { margin-bottom: 56px; }

.project__head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--color-border);
}
.project__name,
.project__place {
  padding: 16px 18px;
  font-size: 18px;
  color: var(--color-text);
}
.project__name { border-right: 1px solid var(--color-border); }

/* Slider */
.slider {
  position: relative;
  margin-top: 36px;
  background: transparent;
}
.slider__viewport {
  position: relative;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.slider__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease;
}
.slider__slide.is-active { opacity: 1; visibility: visible; }
.slider__slide img {
  max-height: 250px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.slider__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 68px;
  border: 0;
  background: rgba(90, 90, 90, .78);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  transition: var(--transition);
}
.slider__btn:hover { background: rgba(60, 60, 60, .9); }
.slider__btn--prev { left: 6%; }
.slider__btn--next { right: 6%; }

/* ---------- News-Spalten ---------- */
.feature__title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 400;
  color: #b0b0b0;
  margin: 0 0 6px;
}
.feature__title .fa,
.feature__title .fa-solid { color: var(--color-red); font-size: 24px; }

.feature ul { padding-left: 22px; margin-top: 10px; }
.feature li {
  font-size: 18px;
  line-height: 30px;
  color: var(--color-text);
}

/* ---------- Kontakt ---------- */
.contact-data p { font-size: 18px; line-height: 32px; color: var(--color-text); }
.contact-data strong { color: var(--color-text); font-weight: 700; }
.contact-data a { color: inherit; }
.contact-data a:hover { color: var(--color-red); }

.form { max-width: 640px; margin-top: 34px; }

.form__row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}
.form__label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
  padding-top: 10px;
}
.form__field input,
.form__field textarea {
  width: 100%;
  max-width: 340px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-text);
  padding: 10px 12px;
  border: 1px solid #cfcfcf;
  border-radius: 3px;
  background: #fff;
  transition: var(--transition);
}
.form__field textarea { max-width: 470px; min-height: 92px; resize: vertical; }
.form__field input:focus,
.form__field textarea:focus { outline: 0; border-color: var(--color-red); }

.form__error {
  display: block;
  color: var(--color-red);
  font-size: 15px;
  line-height: 22px;
  margin-top: 4px;
  min-height: 0;
}

.form__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 26px;
}

.form__success {
  margin-top: 20px;
  padding: 16px 20px;
  border: 1px solid var(--color-red);
  color: var(--color-text);
  font-size: 17px;
  display: none;
}
.form__success.is-visible { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--color-red);
  color: var(--color-white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 14px 26px;
  border: 0;
  cursor: pointer;
  transition: var(--transition);
}
.btn:hover { background: var(--color-red-dark); color: var(--color-white); }

.btn--ghost {
  background: linear-gradient(#fdfdfd, #eaeaea);
  color: #444;
  border: 1px solid #c8c8c8;
  border-radius: 3px;
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  padding: 9px 18px;
}
.btn--ghost:hover { background: #e4e4e4; color: #222; }

/* ---------- CTA ---------- */
.cta {
  text-align: center;
  padding: 96px 0 56px;
}
.cta__text {
  font-family: var(--font-head);
  font-size: 21px;
  line-height: 34px;
  color: var(--color-text);
  margin: 0 auto 26px;
  max-width: 800px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-white);
  padding: 20px 0 46px;
  text-align: center;
}

.site-footer__address {
  font-family: var(--font-head);
  font-size: 19px;
  line-height: 31px;
  color: #9e9e9e;
  margin: 0 0 22px;
}
.site-footer__address a { color: #b9b9b9; }
.site-footer__address a:hover { color: var(--color-red); }

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 34px;
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
}
.footer-nav a {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #6f6f6f;
}
.footer-nav a:hover { color: var(--color-red); }

.site-footer__copy {
  font-family: var(--font-head);
  font-size: 18px;
  line-height: 30px;
  color: var(--color-red);
  margin: 0;
}
.site-footer__design {
  font-family: var(--font-head);
  font-size: 18px;
  color: #a8a8a8;
  margin: 0;
}
.site-footer__design a { color: #a8a8a8; }
.site-footer__design a:hover { color: var(--color-red); }

.agency-branding {
  text-align: center;
  padding: 20px;
}
.agency-branding p {
  font-family: var(--font-body);
  font-size: 14px;
  color: #9a9a9a;
  margin: 0;
}
.agency-branding .fa-heart { color: #e00; }
.agency-branding a { color: #9a9a9a; }
.agency-branding a:hover { color: var(--color-red); }

/* ---------- 404 ---------- */
.error-page { text-align: center; padding: 130px 0 90px; }
.error-page .headline { justify-content: center; }
.error-page__code {
  font-family: var(--font-head);
  font-size: 110px;
  line-height: 1;
  color: var(--color-red);
  margin: 0 0 10px;
}

/* ---------- Rechtstexte ---------- */
.legal h2 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 22px;
  color: var(--color-text);
  margin: 40px 0 12px;
}
.legal h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 19px;
  color: var(--color-text);
  margin: 28px 0 10px;
}
.legal p,
.legal li {
  font-size: 17px;
  line-height: 30px;
  color: #777;
}
.legal ul { padding-left: 24px; }

/* ---------- Cookie-Banner ---------- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(38, 38, 38, .97);
  color: #e8e8e8;
  padding: 20px;
  z-index: 200;
  transform: translateY(110%);
  transition: transform .4s ease;
}
.cookie-banner.is-visible { transform: translateY(0); }
.cookie-banner__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.cookie-banner p {
  margin: 0;
  font-size: 15px;
  line-height: 24px;
  max-width: 760px;
}
.cookie-banner a { color: #fff; text-decoration: underline; }
.cookie-banner__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cookie-banner .btn { font-size: 13px; padding: 11px 20px; }
.cookie-banner .btn--decline {
  background: transparent;
  border: 1px solid #7d7d7d;
  color: #ddd;
}
.cookie-banner .btn--decline:hover { background: #444; color: #fff; }

/* ---------- Scroll-Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
  .main-nav__link { padding: 10px 12px; font-size: 16px; }
  .logo__line1, .logo__line2 { font-size: 22px; }
  .logo__mark { width: 88px; height: 118px; }
  :root { --header-h: 140px; }
}

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

  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 84vw;
    height: 100%;
    background: #2b2b2b;
    padding: 84px 0 40px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .35s ease;
    z-index: 80;
  }
  .main-nav.is-open { transform: translateX(0); }

  .main-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav__link {
    color: #ededed;
    font-size: 18px;
    padding: 15px 26px;
    border-bottom: 1px solid #3c3c3c;
  }
  .main-nav__link:hover { color: var(--color-red); }

  .main-nav__caret { border-color: #bbb; }

  .main-nav__sub {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    background: #232323;
    padding: 0;
    display: none;
  }
  .main-nav__item--has-sub.is-open > .main-nav__sub { display: block; }
  .main-nav__sub a {
    color: #cfcfcf;
    padding: 13px 40px;
    border-bottom: 1px solid #333;
  }
  .main-nav__sub a:hover { background: #2c2c2c; }

  .nav-toggle { z-index: 90; position: relative; }

  body.nav-open { overflow: hidden; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 40px; }

  .ref-box { grid-template-columns: 1fr; padding: 30px; }
  .ref-box__col { padding: 0; }
  .ref-box__col:first-child { border-right: 0; border-bottom: 1px solid #d0d0d0; padding-bottom: 10px; margin-bottom: 26px; }

  .project-grid { grid-template-columns: 1fr; column-gap: 0; }

  .hero { height: 380px; }
  .hero__title { font-size: 36px; }
  .hero__subtitle { font-size: 23px; }
  .hero__caption { right: 5%; left: 5%; bottom: 12%; }

  .section--top { padding-top: 70px; }
}

@media (max-width: 767px) {
  body { font-size: 17px; line-height: 30px; }

  :root { --header-h: 110px; }

  .site-header__inner { min-height: 110px; }
  .logo { gap: 12px; }
  .logo__mark { width: 58px; height: 78px; }
  .logo__line1, .logo__line2 { font-size: 16px; }

  .headline { font-size: 27px; }
  .headline::before { width: 17px; height: 17px; }
  .subline { font-size: 18px; }
  .lead p, .text p { font-size: 18px; line-height: 31px; }

  .hero { height: 300px; }
  .hero__title { font-size: 28px; }
  .hero__subtitle { font-size: 19px; }
  .hero--home .hero__overlay {
    background: linear-gradient(to bottom left, rgba(255, 4, 8, .78) 0%, rgba(255, 4, 8, .78) 45%, rgba(255, 4, 8, 0) 45.2%);
  }

  .section { padding: 42px 0; }
  .section--top { padding-top: 52px; }
  .cta { padding: 60px 0 40px; }
  .cta__text { font-size: 19px; line-height: 31px; }

  .project__head { grid-template-columns: 1fr; }
  .project__name { border-right: 0; border-bottom: 1px solid var(--color-border); }

  .slider__viewport { height: 190px; }
  .slider__slide img { max-height: 190px; }
  .slider__btn { width: 44px; height: 56px; font-size: 22px; }
  .slider__btn--prev { left: 0; }
  .slider__btn--next { right: 0; }

  .form__row { grid-template-columns: 1fr; gap: 6px; }
  .form__label { padding-top: 0; }
  .form__field input, .form__field textarea { max-width: 100%; }
  .form__footer { justify-content: flex-start; }

  .footer-nav { justify-content: center; gap: 22px; flex-wrap: wrap; }
  .site-footer__address { font-size: 16px; line-height: 27px; }
  .site-footer__copy, .site-footer__design { font-size: 16px; }

  .error-page__code { font-size: 76px; }

  .cookie-banner__inner { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 1440px) {
  .container, .site-header__inner { max-width: 1200px; }
}


/* =========================================================
   JOOMLA-SPEZIFISCHE ERGÄNZUNGEN
   (Reset, Artikelwrapper, mod_menu-Markup, Back-to-top)
   ========================================================= */

/* ---------- Reset: kein weißer Rand rund um die Seite ---------- */
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }

#container {
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
}

/* ---------- Joomla-Artikelwrapper neutralisieren ---------- */
.item-page,
.com-content-article,
.content-item,
.blog,
.blog-featured { margin: 0; padding: 0; }

#container .page-header,
#container .article-info,
#container .icons,
#container .pagenavigation,
#container .content_rating,
#container .article-index,
#container .tags,
#container .article-can-edit { display: none; }

/* Systemmeldungen dezent in den Seitenfluss setzen */
#system-message-container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ---------- Navigation aus mod_menu ----------
   Hinweis: mod_menu gibt <ul class="mod-menu mod-list nav"> aus. Alle Regeln
   werden deshalb auf `ul.mod-menu` gescopt (Spezifitaet 0,2,1) — eine Regel
   mit nur `.main-nav .mod-menu` (0,2,0) wuerde von `.main-nav ul.nav` aus
   Fremd-CSS ueberstimmt und das mobile Menue bliebe zentriert. */
.main-nav ul.mod-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
}

.main-nav ul.mod-menu > li { position: relative; }

.main-nav ul.mod-menu a {
  display: block;
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 400;
  color: #6f6f6f;
  padding: 10px 18px;
  white-space: nowrap;
  transition: var(--transition);
}
.main-nav ul.mod-menu a:hover,
.main-nav ul.mod-menu a:focus { color: var(--color-red); }

/* Pfeil bei Punkten mit Untermenü */
/* Joomla 6 rendert neben dem Link einen eigenen Untermenue-Umschalter.
   Der macht den Menuepunkt hoeher als seine Nachbarn und schiebt ihn dadurch
   optisch nach oben. Das Untermenue oeffnet per Hover bzw. steht mobil offen. */
.main-nav ul.mod-menu .mod-menu__toggle-sub { display: none !important; }

/* Der Link wird zur Flexbox, damit das Pseudo-Element die Zeilenhoehe nicht
   vergroessert - sonst sitzt dieser eine Menuepunkt hoeher als die anderen. */
.main-nav ul.mod-menu > li.parent > a,
.main-nav ul.mod-menu > li.deeper > a {
  display: flex;
  align-items: center;
}
.main-nav ul.mod-menu > li.parent > a::after,
.main-nav ul.mod-menu > li.deeper > a::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin: -3px 0 0 9px;
  border-right: 1.5px solid #9a9a9a;
  border-bottom: 1.5px solid #9a9a9a;
  transform: rotate(45deg);
}

/* Dropdown */
.main-nav ul.mod-menu ul {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  position: absolute;
  top: 100%;
  left: 6px;
  min-width: 240px;
  background: var(--color-white);
  border: 1px solid var(--color-border-soft);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: var(--transition);
  z-index: 40;
}
.main-nav ul.mod-menu > li:hover > ul,
.main-nav ul.mod-menu > li:focus-within > ul {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.main-nav ul.mod-menu ul a {
  font-size: 16px;
  padding: 9px 20px;
  white-space: normal;
}
.main-nav ul.mod-menu ul a:hover { background: #f7f7f7; }

/* ---------- Logo als Bilddatei (images/logo-buechel.png, 443x144) ---------- */
.logo { gap: 0; }
.logo img { display: block; width: 443px; max-width: 100%; height: auto; }
@media (max-width: 1100px) { .logo img { width: 360px; } }
@media (max-width: 767px)  { .logo img { width: 230px; } }

/* Fehlermeldung des Kontaktformulars */
.form__success.is-error { border-color: #c00; background: #fff5f5; color: #8a0000; }

/* Sicherheitsnetz: der Verdunkler darf nur klickbar sein, wenn er sichtbar ist */
.nav-backdrop { pointer-events: none; }
.nav-backdrop.is-visible { pointer-events: auto; }

/* ---------- Back-to-top ---------- */
button.cd-top {
  display: block;
  height: 46px;
  width: 46px;
  position: fixed;
  bottom: 28px;
  right: 20px;
  border: 0;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  text-indent: 200%;
  white-space: nowrap;
  background: var(--color-red) url(../images/cd-top-arrow.svg) no-repeat center 50%;
  background-size: 20px 20px;
  visibility: hidden;
  opacity: 0;
  transition: opacity .3s, visibility .3s;
  z-index: 150;
}
button.cd-top.is-visible { visibility: visible; opacity: .85; }
button.cd-top:hover { opacity: 1; }

button.skip-link {
  font: inherit;
  cursor: pointer;
  border: 0;
}

/* ---------- Buttons gegen Joomla-Linkstyles absichern ---------- */
#container a.btn,
.item-page a.btn,
.site-footer a.btn,
.cta a.btn { text-decoration: none !important; color: var(--color-white); }
#container a.btn:hover,
.cta a.btn:hover { color: var(--color-white); }

/* Font-Awesome-Icons, falls der Editor <i> in <em> verwandelt */
em[class*="fa-"] { font-style: normal; }

/* ---------- Mobile ---------- */
@media (max-width: 1023px) {
  .main-nav ul.mod-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .main-nav ul.mod-menu > li { width: 100%; }
  .main-nav ul.mod-menu a {
    color: #ededed;
    font-size: 18px;
    padding: 15px 26px;
    border-bottom: 1px solid #3c3c3c;
  }
  .main-nav ul.mod-menu > li.parent > a::after,
  .main-nav ul.mod-menu > li.deeper > a::after { border-color: #bbb; margin: -3px 0 0 auto; }

  .main-nav ul.mod-menu ul {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    background: #232323;
    padding: 0;
    min-width: 0;
  }
  .main-nav ul.mod-menu ul a {
    color: #cfcfcf;
    padding: 13px 40px;
    border-bottom: 1px solid #333;
  }
  .main-nav ul.mod-menu ul a:hover { background: #2c2c2c; }

  button.cd-top { bottom: 16px; right: 14px; height: 40px; width: 40px; }
}
