/* ============================================================
   Geschichte — seitenspezifische Sektionen
   - Motto (grosser Leitsatz)
   - Meilensteine (vertikaler Zeitstrahl)
   - History-Chapters (alternierende Text-Bild-Bloecke)
   ============================================================ */

/* ── MOTTO ────────────────────────────────────────────────── */

.motto {
  background: var(--color-cream);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.motto::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: clamp(20rem, 50vw, 38rem);
  height: clamp(20rem, 50vw, 38rem);
  background: radial-gradient(circle, rgba(197,164,145,0.18) 0%, transparent 65%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.motto-inner {
  position: relative;
  z-index: 1;
  max-width: 56ch;
  margin: 0 auto;
}

.motto-quote-mark {
  font-family: var(--font-headline);
  font-style: italic;
  font-size: clamp(5rem, 10vw, 9rem);
  line-height: 1;
  color: var(--color-rot);
  display: block;
  margin-bottom: var(--space-md);
  opacity: 0.6;
}

.motto blockquote {
  font-family: var(--font-headline);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-anthrazit);
  margin: 0;
}
.motto blockquote em {
  font-style: italic;
  color: var(--color-rot);
}

.motto cite {
  display: block;
  margin-top: var(--space-lg);
  font-family: var(--font-modern-artisan);
  font-style: normal;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(28,44,44,0.65);
}

.motto-sub {
  margin-top: var(--space-xl);
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgba(28,44,44,0.78);
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}

/* ── MEILENSTEINE — Vertikaler Zeitstrahl ─────────────────── */

.timeline {
  background: var(--color-sand);
  --tl-bullet-size: 36px;
  --tl-line-w: 2px;
  --tl-card-bg: var(--color-bone);
  --tl-anim: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Section-Head an die Timeline-Achse ausrichten + zentrieren */
.timeline .section-head {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.timeline .section-head .eyebrow { justify-content: center; }
.timeline .section-head .eyebrow::before { display: none; }
.timeline .section-head p {
  margin-left: auto;
  margin-right: auto;
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
  --timeline-progress: 0; /* von JS gesetzt: 0..1 */
}

/* Default-Linie (gedimmt) — sitzt in der Mitte */
.timeline-list::before,
.timeline-list::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--tl-line-w);
  transform: translateX(-50%);
  pointer-events: none;
}
.timeline-list::before {
  bottom: 0;
  background: rgba(124, 4, 2, 0.18);
}
/* Progress-Linie (sattes Rot) — Hoehe per CSS-Var */
.timeline-list::after {
  height: calc(var(--timeline-progress) * 100%);
  background: linear-gradient(to bottom,
    var(--color-rot) 0%,
    var(--color-rot) 92%,
    rgba(124, 4, 2, 0.4) 100%);
  transition: height 0.05s linear;
  z-index: 1;
}

.timeline-item {
  position: relative;
  padding: var(--space-lg) 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-lg);
  align-items: center;
}

/* Year-Cluster: Bullet (rund) + Label (Jahreszahl daneben) */
.timeline-year {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4em;
  position: relative;
  z-index: 2;
}

.timeline-bullet {
  width: var(--tl-bullet-size);
  height: var(--tl-bullet-size);
  border-radius: 50%;
  background: var(--color-sand);
  border: 1.5px solid rgba(124, 4, 2, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition:
    background 0.5s var(--tl-anim),
    border-color 0.5s var(--tl-anim),
    transform 0.6s var(--tl-anim),
    box-shadow 0.5s var(--tl-anim);
}

.timeline-bullet svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-cream);
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.7);
  transition:
    opacity 0.45s var(--tl-anim) 0.15s,
    transform 0.5s var(--tl-anim) 0.15s;
}

.timeline-label {
  font-family: var(--font-headline);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  font-style: italic;
  font-weight: 500;
  color: var(--color-rot);
  letter-spacing: -0.01em;
  white-space: nowrap;
  background: var(--color-sand);
  padding: 0 0.4em;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.5s var(--tl-anim) 0.1s,
    transform 0.5s var(--tl-anim) 0.1s;
}

.timeline-card {
  grid-row: 1;
  background: var(--tl-card-bg);
  border: 1px solid rgba(28, 44, 44, 0.08);
  padding: var(--space-md) var(--space-lg);
  position: relative;
  opacity: 0;
  transition:
    opacity 0.7s var(--tl-anim) 0.08s,
    transform 0.7s var(--tl-anim) 0.08s,
    box-shadow 0.4s ease;
}

.timeline-card h3 {
  font-family: var(--font-headline);
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0 0 var(--space-xs);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.timeline-card p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(28, 44, 44, 0.78);
  margin: 0;
}

