/* =============================================================================
   EXOTRONIC – GESTALTUNG VON KOPFBEREICH, MENÜ, FUSSBEREICH UND ANIMATIONEN
   Gehört zu scripts/layout.js. Wird in jeder Seite als letzte CSS-Datei geladen.
   ========================================================================== */

:root {
  --exo-kopf-grau: #50585B;     /* Kopfbereich */
  --exo-fuss-grau: #666D70;     /* Fußbereich */
  --exo-rot: #F20E0E;           /* Akzentfarbe */
  --exo-hover: #cccccc;         /* Hintergrund Menüpunkt bei Mausberührung */
  --exo-inhaltsbreite: 1220px;  /* maximale Breite des Inhalts */
  --exo-rand: 50px;             /* Seitenrand links/rechts (große Bildschirme) */
  --exo-schrift: 'Public Sans', Verdana, sans-serif;
}
@media (max-width: 992px) { :root { --exo-rand: 32px; } }   /* Tablet */
@media (max-width: 600px) { :root { --exo-rand: 16px; } }   /* Handy  */

.exo-container {
  box-sizing: border-box;
  width: 100%;
  max-width: calc(var(--exo-inhaltsbreite) + 2 * var(--exo-rand));
  margin: 0 auto;
  padding: 0 var(--exo-rand);
}

/* ---------------------------------------------------------------------------
   KOPFBEREICH (grau, mit Slogan und Logo)
   ------------------------------------------------------------------------- */
header.exo-kopf {
  position: relative;
  z-index: 1001;
  height: 80px;
  background-color: var(--exo-kopf-grau);
  transition: height .25s ease;
}
.exo-kopf-inhalt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.exo-slogan {
  font-family: var(--exo-schrift);
  font-size: 20px;
  font-weight: bold;
  color: grey;
  white-space: nowrap;
}
.exo-logo { display: block; line-height: 0; margin-left: auto; }
.exo-logo img { display: block; height: 20px; width: auto; border: 0; }

