/* Winddiesel – user.css (Joomla 4/5, Cassiopeia)
   Nachbau des alten Joomla-3-Designs anhand der Screenshots.
   Positionen: Logo/Titel -> container-header, Menü -> mainmenu (container-header),
   Banner -> banner, Intro -> Artikel, 3 Teaser -> bottom-a, Footer -> footer */

@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap");

:root {
  --wd-red: #e30613;
  --wd-text: #444;
  --wd-grey-header: #ececec;
  --wd-nav-active: #bdbdbd;
  --wd-footer: #404040;
  --wd-width: 1250px;

  --cassiopeia-color-primary: var(--wd-red);
  --cassiopeia-color-link: var(--wd-red);
  --cassiopeia-color-hover: #a30410;
  --cassiopeia-font-family-body: "Roboto", Arial, sans-serif;
  --cassiopeia-font-family-headings: "Roboto", Arial, sans-serif;
  --template-bg-light: #fff;
}

html { scroll-behavior: smooth; }
body.site {
  font-family: "Roboto", Arial, sans-serif;
  font-weight: 400;
  color: var(--wd-text);
  background: #fff;
}

/* Alles auf 1250px Breite zentrieren */
.site-grid,
.footer .grid-child {
  max-width: var(--wd-width);
  margin-inline: auto;
}
.site-grid {
  grid-template-columns: [full-start] minmax(0, 1fr) [main-start] minmax(0, var(--wd-width)) [main-end] minmax(0, 1fr) [full-end];
  column-gap: 0;   /* Cassiopeia-Spaltenabstand (16px) entfernen: sonst ist der Inhalt 80px schmaler als das Menü */
}
/* Auf schmalen Fenstern etwas Innenabstand, in Flucht mit dem Menütext */
@media (max-width: 1250px) {
  .container-component { padding-inline: .9rem; }
}

/* ---------- Header ---------- */
:root { --wd-logo-h: 128px; --wd-head-h: calc(var(--wd-logo-h) + 10px); }

/* Grauer Streifen über die komplette Fensterbreite (auf dem Header selbst,
   nicht auf dem begrenzten grid-child) – Höhe = Logo + 10px */
