/*
Theme Name: GK Bauphysik Child
Template: Divi
Version: 1.0.0
*/

/* Smooth scroll */
html { scroll-behavior: smooth; }
section, .et_pb_section, .et_pb_row, .et_pb_module { scroll-margin-top: 100px; }

/* Cursor fix */
.mein-klapp-button, .mein-klapp-button * { cursor: pointer !important; }

/* =========================
   Wheel Slider
========================= */

/* --- Konfiguration --- */
:root {
  --wheel-diameter: 800px;
  --center-x: -50px;
  --center-y: 50%;
  --radius-line-start: 420px;
  --radius-line-end: 480px;
  --radius-text: 500px;
  --tick-angle: 3.6deg;
  --item-angle: 14.4deg; /* 3.6 * 4 */
}

.wheel-slider-container {
  position: relative;
  width: 100%;
  height: 600px;
  overflow: hidden;
  background: #fff;
  font-family: Helvetica, Arial, sans-serif;
  --current-rotation: 0deg;

  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}
.wheel-slider-container.is-loaded { opacity: 1; }

.wheel-visual, .wheel-nav-wrapper, .wheel-decorations {
  position: absolute;
  top: var(--center-y);
  left: var(--center-x);
  width: 0;
  height: 0;
}

/* Ebene 1: Bild */
.wheel-visual { z-index: 10; }
.wheel-shape {
  position: absolute;
  width: var(--wheel-diameter);
  height: var(--wheel-diameter);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 10px 0 60px rgba(0,0,0,0.15);
}
.wheel-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.wheel-img.active { opacity: 1; z-index: 2; }

