/* Bas */
* { box-sizing: border-box; }
body {
  line-height: 1.5;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Sektion */
.timeline-section {
  max-width: 960px;
  padding: 2rem 1rem 4rem;
  margin: 0 auto;
}

.timeline-section h1 {
  font-size: 1.875rem;
  margin: 0 0 2rem 0;
  letter-spacing: 0.2px;
}

/* Själva tidslinan */
.timeline {
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Vertikal linje i mitten */
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--burgundy);
  transform: translateX(-1px);
}

/* Varje punkt */
.timeline-item {
  position: relative;
  width: 100%;
  padding: 1rem 0;
}

/* Punktens nod (rund cirkel på linan) */
.timeline-item::before {
  content: "";
  position: absolute;
  top: 1.25rem;
  left: 50%;
  transform: translate(-50%, 0);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--burgundy);
  box-shadow: 0 0 0 4px rgba(105, 27, 25, 0.12);
}

/* Kortet som innehåller texten */
.timeline-card {
  position: relative;
  width: calc(50% - 2rem);
  background: var(--sage);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 1rem 1.25rem 1.25rem;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.06),
    0 1px 3px rgba(16, 24, 40, 0.10);
  color: var(--ivory);

  hyphens: auto;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Alternating layout: udda vänster, jämn höger */
.timeline-item:nth-child(odd) .timeline-card {
  margin-right: auto;
  transform: translateX(-1rem);
}

.timeline-item:nth-child(even) .timeline-card {
  margin-left: auto;
  transform: translateX(1rem);
}

/* Liten pil/triangel mot linan */
.timeline-item:nth-child(odd) .timeline-card::after,
.timeline-item:nth-child(even) .timeline-card::after {
  content: "";
  position: absolute;
  top: 1.25rem;
  width: 0;
  height: 0;
  border: 8px solid transparent;
}

.timeline-item:nth-child(odd) .timeline-card::after {
  right: -16px;
  border-left-color: var(--sage);
}

.timeline-item:nth-child(even) .timeline-card::after {
  left: -16px;
  border-right-color: var(--sage);
}

/* Innehåll i kortet */
.timeline-time {
  display: inline-block;
  font-weight: 600;
  color: var(--eggshell);
  padding: 0.25rem 0;
  border-radius: 999px;
  letter-spacing: 0.2px;
}

.timeline-title {
  margin: 0.5rem 0 0.25rem 0;
  font-size: 1.125rem;
}

.timeline-text {
  margin: 0;
  color: var(-ivory);
}

/* Fokus/hover för tangentbord/mus */
.timeline-card:focus {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}
.timeline-card:hover {
  border-color: #d9dfea;
}

/* Responsiv: mobil = enkel kolumn */
@media (max-width: 720px) {
  .timeline::before {
    left: 10px;
    transform: none;
  }

  .timeline-item::before {
    left: 2px;
    transform: none;
  }

  .timeline-card,
  .timeline-item:nth-child(even) .timeline-card,
  .timeline-item:nth-child(odd) .timeline-card {
    width: auto;
    margin: 0 0 0 2.25rem;
    transform: none;
  }

  .timeline-item:nth-child(odd) .timeline-card::after,
  .timeline-item:nth-child(even) .timeline-card::after {
    left: -15px;
    right: auto;
    border-right-color: var(--sage);
    border-left-color: transparent;
  }
}