/* ============================================================
   Event Timeline – v2.4.0
   ============================================================ */

/* --- CSS Custom Properties ---------------------------------- */
.ets-timeline-wrapper {
  --ets-accent: #f3c57a;
  --ets-bg: #050505;
  --ets-card: #1f1f23;
  --ets-text: #f6d39b;
  --ets-muted: #8d8d94;
  --ets-line-width: 4px;
  --ets-card-radius: 10px;
  --ets-font-title: 18px;
  --ets-font-text: 13px;
  background: var(--ets-bg);
  color: var(--ets-text);
  border-radius: 18px;
  padding: 24px 24px 20px;
  overflow: hidden;
  box-sizing: border-box;
  user-select: none;
  max-width: 100%;
  width: 100%;
}

/* --- Steuerleiste ------------------------------------------ */
.ets-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 22px;
}

.ets-btn-arrow {
  background: rgba(243, 197, 122, 0.12);
  border: 1px solid rgba(243, 197, 122, 0.3);
  color: var(--ets-text);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
}
.ets-btn-arrow:hover {
  background: rgba(243, 197, 122, 0.25);
  transform: scale(1.1);
}

.ets-btn-play {
  background: rgba(243, 197, 122, 0.15);
  border: 1px solid rgba(243, 197, 122, 0.35);
  color: var(--ets-text);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
}
.ets-btn-play:hover {
  background: rgba(243, 197, 122, 0.3);
  transform: scale(1.1);
}
.ets-btn-play .ets-icon-play { margin-left: 2px; } /* optische Mitte für Play-Icon */

/* --- Horizontale Linie ------------------------------------- */
.ets-timeline-rail {
  height: var(--ets-line-width);
  background: var(--ets-accent);
  border-radius: 999px;
  opacity: 0.9;
  margin: 0 20px;
}

/* --- Karten-Viewport --------------------------------------- */
.ets-cards-viewport {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ets-cards-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  align-items: flex-start;
  will-change: transform;
}

/* --- Einzelne Karte: Punkt sitzt direkt an der Karte ------- */
.ets-timeline-item {
  flex: 0 0 25%;   /* fallback vor JS – 4 Karten */
  min-width: 0;
  width: 25%;
  padding: 0 8px 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

/* Punkt – direkt über dem Verbinder, auf der Linie zentriert */
.ets-point-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: calc(-11px - var(--ets-line-width) / 2);
}

.ets-point {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ets-bg);
  border: 5px solid var(--ets-accent);
  box-shadow: 0 0 0 4px rgba(243, 197, 122, 0.18);
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.ets-timeline-item.ets-rail-active .ets-point,
.ets-timeline-item:hover .ets-point {
  transform: scale(1.25);
  box-shadow: 0 0 0 6px rgba(243, 197, 122, 0.3);
}

/* Verbindungsstrich Punkt → Datum → Karte */
.ets-connector {
  width: 2px;
  height: 16px;
  background: linear-gradient(to bottom, rgba(243,197,122,0.7), rgba(243,197,122,0.2));
  flex-shrink: 0;
}

/* Datum zwischen Punkt und Karte */
.ets-date-label {
  font-weight: 700;
  font-size: 14px;
  margin: 6px 0 8px;
  color: var(--ets-text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  width: 100%;
}

/* Karte */
.ets-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)), var(--ets-card);
  border-radius: var(--ets-card-radius);
  padding: 16px 16px 14px;
  border-top: 2px solid var(--ets-accent);
  min-height: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

/* Kleines Dreieck oben */
.ets-card::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 16px;
  height: 16px;
  background: var(--ets-card);
  border-left: 2px solid var(--ets-accent);
  border-top: 2px solid var(--ets-accent);
}

.ets-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(243, 197, 122, 0.14);
  color: var(--ets-text);
  border: 1px solid rgba(243, 197, 122, 0.35);
  margin-bottom: 8px;
}

.ets-title {
  margin: 0 0 6px;
  line-height: 1.25;
  font-size: var(--ets-font-title);
  color: var(--ets-text);
  text-align: center;
}

.ets-location,
.ets-subtitle,
.ets-badge,
.ets-excerpt {
  color: var(--ets-muted);
  font-size: var(--ets-font-text);
  margin-bottom: 5px;
  text-align: center;
}

.ets-badge {
  color: var(--ets-text);
  opacity: 0.8;
}

.ets-excerpt p:last-child { margin-bottom: 0; }

