/* =============================================
   History Timeline – timeline.css
   Farbton: rgb(34, 115, 186)
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;600;700&family=Playfair+Display:wght@600&display=swap');

:root {
  --ht-blue:        rgb(34, 115, 186);
  --ht-blue-light:  rgba(34, 115, 186, 0.12);
  --ht-blue-mid:    rgba(34, 115, 186, 0.35);
  --ht-blue-dark:   rgb(22, 82, 138);
  --ht-text:        #1a2332;
  --ht-text-muted:  #6b7c93;
  --ht-border:      #dde4ed;
  --ht-bg:          #f7f9fc;
  --ht-white:       #ffffff;
  --ht-radius:      10px;
  --ht-shadow:      0 4px 24px rgba(34, 115, 186, 0.10);
  --ht-shadow-lg:   0 8px 40px rgba(34, 115, 186, 0.16);
  --ht-transition:  0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --ht-font-body:   'Source Sans 3', sans-serif;
  --ht-font-head:   'Playfair Display', serif;
}

/* ── Wrapper ── */
.ht-wrapper {
  font-family: var(--ht-font-body);
  color: var(--ht-text);
  padding: 40px 20px 48px;
  max-width: 960px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ── Empty state ── */
.ht-empty {
  text-align: center;
  color: var(--ht-text-muted);
  font-style: italic;
  padding: 40px 0;
}

/* =============================================
   ZEITSTRAHL
   ============================================= */

/* Outer: clips and scrolls horizontally */
.ht-rail-outer {
  overflow-x: auto;
  padding-bottom: 6px;        /* room for scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--ht-blue-mid) transparent;
}
.ht-rail-outer::-webkit-scrollbar       { height: 4px; }
.ht-rail-outer::-webkit-scrollbar-track { background: transparent; }
.ht-rail-outer::-webkit-scrollbar-thumb { background: var(--ht-blue-mid); border-radius: 2px; }

/* Inner: grows with dots – line AND dots scroll together */
.ht-rail-inner {
  position: relative;
  min-width: 480px;
  padding: 20px 0 24px;       /* vertical breathing room */
}

/* .ht-rail-line is kept in HTML but hidden –
   the line is drawn via ::before on .ht-rail-dots instead,
   so it is guaranteed to be inside the same stacking context. */
.ht-rail-line { display: none; }

/* ── Dots row ── */
.ht-rail-dots {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;   /* anchor for ::before */
}

/* The horizontal line: ::before sits exactly at the
   vertical centre of the 16 px dot circles (top: 8px).
   z-index: 0 keeps it behind the dots (z-index: 1). */
.ht-rail-dots::before {
  content: '';
  position: absolute;
  top: 8px;                   /* half of dot height (16px) */
  transform: translateY(-50%);
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ht-blue);
  pointer-events: none;
  z-index: 0;
}

/* Each year button */
.ht-dot-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  flex: 1;
  position: relative;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.ht-dot {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ht-white);
  border: 2.5px solid var(--ht-blue);
  transition: background var(--ht-transition), transform var(--ht-transition), box-shadow var(--ht-transition);
  position: relative;
  z-index: 1;
}

.ht-dot-year {
  font-family: var(--ht-font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--ht-blue);
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: color var(--ht-transition);
  line-height: 1;
  margin-top: 2px;
}

/* Hover */
.ht-dot-btn:hover .ht-dot {
  background: var(--ht-blue-light);
  transform: scale(1.2);
  box-shadow: 0 0 0 4px var(--ht-blue-light);
}
.ht-dot-btn:hover .ht-dot-year {
  color: var(--ht-blue-dark);
}

/* Active / selected */
.ht-dot-btn.ht-dot-active .ht-dot {
  background: var(--ht-blue);
  transform: scale(1.25);
  box-shadow: 0 0 0 5px var(--ht-blue-light);
}
.ht-dot-btn.ht-dot-active .ht-dot-year {
  color: var(--ht-blue-dark);
  font-weight: 700;
}