/* Linke Karte — Spalte 1, mit Pfeil nach rechts */
.timeline-item--left .timeline-card {
  grid-column: 1;
  text-align: right;
  transform: translateX(-30px);
}
.timeline-item--left .timeline-card::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -8px;
  width: 16px;
  height: 16px;
  background: var(--tl-card-bg);
  border-right: 1px solid rgba(28, 44, 44, 0.08);
  border-top: 1px solid rgba(28, 44, 44, 0.08);
  transform: translateY(-50%) rotate(45deg);
  transition: border-color 0.3s ease;
}

/* Rechte Karte — Spalte 3, mit Pfeil nach links */
.timeline-item--right .timeline-card {
  grid-column: 3;
  text-align: left;
  transform: translateX(30px);
}
.timeline-item--right .timeline-card::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -8px;
  width: 16px;
  height: 16px;
  background: var(--tl-card-bg);
  border-left: 1px solid rgba(28, 44, 44, 0.08);
  border-bottom: 1px solid rgba(28, 44, 44, 0.08);
  transform: translateY(-50%) rotate(45deg);
  transition: border-color 0.3s ease;
}

/* ── ACTIVE STATE — wird von timeline.js per IntersectionObserver gesetzt ─ */

.timeline-item.is-active .timeline-bullet {
  background: var(--color-rot);
  border-color: var(--color-rot);
  box-shadow: 0 0 0 6px rgba(124, 4, 2, 0.12);
  animation: timeline-pulse 0.6s var(--tl-anim);
}
.timeline-item.is-active .timeline-bullet svg {
  opacity: 1;
  transform: scale(1);
}
.timeline-item.is-active .timeline-label {
  opacity: 1;
  transform: translateY(0);
}
.timeline-item.is-active .timeline-card {
  opacity: 1;
  transform: translateX(0);
}

@keyframes timeline-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ── HOVER — Card-Lift + Connector-Highlight ────────────────────────────── */

@media (hover: hover) {
  .timeline-card:hover {
    transform: translateX(0) translateY(-3px);
    box-shadow: 0 18px 40px rgba(28, 44, 44, 0.12);
  }
  .timeline-item--left .timeline-card:hover::after,
  .timeline-item--right .timeline-card:hover::before {
    border-color: rgba(124, 4, 2, 0.4);
  }
}

/* ── REDUCED MOTION ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .timeline-list::after { transition: none; }
  .timeline-bullet,
  .timeline-bullet svg,
  .timeline-label,
  .timeline-card {
    transition: none !important;
    animation: none !important;
  }
  .timeline-item .timeline-card { transform: none; }
  .timeline-item.is-active .timeline-bullet { box-shadow: none; }
}

/* ── MOBILE ─────────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .timeline-list::before,
  .timeline-list::after { left: 18px; }
  .timeline-item {
    grid-template-columns: auto 1fr;
    gap: var(--space-md);
    padding: var(--space-md) 0;
  }
  .timeline-year {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    flex-direction: row;
    gap: 0.6em;
  }
  .timeline-bullet { width: 28px; height: 28px; }
  .timeline-bullet svg { width: 14px; height: 14px; }
  .timeline-label { font-size: 1rem; }
  .timeline-item--left .timeline-card,
  .timeline-item--right .timeline-card {
    grid-column: 2;
    grid-row: 1;
    text-align: left;
    transform: translateX(20px);
  }
  .timeline-item--left .timeline-card::after,
  .timeline-item--right .timeline-card::before {
    display: none;
  }
}

/* ── HISTORY-CHAPTERS — alternierende Text-Bild-Bloecke ──── */

.history-chapters {
  background: var(--color-cream);
}

.history-chapter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}
.history-chapter:last-child { margin-bottom: 0; }
.history-chapter--reverse .history-chapter-image { order: 2; }

.history-chapter-image {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  box-shadow: 0 24px 50px rgba(28,44,44,0.18);
}
.history-chapter-image img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.history-chapter-image-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-md);
  background: linear-gradient(transparent, rgba(28,44,44,0.85));
  color: var(--color-cream);
  font-family: var(--font-headline);
  font-style: italic;
  font-size: 0.95rem;
}

.history-chapter-text {
  max-width: 52ch;
}
.history-chapter-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gruen);
  margin-bottom: var(--space-sm);
}
.history-chapter-text h2 {
  font-family: var(--font-headline);
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 var(--space-md);
}
.history-chapter-text h2 em {
  font-style: italic;
  color: var(--color-rot);
}
.history-chapter-text p {
  font-size: 1.02rem;
  line-height: 1.7;
  color: rgba(28,44,44,0.82);
  margin: 0 0 var(--space-md);
}
.history-chapter-text p:last-child { margin-bottom: 0; }

@media (max-width: 880px) {
  .history-chapter { grid-template-columns: 1fr; }
  .history-chapter--reverse .history-chapter-image { order: 0; }
  .history-chapter-image { aspect-ratio: 3/2; }
}