header.container-header {
  display: block;
  padding: 0;
  border: 0;
  border-top: 2px solid #777;
  background: linear-gradient(to bottom, var(--wd-grey-header) 0, var(--wd-grey-header) var(--wd-head-h), #fff var(--wd-head-h)) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}

/* Zeile 1: Logo + Slogan nur auf Mainbreite */
header.container-header > .grid-child:not(.container-nav) {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: none;
}
header.container-header .navbar-brand {
  display: flex;
  align-items: center;          /* Slogan vertikal zentriert */
  gap: 2.5rem;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--wd-width);
  height: var(--wd-head-h);
  margin: 0 auto;
  padding: 0 0 10px;            /* 10px unter dem Logo */
  background: none;
}
header.container-header .brand-logo {
  display: block;
  flex: 0 0 auto;               /* nicht stauchen -> Logo bleibt unverzerrt */
  margin: 0;
  padding: 0;
}
header.container-header .brand-logo img {
  display: block;
  flex: none;
  width: auto !important;
  height: var(--wd-logo-h) !important;
  max-width: none !important;
  aspect-ratio: auto;
  object-fit: contain;
}
header.container-header .site-description {
  position: static;
  margin: 0;
  color: var(--wd-text);
  font-weight: 300;
  font-size: 1.8rem;
  line-height: 1.2;
}

/* ---------- Hauptmenü (Zeile 2) ---------- */
header.container-header .container-nav {
  display: block;
  width: 100%;
  max-width: var(--wd-width);
  margin: 0 auto;
  padding: 0;
  background: none;
}
header.container-header .container-nav nav { margin: 0; padding: 0; width: 100%; }
header.container-header .container-nav .mod-menu {
  display: flex;
  flex-wrap: nowrap;            /* alle Links in einer Zeile */
  justify-content: space-between; /* Menü füllt die ganze Breite (bündig mit Inhalt und Footer) */
  gap: 0 !important;
  margin: 0;
  padding: 0;
  list-style: none;
}
header.container-header .container-nav .mod-menu > li {
  position: relative;           /* Anker für das Untermenü */
  display: block;
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap;
}
/* Cassiopeia-Zierelemente zwischen den Punkten entfernen */
header.container-header .container-nav .mod-menu > li::after,
header.container-header .container-nav .mod-menu > li::before,
header.container-header .container-nav .mod-menu > li > a::after,
header.container-header .container-nav .mod-menu > li > a::before { display: none !important; content: none !important; }

header.container-header .container-nav .mod-menu > li > a,
header.container-header .container-nav .mod-menu > li > span {
  display: block;
  margin: 0;
  padding: .85rem .9rem;        /* Abstand nur innen */
  color: var(--wd-text);
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1.3;
  text-transform: uppercase;
  border-radius: 4px;
  white-space: nowrap;
  transition: background .2s, color .2s;
}
header.container-header .container-nav .mod-menu > li > a:hover,
header.container-header .container-nav .mod-menu > li > a:focus { background: #eee; color: var(--wd-text); }

/* Aktiv: nur die aktuelle Seite (bzw. der Elternpunkt einer aktuellen Unterseite).
   "Einführung" ist Standardseite (.default) und trägt auf allen Seiten .active -> ausnehmen. */
header.container-header .container-nav .mod-menu > li.current > a,
header.container-header .container-nav .mod-menu > li.active:not(.default) > a {
  background: var(--wd-nav-active);
  color: #fff;
}

/* Pfeil-Button: am Desktop ausblenden (Untermenü öffnet per Hover/Fokus) */
header.container-header .container-nav .mod-menu__toggle-sub { display: none; }

/* ---------- Untermenü (2. Ebene) ---------- */
header.container-header .container-nav .mod-menu__sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  min-width: 100%;
  margin: 0;
  padding: .3rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid #ddd;
  border-top: 0;
  box-shadow: 0 6px 12px rgba(0, 0, 0, .15);
}
header.container-header .container-nav .mod-menu > li:hover > .mod-menu__sub,
header.container-header .container-nav .mod-menu > li:focus-within > .mod-menu__sub,
header.container-header .container-nav .mod-menu__toggle-sub[aria-expanded="true"] + .mod-menu__sub { display: block; }
header.container-header .container-nav .mod-menu__sub li { display: block; margin: 0; padding: 0; }
header.container-header .container-nav .mod-menu__sub li a {
  display: block;
  padding: .7rem 1.1rem;
  color: var(--wd-text);
  font-size: 1.2rem;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
}
header.container-header .container-nav .mod-menu__sub li a:hover,
header.container-header .container-nav .mod-menu__sub li.current > a { background: #eee; color: var(--wd-text); }

/* ---------- Header-Bild (unter dem Hauptmenü, volle Fensterbreite) ---------- */
/* Bild: images/headers/header.jpg
   Das Bild liegt bewusst NICHT im Header: Der Header ist im Template als
   "fixiert" (sticky) eingestellt und nimmt alles Innere mit. Darum wird das
   Bild als eigenes Element direkt nach dem Header eingefügt (body::before).
   Dafür wird der body zur Spalte (flex) und die Reihenfolge festgelegt:
   Header (-2) -> Bild (-1) -> restliche Seite (0). */
body.site {
  display: flex;
  flex-direction: column;
  overflow-x: clip;             /* verhindert seitliches Scrollen, ohne sticky zu stören */
}
body.site > header.container-header { order: -2; }
body.site::before {
  content: "";
  order: -1;
  flex: 0 0 auto;
  display: block;
  width: 100%;
  height: clamp(200px, 30vw, 520px);
  margin-top: 6px;
  background: #cfd8e3 url("/images/headers/header.jpg") center 55% / cover no-repeat;
}

/* ---------- Banner / Hauptbild ---------- */
.container-banner { padding: 0; margin: 6px auto 0; }
.container-banner img { display: block; width: 100%; height: auto; }

/* ---------- Inhalt ---------- */
.container-component { padding-top: 1.5rem; }
h1, h2, h3, .page-header h1, .page-header h2 {
  font-weight: 300;
  text-transform: uppercase;
  color: var(--wd-text);
  font-size: 2rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--wd-red);
  margin: 1.5rem 0 1.4rem;
}
.com-content-article__body,
.com-content-article__body p,
.item-page p { color: #333; margin: 0 0 1rem; font-size: 1rem; }
.com-content-article__body a { text-decoration: underline; }

/* ---------- 3 Teaser (Position bottom-a) ---------- */
.container-bottom-a { padding: 3.5rem 0 2.5rem; }
.container-bottom-a .grid-child { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.3rem; }
.container-bottom-a .card { border: 0; background: transparent; text-align: center; }
.container-bottom-a .card-header,
.container-bottom-a h3 { font-size: 1.3rem; text-align: center; margin: 1.6rem 0 1.4rem; background: none; }
.container-bottom-a img { width: 100%; height: auto; display: block; border-radius: 3px; }
/* Überschrift als Link: wie normale Überschrift, nur bei Hover rot */
.container-bottom-a h3 a { color: inherit; text-decoration: none; }
.container-bottom-a h3 a:hover,
.container-bottom-a h3 a:focus { color: var(--wd-red); }
/* Ganze Kachel-Zeile gleich hoch, Bild-Seitenverhältnis einheitlich */
.container-bottom-a .card > img,
.container-bottom-a .card a > img { aspect-ratio: 4 / 3; object-fit: cover; }
.container-bottom-a p { color: #333; font-size: .95rem; line-height: 1.45; margin: 0; }

/* ---------- Footer ---------- */
.footer {
  background: var(--wd-footer);
  color: #fff;
  border: 0;
  padding: 3.5rem 0 4rem;
  margin-top: 1rem;
}
.footer .grid-child { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; padding: 0; }
.footer a, .footer p { color: #fff; }
/* Alle Footer-Links ohne Unterstreichung (auch bei Hover/Fokus) */
.footer a,
.footer a:hover,
.footer a:focus,
.footer a:active { text-decoration: none; }
.footer p { margin: 0; line-height: 1.55; }
.footer .mod-menu { text-align: right; align-items: flex-end; list-style: none; padding: 0; margin: 0; }
.footer .mod-menu a { font-size: .8rem; text-transform: uppercase; line-height: 1.85; text-decoration: none; }
.footer .mod-menu a:hover { color: var(--wd-red); }
.footer img { max-height: 40px; width: auto; }

/* Nach-oben-Button */
.back-to-top-link {
  background: var(--wd-red);
  color: #fff;
  border-radius: 3px;
  width: 60px;
  height: 60px;
  right: 40px;
  bottom: 30px;
  /* Pfeil mittig im Quadrat (für block- und flex-Darstellung) */
  box-sizing: border-box;
  padding: 0;
  text-align: center;
  line-height: 60px;
  align-items: center;
  justify-content: center;
}
.back-to-top-link [class^="icon-"],
.back-to-top-link [class*=" icon-"] {
  display: inline-block;
  margin: 0;
  width: auto;
  line-height: 1;
  vertical-align: middle;
  font-size: 1.4rem;
}
.back-to-top-link:hover { background: #a30410; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  :root { --wd-logo-h: 90px; }
  header.container-header .navbar-brand { gap: 1rem; padding: 0 10px 10px; }
  header.container-header .site-description { font-size: 1.1rem; }
  header.container-header .container-nav .mod-menu { flex-wrap: wrap; justify-content: flex-start; }
  header.container-header .container-nav .mod-menu > li > a { font-size: 1.1rem; padding: .6rem .8rem; }
  header.container-header .container-nav .mod-menu__toggle-sub { display: inline-flex; }
  header.container-header .container-nav .mod-menu__sub { position: static; box-shadow: none; border: 0; }
  .container-bottom-a .grid-child { grid-template-columns: 1fr; }
  .footer .grid-child { flex-direction: column; }
  .footer .mod-menu { text-align: left; align-items: flex-start; }
}
