/* ── Dagens tidslinje ───────────────────────────────────────────────────── */

/*
  A compact, grouped timeline in the style of a printed wedding programme:
  several moments share one row, a small line drawing sits opposite the
  times, and a single strong stem runs through the filled beads.
*/
.timeline {
  --row-h: 180px;
  --art-size: 170px;
  position: relative;
  width: 100%;
  max-width: 880px;
  margin: clamp(22px, 3vw, 34px) auto 0;
  padding: 0;
  list-style: none;
}

/* The stem runs from the first bead to the last. */
.timeline::before {
  content: "";
  position: absolute;
  top: calc(var(--row-h) / 2);
  bottom: calc(var(--row-h) / 2);
  left: 50%;
  z-index: 0;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: rgba(201, 133, 156, .62);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(48px, 5vw, 64px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(8px, 1.2vw, 16px);
  height: var(--row-h);
  margin: 0;
}

/* Filled bead on the stem. */
.timeline-item::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: var(--rose-d);
  box-shadow: 0 0 0 4px var(--paper);
}

.timeline-card {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  width: auto;
  max-width: 370px;
}
.timeline-item:nth-child(even) .timeline-card {
  grid-column: 3;
  justify-self: start;
}

.timeline-kicker {
  margin: 0 0 .3em;
  color: var(--rose-d);
  font-size: var(--fs-label);
  font-weight: 400;
  letter-spacing: .22em;
  line-height: 1.2;
  text-transform: uppercase;
}

.timeline-card h3 {
  margin: 0 0 .55em;
  font-size: clamp(1.08rem, .55vw + .92rem, 1.32rem);
  font-weight: 400;
  line-height: 1.15;
}

.timeline-events {
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline-events li {
  display: flex;
  align-items: baseline;
  gap: .7em;
  margin: 0 0 .2em;
}
.timeline-events li:last-child { margin-bottom: 0; }

.timeline-events time {
  flex: 0 0 3.35em;
  color: var(--rose-d);
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  line-height: 1.4;
}

.timeline-events span {
  color: var(--ink-soft);
  font-size: var(--fs-small);
  line-height: 1.4;
}

.timeline-card p.timeline-en {
  margin: .55em 0 0;
  color: rgba(95, 90, 83, .85);
  font-size: var(--fs-small);
  font-style: italic;
  line-height: 1.4;
}

/* Line drawings sit directly on the paper, without frames. */
.timeline-art {
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
  width: var(--art-size);
  height: var(--art-size);
  margin: 0;
  overflow: visible;
}
.timeline-item:nth-child(even) .timeline-art {
  grid-column: 1;
  justify-self: end;
}

.timeline-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: .92;
}

.timeline-note {
  margin: clamp(18px, 2.5vw, 26px) auto 0;
  max-width: 880px;
  padding: 11px 15px;
  border-left: 2px solid rgba(157, 176, 138, .8);
  border-radius: 0 10px 10px 0;
  background: rgba(243, 246, 236, .48);
  color: var(--ink-soft);
  font-size: var(--fs-small);
  font-style: italic;
  line-height: 1.45;
}
.timeline-note p { margin: 0; }
.timeline-note p + p { margin-top: .25em; }
.timeline-note a { color: var(--rose-d); }
.timeline-note a:hover,
.timeline-note a:focus-visible { color: var(--ink); }

/* Keep the timetable section itself tight enough to take in at a glance. */
#dagen {
  padding-top: clamp(44px, 5vw, 68px);
  padding-bottom: clamp(44px, 5vw, 68px);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 820px) {
  .timeline {
    --art-size: 100px;
    max-width: none;
    margin-top: 24px;
  }

  /* The stem moves to the left; text stays left and art stays right. */
  .timeline::before {
    top: 20px;
    bottom: 20px;
    left: 14px;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    grid-template-columns: minmax(0, 1fr) var(--art-size);
    gap: 12px;
    height: auto;
    min-height: 0;
    padding: 15px 0 15px 38px;
  }
  .timeline-item::before {
    top: 29px;
    left: 14px;
    margin: -5.5px 0 0 -5.5px;
    box-shadow: 0 0 0 3px var(--paper);
  }

  .timeline-card,
  .timeline-item:nth-child(even) .timeline-card {
    grid-column: 1;
    justify-self: stretch;
    max-width: none;
  }

  .timeline-art,
  .timeline-item:nth-child(even) .timeline-art {
    grid-column: 2;
    justify-self: end;
  }
}

@media (max-width: 620px) {
  .timeline { --art-size: 78px; }
  .timeline::before { left: 12px; }
  .timeline-item,
  .timeline-item:nth-child(even) {
    padding-left: 32px;
    padding-top: 13px;
    padding-bottom: 13px;
  }
  .timeline-item::before { left: 12px; }
}

@media print {
  .timeline { --row-h: auto; max-width: none; }
  .timeline::before { display: none; }
  .timeline-item {
    height: auto;
    padding: 10px 0;
    break-inside: avoid;
  }
  .timeline-item::before { display: none; }
  .timeline-art { display: none; }
  .timeline-card,
  .timeline-item:nth-child(even) .timeline-card {
    grid-column: 1 / -1;
    justify-self: start;
    max-width: none;
  }
}
