/* ══════════════════════════════════════════════════════════
   BERENTZEN ZEITSTRAHL — horizontales Karussell mit Peek-Vorschau
══════════════════════════════════════════════════════════ */

.timeline-carousel {
  position: relative;
  --tl-card-w: 300px;
  --tl-gap: 20px;
}
@media (max-width: 600px) {
  .timeline-carousel { --tl-card-w: 240px; }
}

.timeline-track {
  display: flex;
  gap: var(--tl-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Mobile/Tablet: Seitliches Padding = halbe Differenz zwischen Track und
     Kartenbreite, dadurch zentriert sich jede Karte beim Einrasten und
     links wie rechts schaut ein Stueck der Nachbarkarte rein. */
  padding: 4px calc(50% - var(--tl-card-w) / 2) 12px;
}
.timeline-track::-webkit-scrollbar { display: none; }

.timeline-card {
  flex: 0 0 var(--tl-card-w);
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  height: 560px;
  background: var(--white, #fff);
  border-radius: 14px;
  overflow: hidden;
  border: 0.5px solid rgba(78,88,89,0.1);
  box-shadow: 0 2px 12px rgba(78,88,89,0.06); /* bekannte Schattierung, wie .berentzen-panel */
}

/* ── Desktop: 3 volle Karten + 4. am rechten Rand angeschnitten ──
   Statt fester Pixelbreite eine prozentuale Breite (unabhaengig von der
   tatsaechlichen Content-Breite neben der Sidebar). Linksbuendig statt
   zentriert, damit der "Anschnitt" gezielt nur rechts entsteht. */
@media (min-width: 1025px) {
  .timeline-track {
    padding: 4px 0 12px;
  }
  .timeline-card {
    flex-basis: calc((100% - 2 * var(--tl-gap)) / 3.35);
    scroll-snap-align: start;
  }
}

.timeline-card-year {
  font-size: 13px; font-weight: 700; color: var(--copper, #C25E26);
  padding: 20px 20px 0;
}
.timeline-card-title {
  font-size: 18px; font-weight: 700; color: var(--dark, #4E5859);
  margin: 4px 0 0; padding: 0 20px;
  line-height: 1.25;
}
.timeline-card-text {
  font-size: 13.5px; color: rgba(78,88,89,0.7); line-height: 1.55;
  margin: 8px 0 0; padding: 0 20px 16px;
  display: -webkit-box; -webkit-line-clamp: 11; -webkit-box-orient: vertical;
  overflow: hidden;
}
.timeline-card-img {
  flex: 1 1 120px; min-height: 120px; width: 100%;
  object-fit: cover; display: block;
  /* Pro Eintrag einstellbar (Widget -> Bildanpassung / Bildausschnitt / Hintergrund),
     ueber CSS-Variablen aus dem Markup. Ohne Angabe: Mitte, kein Hintergrund. */
  object-position: var(--tl-pos, 50% 50%);
  background-color: var(--tl-img-bg, transparent);
}
/* "Einpassen": ganzes Bild sichtbar statt zugeschnitten (z.B. Logos). Der freie Rand
   zeigt die Hintergrundfarbe der Bildflaeche (Standard: durchsichtig = Kartenweiss). */
.timeline-card-img.is-contain { object-fit: contain; }

/* ── Jahres-Fortschrittsleiste ── */
.timeline-progress {
  padding: 0 4px;
  margin-top: 4px;
}
.timeline-progress-track {
  position: relative;
  height: 3px;
  background: rgba(78,88,89,0.12);
  border-radius: 2px;
  margin-bottom: 10px;
}
.timeline-progress-fill {
  position: absolute;
  top: 0; left: 0; height: 100%;
  width: 0%;
  background: var(--copper, #C25E26);
  border-radius: 2px;
  transition: width 550ms cubic-bezier(.2,.7,.2,1);
}
.timeline-progress-dots {
  display: flex;
  justify-content: space-between;
}
/* Jahreszahlen sind klickbar (echte <button>): springen direkt zum Eintrag.
   Alles gegen Elementor-Kit-Standardstile fuer Buttons abgesichert (!important) —
   das bekannte Muster im Projekt (Hover/Fokus wuerde sonst weisse Schrift/Flaeche setzen).
   padding + min-height geben eine ausreichend grosse Klickflaeche (WCAG 2.5.8). */
.timeline-progress-dot {
  -webkit-appearance: none; appearance: none;
  margin: 0; padding: 6px 2px !important; min-height: 24px;
  border-radius: 4px; cursor: pointer;
  font-family: inherit; font-size: 11px; font-weight: 700; line-height: 1.2;
  letter-spacing: 0.02em;
  transition: color 300ms ease;
}
.timeline-progress-dot,
.timeline-progress-dot:focus {
  background: none !important; border: 0 !important; box-shadow: none !important;
  color: rgba(78,88,89,0.4) !important;
}
.timeline-progress-dot:hover,
.timeline-progress-dot:focus-visible { color: var(--copper, #C25E26) !important; background: none !important; }
.timeline-progress-dot.is-active,
.timeline-progress-dot.is-active:focus { color: var(--copper, #C25E26) !important; }
.timeline-progress-dot:focus-visible { outline: 2px solid var(--cyan, #37BFF0); outline-offset: 2px; }

/* ── Steuerungsleiste unterhalb des Karussells (statt Ueberlagerung) ── */
.timeline-controls {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 4px;
}

/* ── Pfeil-Buttons (wie im Apple-Vorbild, kreisrund) ──
   !important als Sicherheitsnetz gegen Theme-Standardstile fuer Buttons
   (derselbe Konflikt, der uns schon bei Burger-Icon/Suche begegnet ist). */
.timeline-arrow {
  position: static;
  box-sizing: border-box !important;
  width: 40px !important; height: 40px !important;
  min-width: 40px !important; min-height: 40px !important;
  max-width: 40px !important; max-height: 40px !important;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 50% !important;
  background: var(--copper, #C25E26) !important;
  border: none !important;
  box-shadow: 0 2px 10px rgba(194,94,38,0.35) !important;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1 !important; color: #fff;
  cursor: pointer; z-index: 2;
  padding: 0 !important; margin: 0;
  transition: background 0.15s, opacity 0.2s;
}
.timeline-arrow:hover { background: #a84e1e !important; }
.timeline-arrow:focus-visible { outline: 3px solid var(--cyan, #37BFF0); outline-offset: 2px; }
.timeline-arrow[disabled] { opacity: 0.35; cursor: default; pointer-events: none; }

@media (max-width: 700px) {
  .timeline-controls { display: none; } /* auf Mobile reicht Touch-Wischen */
}

@media (prefers-reduced-motion: reduce) {
  .timeline-track { scroll-behavior: auto; }
  .timeline-arrow { transition: none; }
  .timeline-progress-fill { transition: none; }
}