/* Ebene 2: Dekor */
.wheel-decorations {
  z-index: 15;
  pointer-events: none;
  transform: rotate(var(--current-rotation));
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.deco-tick {
  position: absolute;
  top: -1px; left: 0;
  height: 1px;
  background: #e0e0e0;
  transform-origin: left center;
  width: calc(var(--radius-line-end) - var(--radius-line-start));
  transform: rotate(var(--tick-rotation)) translateX(var(--radius-line-start));
}

/* Ebene 3: Menü */
.wheel-nav-wrapper { z-index: 20; }
.wheel-nav-circle {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  transform: rotate(var(--current-rotation));
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.wheel-item {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  pointer-events: auto;
  cursor: pointer;
  z-index: 5;
  transform: rotate(calc(var(--item-index) * var(--item-angle)));
}
.line-connector {
  position: absolute;
  top: -1px; left: 0;
  height: 1px;
  background: #ccc;
  transform-origin: left center;
  width: calc(var(--radius-line-end) - var(--radius-line-start));
  transform: translateX(var(--radius-line-start));
  transition: all 0.4s ease;
}
.wheel-item.active .line-connector {
  background: #000;
  height: 2px;
  top: -2px;
  width: calc(var(--radius-line-end) - var(--radius-line-start) + 40px);
}
.item-content {
  position: absolute;
  left: var(--radius-text);
  top: -20px;
  white-space: nowrap;
  transform-origin: center center;
  transform: rotate(calc(-1 * (var(--current-rotation) + (var(--item-index) * var(--item-angle)))));
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.wheel-item h3 {
  margin: 0;
  font-size: 26px;
  color: #ccc;
  transition: all 0.4s ease;
  font-weight: 400;
  line-height: 40px;
  display: inline-block;
}
.wheel-item.active h3 {
  color: #000;
  font-weight: 700;
  font-size: 32px;
  transform: translateX(30px);
}
.wheel-item:hover h3 { color: #999; }
.wheel-item.active:hover h3 { color: #000; }

/*Header Logo links oben */
.wp-image-43{
padding: 0 20px;
}

@media (max-width: 980px) {
  .wheel-slider-container { height: auto; padding: 40px 20px; overflow: visible; opacity: 1 !important; }
  .wheel-visual, .wheel-nav-wrapper, .wheel-decorations { position: relative; top: auto; left: auto; width: 100%; height: auto; }
  .wheel-visual { height: 320px; display: flex; justify-content: center; margin-bottom: 20px; }
  .wheel-shape { width: 300px; height: 300px; position: relative; top: auto; left: auto; transform: none !important; }
  .wheel-decorations { display: none; }
  .wheel-nav-circle { position: relative; transform: none !important; display: flex; flex-direction: column; align-items: center; gap: 10px; }
  .wheel-item { position: relative; transform: none !important; margin-bottom: 15px; display: block; text-align: center; }
  .line-connector { display: none; }
  .item-content { position: relative; left: auto; top: auto; transform: none !important; text-align: center; }
  .wheel-item h3 { font-size: 22px; color: #333; transform: none !important; }
  .wheel-item.active h3 { color: #000; }
}

/* =========================
   Blog Slider Fade
========================= */

.cbs-main-wrapper {
  width: 100%;
  position: relative;
  max-width: 100%;
  opacity: 1;
}

.cbs-slider-viewport {
  position: relative;
  width: 100%;
  height: 550px !important;
  min-height: 550px !important;
  overflow: hidden;
  background: #f4f4f4;
}

.cbs-slide {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0;
  visibility: hidden;
  z-index: 1;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease;
}

.cbs-slide:first-child {
  opacity: 1;
  visibility: visible;
  z-index: 10;
  transform: translateX(0);
}

.cbs-slide.active {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(0) !important;
  z-index: 10;
}

.cbs-slide.ready-right { transform: translateX(30%); opacity: 0; }
.cbs-slide.ready-left { transform: translateX(-30%); opacity: 0; }
.cbs-slide.exit-left { transform: translateX(-30%); opacity: 0; }
.cbs-slide.exit-right { transform: translateX(30%); opacity: 0; }

.cbs-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.cbs-content-card {
  position: absolute;
  bottom: 40px;
  left: 40px;
  background: rgba(255, 255, 255, 0.95);
  padding: 35px;
  width: 80%;
  max-width: 450px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  z-index: 20;
}
.cbs-meta { 
  /* Entspricht unserem Kompakt-Paragraph-Wert */
  font-size: clamp(0.8125rem, 0.8rem + 0.2vw, 0.875rem); 
  color: #555; 
  text-transform: uppercase; 
  letter-spacing: 1px; 
}
.cbs-line { width: 100%; height: 1px; background: #999; margin: 15px 0; }
.cbs-headline { 
  /* Entspricht unserer optimierten H3: Mobil ca. 17px, Desktop bis 24px */
  font-size: clamp(1.075rem, 1rem + 1vw, 1.5rem); 
  line-height: 1.2; 
  color: #222; 
  margin: 0 0 20px 0; /* Margin etwas reduziert für kompakteren Look */
  font-weight: 700;   /* Fettung erhöht, da die Schrift mobil kleiner ist */
  hyphens: auto;      /* Wichtig für lange deutsche Wörter im Slider! */
}
.cbs-link { display: inline-block; padding: 12px 25px; background: #fff; border: 1px solid #ddd; text-decoration: none; color: #333; font-weight: bold; font-size: 14px; transition: 0.3s; }
.cbs-link:hover { background: #333; color: #fff; border-color: #333; }
.cbs-arrow { margin-right: 8px; }
.cbs-nav-bar { display: flex; justify-content: flex-end; padding-top: 10px; }
.cbs-control-btn { width: 50px; height: 50px; background: #e6e6e6; border: none; margin-left: 10px; cursor: pointer; font-size: 20px; color: #333; transition: 0.3s; }
.cbs-control-btn:hover { background: #ccc; }

@media (max-width: 768px) {
  /* 1. Die fixe Höhe MUSS überschrieben werden */
  .cbs-slider-viewport { 
    height: auto !important; 
    min-height: 350px !important; /* Ein kleiner Mindestwert, damit es nicht einknickt */
    overflow: visible; /* Damit der Inhalt fließen kann */
    background: #f4f4f4; 
  }

  /* 2. Sicherstellen, dass die Slides den Platz einnehmen, den sie brauchen */
  .cbs-slide {
    position: relative; 
    display: none; /* Erstmal alle verstecken */
    flex-direction: column;
    height: auto;
  }

  /* 3. NUR die aktive Slide anzeigen, damit keine Geister-Höhen entstehen */
  .cbs-slide.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
  }

  /* 4. Das Bild im Stapel-Modus begrenzen */
  .cbs-image {
    height: 200px; /* Etwas kleiner für Mobile, damit mehr Text ins Bild passt */
    min-height: 200px;
    width: 100%;
  }

  /* 5. Den Text-Bereich kompakt halten */
  .cbs-content-card {
    position: relative;
    padding: 20px;
    background: #f4f4f4;
    width: 100%;
    max-width: 100%;
    bottom: auto;
    left: auto;
  }
}