/* Focus ring */
.ht-dot-btn:focus-visible .ht-dot {
  box-shadow: 0 0 0 3px var(--ht-white), 0 0 0 5px var(--ht-blue);
}

/* =============================================
   NAV ROW
   ============================================= */
.ht-nav-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 4px;
}

/* ── Jump buttons ── */
.ht-jump-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ht-blue);
  padding: 8px 4px;
  min-width: 52px;
  flex-shrink: 0;
  outline: none;
  transition: color var(--ht-transition), transform var(--ht-transition);
}
.ht-jump-btn svg {
  width: 30px;
  height: 30px;
  display: block;
}
.ht-jump-btn span {
  font-size: 11px;
  font-weight: 600;
  color: var(--ht-blue);
  white-space: nowrap;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.8;
}
.ht-jump-btn:hover {
  color: var(--ht-blue-dark);
  transform: scale(1.08);
}
.ht-jump-btn:hover span {
  opacity: 1;
}
.ht-jump-btn:focus-visible {
  outline: 2px solid var(--ht-blue);
  outline-offset: 3px;
  border-radius: 4px;
}
.ht-jump-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

/* ── Ereignis-Kasten ── */
.ht-event-box {
  flex: 1;
  border: 1.5px solid var(--ht-border);
  border-radius: var(--ht-radius);
  background: var(--ht-white);
  box-shadow: var(--ht-shadow);
  overflow: hidden;
  min-width: 0;
  transition: box-shadow var(--ht-transition);
}
.ht-event-box:hover {
  box-shadow: var(--ht-shadow-lg);
}

/* Inner navigation bar (prev / year / next) */
.ht-event-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1.5px solid var(--ht-border);
  background: var(--ht-bg);
}

.ht-prev-btn,
.ht-next-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ht-blue);
  padding: 4px;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  outline: none;
  transition: background var(--ht-transition), color var(--ht-transition), transform var(--ht-transition);
  flex-shrink: 0;
}
.ht-prev-btn svg,
.ht-next-btn svg {
  width: 20px;
  height: 20px;
}
.ht-prev-btn:hover,
.ht-next-btn:hover {
  background: var(--ht-blue-light);
  color: var(--ht-blue-dark);
  transform: scale(1.1);
}
.ht-prev-btn:focus-visible,
.ht-next-btn:focus-visible {
  outline: 2px solid var(--ht-blue);
  outline-offset: 2px;
}
.ht-prev-btn:disabled,
.ht-next-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  transform: none;
}

.ht-event-year-label {
  
  font-size: 20px;
  color: var(--ht-blue);
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: opacity var(--ht-transition);
  user-select: none;
}

/* Content area */
.ht-event-content {
  position: relative;
  overflow: hidden;
}

.ht-event-slide {
  display: none;
  padding: 22px 24px 20px;
  animation: htFadeIn 0.32s ease forwards;
}
.ht-event-slide.ht-slide-active {
  display: block;
}

@keyframes htFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ht-event-text {
  margin: 0 0 16px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ht-text);
  font-weight: 400;
}
.ht-event-text:last-child {
  margin-bottom: 0;
}

/* Optional image */
.ht-event-image {
  margin-top: 4px;
  border-top: 1px solid var(--ht-border);
  padding-top: 16px;
}
.ht-event-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--ht-radius) - 2px);
  object-fit: cover;
  max-height: 340px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 640px) {
  .ht-wrapper {
    padding: 28px 12px 36px;
  }

  .ht-jump-btn span {
    display: none;
  }
  .ht-jump-btn {
    min-width: 36px;
  }
  .ht-jump-btn svg {
    width: 24px;
    height: 24px;
  }

  .ht-nav-row {
    gap: 8px;
  }

  .ht-event-year-label {
    font-size: 17px;
  }

  .ht-event-slide {
    padding: 16px;
  }

  .ht-event-text {
    font-size: 14.5px;
  }

  .ht-dot-year {
    font-size: 11px;
  }
}

@media (max-width: 400px) {
  .ht-nav-row {
    gap: 4px;
  }
  .ht-jump-btn {
    min-width: 28px;
    padding: 6px 0;
  }
}