.exo-burger {
  display: none;
  background: none;
  border: 0;
  padding: 8px 8px 8px 0;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

/* ---------------------------------------------------------------------------
   MENÜLEISTE (Desktop) – zentriert, bleibt beim Scrollen oben stehen
   ------------------------------------------------------------------------- */
nav.exo-nav {
  position: sticky;            /* bleibt beim Scrollen am oberen Rand */
  top: 0;
  z-index: 1000;               /* liegt immer über dem Seiteninhalt */
  width: 100%;
  height: 55px;
  margin: 0;
  background-color: #fff;
  opacity: 1;
  overflow: visible;
  line-height: normal;
  transition: box-shadow .25s ease;
}
nav.exo-nav.festkleben {
  position: sticky;            /* alte Klasse aus menue.css neutralisieren */
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.festkleben + article { padding-top: 0; }

.exo-nav-inhalt {
  display: flex;
  align-items: center;
  height: 100%;
}

/* Logo in der Menüleiste: erscheint rechts – an derselben Stelle wie im grauen
   Kopfbereich –, sobald die Leiste oben "klebt" */
.exo-nav-logo,
.exo-nav-ausgleich {
  flex: 0 0 140px;
}
.exo-nav-logo {
  display: flex;
  justify-content: flex-end;
  line-height: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s;
}
.exo-nav-logo img { height: 20px; width: auto; border: 0; }
nav.exo-nav.festkleben .exo-nav-logo {
  opacity: 1;
  visibility: visible;
}

.exo-menue {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: stretch;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
.exo-menue > li {
  position: relative;
  display: flex;
}
a.exo-menuepunkt,
a.exo-menuepunkt:link,
a.exo-menuepunkt:visited {
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-family: var(--exo-schrift);
  font-size: 20px;
  color: #000;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease;
}
a.exo-menuepunkt img { display: block; border: 0; }
.exo-menue > li:hover > a.exo-menuepunkt,
.exo-menue > li.offen > a.exo-menuepunkt,
a.exo-menuepunkt:focus-visible {
  background-color: var(--exo-hover);
  color: #000;
}
.exo-menue > li.aktiv > a.exo-menuepunkt { color: var(--exo-rot); }

/* Aufklapp-Menüs (Dropdowns) */
.exo-dropdown-inhalt {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1002;               /* über allen Bildern und Animationen */
  min-width: 250px;
  padding: 6px 0;
  background-color: #fff;      /* deckend – nichts scheint mehr durch */
  box-shadow: 0 4px 10px 0 rgba(0, 0, 0, .2), 0 4px 20px 0 rgba(0, 0, 0, .19);
}
.exo-dropdown-inhalt.rechts { left: auto; right: 0; min-width: 160px; }
.exo-dropdown:hover > .exo-dropdown-inhalt,
.exo-dropdown.offen > .exo-dropdown-inhalt {
  display: block;
}
.exo-dropdown-inhalt a,
.exo-dropdown-inhalt a:link,
.exo-dropdown-inhalt a:visited {
  display: block;
  padding: 3px 16px;
  font-family: var(--exo-schrift);
  font-size: 20px;
  line-height: 1.4;
  color: #000;
  text-decoration: none;
  white-space: nowrap;
}
.exo-dropdown-inhalt a.eingerueckt { padding-left: 31px; color: #868686; }
.exo-dropdown-inhalt a:hover,
.exo-dropdown-inhalt a:focus-visible { background-color: var(--exo-hover); color: #000; }

/* Kleinere Desktop-Bildschirme: Menü etwas kompakter */
@media (max-width: 1199px) {
  a.exo-menuepunkt { padding: 0 12px; font-size: 19px; }
  .exo-nav-logo { flex-basis: 125px; }
  .exo-nav-ausgleich { flex-basis: 0; }
}

/* ---------------------------------------------------------------------------
   HANDY UND TABLET (bis 992 px): Menü-Symbol statt Menüleiste,
   Kopfbereich mit Logo bleibt beim Scrollen sichtbar
   ------------------------------------------------------------------------- */
@media (max-width: 992px) {
  nav.exo-nav { display: none; }
  header.exo-kopf { position: sticky; top: 0; }
  header.exo-kopf.kompakt { height: 60px; box-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
  .exo-slogan { display: none; }
  .exo-burger { display: block; }
}

/* Ausklappbares Handy-Menü */
.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  width: 0;
  height: 100%;
  padding-top: 60px;
  overflow-x: hidden;
  background-color: #4f585b;
  font-family: var(--exo-schrift);
  transition: width .5s;
}
.sidenav a {
  display: block;
  padding: 8px 8px 8px 32px;
  font-size: 25px;
  color: #ffffff91;
  text-decoration: none;
  transition: .3s;
}
.sidenav .closebtn {
  position: absolute;
  top: 0;
  right: 25px;
  margin-left: 50px;
  font-size: 36px;
}
@media screen and (max-height: 450px) {
  .sidenav { padding-top: 15px; }
  .sidenav a { font-size: 18px; }
}
.sidenav > a,
.sidenav > a:link,
.sidenav > a:visited {
  color: #fff;
  font-weight: 100;
  cursor: pointer;
  white-space: nowrap;
}
.sidenav > a img { vertical-align: middle; border: 0; }
.exo-mobil-liste {
  margin: 0 0 6px 0;
  padding: 0;
  list-style: none;
  background-color: #4f585b;
}
.sidenav .exo-mobil-liste a,
.sidenav .exo-mobil-liste a:link,
.sidenav .exo-mobil-liste a:visited {
  padding: 3px 8px 3px 44px;
  font-size: 20px;
  color: #ffffff;
  white-space: nowrap;
}
.sidenav .exo-mobil-liste a.eingerueckt { padding-left: 60px; color: #ffffffa0; }
.sidenav .exo-mobil-liste a.exo-mobil-uebersicht { color: #ffffffa0; font-style: italic; }
.sidenav .exo-mobil-liste a:hover { color: #fff; background-color: rgba(255, 255, 255, .08); }

/* "Top"-Button */
#myBtn {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 10px;
  z-index: 999;
  padding: 15px;
  border: none;
  border-radius: 4px;
  outline: none;
  background-color: #4f585b;
  color: white;
  font-family: var(--exo-schrift);
  font-size: 18px;
  cursor: pointer;
}
#myBtn:hover { background-color: var(--exo-rot); }

/* ---------------------------------------------------------------------------
   FUSSBEREICH
   ------------------------------------------------------------------------- */
footer.exo-fuss {
  clear: both;
  padding: 10px var(--exo-rand) 50px;
  background-color: var(--exo-fuss-grau);
  font-family: var(--exo-schrift);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  color: #bcc0c2;
}
footer.exo-fuss p { margin: 0; }
.exo-fuss-copyright { margin-bottom: 22px !important; }
.exo-fuss-zeile { color: #fff; }
.exo-fuss-kontakt span + span::before { content: " | "; }
.exo-fuss-links a { margin-left: 2em; }
footer.exo-fuss a,
footer.exo-fuss a:link,
footer.exo-fuss a:visited { color: #fff; text-decoration: none; }
footer.exo-fuss a:hover { color: #fff; text-decoration: underline; }

@media (max-width: 600px) {
  footer.exo-fuss { padding-bottom: 40px; }
  .exo-fuss-zeile { color: #bcc0c2; }
  .exo-fuss-kontakt span { display: block; }
  .exo-fuss-kontakt span + span::before { content: none; }
  .exo-fuss-kontakt span:nth-child(3) { margin-top: 1.5em; }   /* Adresse etwas abgesetzt */
  .exo-fuss-links { display: block; margin-top: 1.5em; }
  .exo-fuss-links a { display: block; margin-left: 0; }
}

/* ---------------------------------------------------------------------------
   SEITENBREITE & RÄNDER
   Der Inhalt ist max. 1220 px breit. Wird das Fenster schmaler, bleibt links
   und rechts immer derselbe Rand wie beim Kopfbereich (statt bis an den
   Bildschirmrand zu laufen).
   ------------------------------------------------------------------------- */
article img[src$="1px.gif"][width="50px"] { width: var(--exo-rand); }
/* Bilder mit fester Breite nie breiter als der verfügbare Platz (sonst wird die Seite rechts abgeschnitten) */
article img:not([src$="1px.gif"]) { max-width: 100%; }

@media (min-width: 601px) {
  article td[width="1220"],
  article td[width="1220px"] {
    padding-left: clamp(0px, calc((var(--exo-inhaltsbreite) + 2 * var(--exo-rand) - 100vw) / 2), var(--exo-rand));
    padding-right: clamp(0px, calc((var(--exo-inhaltsbreite) + 2 * var(--exo-rand) - 100vw) / 2), var(--exo-rand));
  }
  /* Zeilen, die schon einen 50-px-Abstandhalter haben, brauchen keinen zusätzlichen Rand */
  article td:has(> img[src$="1px.gif"][width="50px"]) + td[width="1220"],
  article td:has(> img[src$="1px.gif"][width="50px"]) + td[width="1220px"] {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ---------------------------------------------------------------------------
   DEZENTE SCROLL-ANIMATIONEN FÜR BILDER
   ------------------------------------------------------------------------- */
img.exo-einblenden {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2, .65, .3, 1);
}
img.exo-einblenden.exo-sichtbar {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  img.exo-einblenden { opacity: 1; transform: none; transition: none; }
  header.exo-kopf, .exo-nav-logo { transition: none; }
}

/* ---------------------------------------------------------------------------
   STARTSEITE: BUS-ANIMATION
   Der Text fliegt herein, der Bus steht im Bild, danach werden die
   Produkte rund um den Bus nacheinander eingeblendet. Alle Ebenen nutzen dasselbe Bild
   (bilder/exotronic_bus.jpg) und werden per clip-path ausgeschnitten.
   Ohne JavaScript oder bei "Bewegung reduzieren" wird einfach das Bild gezeigt.
   ------------------------------------------------------------------------- */
.exo-bus-szene {
  position: relative;
  display: block;
  overflow: hidden;
  line-height: 0;
}
.exo-bus-szene img.exo-bus-basis { display: block; width: 100%; height: auto; }
.exo-bus-ebene {
  display: none;
  position: absolute;
  inset: 0;
  background-image: url("../bilder/exotronic_bus.jpg");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  will-change: transform, opacity;
}
.exo-bus-fahrzeug { clip-path: polygon(11.10% 21.96%, 12.40% 17.42%, 25.25% 12.30%, 27.25% 12.08%, 39.00% 14.71%, 41.75% 14.28%, 54.25% 14.93%, 59.85% 17.57%, 62.25% 21.82%, 83.25% 30.60%, 87.10% 33.82%, 87.30% 46.85%, 89.10% 47.73%, 89.10% 48.90%, 87.30% 50.51%, 87.20% 73.21%, 85.00% 76.50%, 70.00% 78.18%, 57.50% 76.13%, 49.50% 72.84%, 26.00% 58.93%, 22.00% 56.00%, 15.00% 51.61%, 12.90% 47.58%, 11.50% 41.00%, 11.10% 28.92%); }
.exo-bus-oben     { clip-path: polygon(0% 0%, 100% 0%, 100% 33.82%, 87.10% 33.82%, 83.25% 30.60%, 62.25% 21.82%, 59.85% 17.57%, 54.25% 14.93%, 41.75% 14.28%, 39.00% 14.71%, 27.25% 12.08%, 25.25% 12.30%, 12.40% 17.42%, 11.10% 21.96%, 0% 21.96%); }
.exo-bus-links    { clip-path: polygon(0% 21.96%, 11.10% 21.96%, 11.10% 28.92%, 11.50% 41.00%, 12.90% 47.58%, 15.00% 51.61%, 22.00% 56.00%, 26.00% 58.93%, 38.00% 66.03%, 38.00% 100%, 0% 100%); }
.exo-bus-unten    { clip-path: polygon(100% 33.82%, 100% 100%, 38.00% 100%, 38.00% 66.03%, 49.50% 72.84%, 57.50% 76.13%, 70.00% 78.18%, 85.00% 76.50%, 87.20% 73.21%, 87.30% 50.51%, 89.10% 48.90%, 89.10% 47.73%, 87.30% 46.85%, 87.10% 33.82%); }

/* Ausgangslage (wird per JavaScript aktiviert) */
.exo-bus-szene.bereit img.exo-bus-basis { opacity: 0; }
.exo-bus-szene.bereit .exo-bus-ebene { display: block; }
.exo-bus-szene.bereit .exo-bus-oben  { opacity: 0; transform: translateY(4%); }
.exo-bus-szene.bereit .exo-bus-links { opacity: 0; transform: translateX(3%); }
.exo-bus-szene.bereit .exo-bus-unten { opacity: 0; transform: translateY(-4%); }

/* Ablauf */
.exo-bus-szene.los .exo-bus-oben,
.exo-bus-szene.los .exo-bus-links,
.exo-bus-szene.los .exo-bus-unten {
  opacity: 1;
  transform: none;
  transition: opacity .8s ease, transform .9s cubic-bezier(.2, .7, .3, 1);
}
.exo-bus-szene.los .exo-bus-oben  { transition-delay: .3s; }
.exo-bus-szene.los .exo-bus-links { transition-delay: .55s; }
.exo-bus-szene.los .exo-bus-unten { transition-delay: .8s; }

/* Ende: Originalbild wieder anzeigen (pixelgenau, ohne Schnittkanten) */
.exo-bus-szene.fertig img.exo-bus-basis { opacity: 1; }
.exo-bus-szene.fertig .exo-bus-ebene { display: none; }

/* Überschrift fliegt herein, Text wird eingeblendet */
.exo-reinfliegen.bereit { opacity: 0; transform: translateX(-80px); }
.exo-reinfliegen.bereit.los {
  opacity: 1;
  transform: none;
  transition: opacity .9s ease, transform 1.1s cubic-bezier(.16, .84, .3, 1);
}
.exo-text-einblenden.bereit { opacity: 0; transform: translateY(16px); }
.exo-text-einblenden.bereit.los {
  opacity: 1;
  transform: none;
  transition: opacity .9s ease .3s, transform .9s ease .3s;
}

@media (prefers-reduced-motion: reduce) {
  .exo-bus-szene.bereit img.exo-bus-basis { opacity: 1; }
  .exo-bus-szene.bereit .exo-bus-ebene { display: none; }
  .exo-reinfliegen.bereit, .exo-text-einblenden.bereit { opacity: 1; transform: none; }
}