/* Genre ganz unten */
.ets-genre-bottom {
  margin-top: auto;
  padding-top: 8px;
  font-size: 12px;
  color: var(--ets-muted);
  border-top: 1px solid rgba(255,255,255,0.07);
  text-align: center;
  width: 100%;
}

/* --- Dots-Navigation --------------------------------------- */
.ets-dots-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.ets-dot-btn {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(243, 197, 122, 0.25);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  padding: 0;
}

.ets-dot-btn.ets-dot-active {
  background: var(--ets-accent);
  transform: scale(1.4);
}

/* --- Leer-Zustand ------------------------------------------ */
.ets-timeline-empty {
  padding: 16px;
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 8px;
  color: var(--ets-muted);
}

/* --- Responsive -------------------------------------------- */
@media (max-width: 600px) {
  .ets-timeline-wrapper { padding: 16px 12px 14px; }
  .ets-date-label { font-size: 12px; }
}

/* ============================================================
   MOBILE – Vertikale Timeline
   ============================================================ */
@media (max-width: 767px) {

  .ets-timeline-wrapper {
    padding: 20px 14px 18px;
    border-radius: 12px;
  }

  /* Controls bleiben oben, aber etwas kompakter */
  .ets-controls {
    margin-bottom: 16px;
    gap: 12px;
  }
  .ets-btn-arrow { width: 34px; height: 34px; font-size: 20px; }
  .ets-btn-play  { width: 38px; height: 38px; }

  /* Horizontale Linie + Karussell-Viewport ausblenden */
  .ets-timeline-rail  { display: none; }
  .ets-cards-viewport { overflow: visible; }
  .ets-dots-nav       { display: none !important; }

  /* Track: vertikal stapeln statt horizontal schieben */
  .ets-cards-track {
    flex-direction: column;
    transform: none !important;   /* kein horizontales Verschieben */
    transition: none;
    gap: 0;
  }

  /* Alle Items sichtbar, volle Breite */
  .ets-timeline-item {
    flex: none !important;
    min-width: 0 !important;
    width: 100% !important;
    padding: 0 0 0 0;
    /* Vertikales Layout: Linie links, Inhalt rechts */
    display: grid;
    grid-template-columns: 52px 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "dot  date"
      "line card"
      "line .   ";
    column-gap: 12px;
    margin-bottom: 8px;
    align-items: start;
  }

  /* Vertikale Linie links */
  .ets-timeline-item::before {
    content: "";
    grid-area: line;
    width: var(--ets-line-width);
    background: var(--ets-accent);
    border-radius: 999px;
    opacity: 0.7;
    justify-self: center;
    min-height: 24px;
    align-self: stretch;
  }

  /* Letztes Item: keine Linie nach unten */
  .ets-timeline-item:last-child::before {
    display: none;
  }

  /* Punkt (Uhr-Icon-Kreis) links */
  .ets-point-wrap {
    grid-area: dot;
    margin-top: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
  }

  .ets-point {
    width: 30px;
    height: 30px;
    border-width: 5px;
    background: var(--ets-bg);
    background-image: none;
  }

  /* Kurzer Verbinder ausblenden (ersetzt durch Grid) */
  .ets-connector { display: none; }

  /* Datum oben rechts neben Punkt */
  .ets-date-label {
    grid-area: date;
    text-align: left;
    font-size: 15px;
    font-weight: 700;
    margin: 10px 0 8px;
    white-space: nowrap;
  }

  /* Karte rechts, mit geschwungener linker Ecke */
  .ets-card {
    grid-area: card;
    text-align: left;
    align-items: flex-start;
    border-top: none;
    border-left: 2px solid var(--ets-accent);
    border-radius: 0 var(--ets-card-radius) var(--ets-card-radius) var(--ets-card-radius);
    margin-bottom: 16px;
    min-height: auto;
  }

  /* Dreieck-Pfeil links statt oben */
  .ets-card::before {
    top: 16px;
    left: -11px;
    transform: rotate(-45deg);
    border-left: none;
    border-top: none;
    border-right: 2px solid var(--ets-accent);
    border-bottom: 2px solid var(--ets-accent);
  }

  .ets-chip        { align-self: flex-start; }
  .ets-title       { text-align: left; }
  .ets-location,
  .ets-subtitle,
  .ets-badge,
  .ets-excerpt     { text-align: left; }
  .ets-genre-bottom { text-align: left; }
}
