/* milestones.css.
   Bucket-tracks. Mobile first.
   Renderas inom valfri container (index.html .ms-section eller ir.html ir-content).
*/

/* =====================================================
   1. WRAPPER. Djupare bakgrund (--bg-deep) for tidslinje-feel.
   ===================================================== */
.ms-section {
  padding: 72px 0 88px;
  background: rgba(0,0,0,0.22);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.ms-wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* IR-versionen: ingen egen bakgrund, ingen wrap-padding */
.ir-content #milestones-host { padding-bottom: 0; border-bottom: none; margin-bottom: 56px; }

/* =====================================================
   2. HEADER
   ===================================================== */
.ms-head { margin-bottom: 36px; max-width: 720px; }
.ms-kicker {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold);
  font-weight: 600; margin-bottom: 12px;
}
.ms-h2 {
  font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 300;
  color: var(--text); letter-spacing: -0.022em; line-height: 1.15;
  margin: 0 0 14px;
}
.ms-h2 em { font-style: normal; color: var(--gold); font-weight: 300; }
.ms-sub {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  color: var(--text-low); line-height: 1.55; margin: 0;
}

/* =====================================================
   3. TRACKS (kolumner desktop, stack mobile)
   ===================================================== */
.ms-tracks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 32px;
}

.ms-track {
  position: relative;
  padding: 22px 0 22px 24px;
  background: transparent;
  border: none;
  border-left: 2px solid var(--gold);
  border-radius: 0;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.ms-track.is-visible { opacity: 1; transform: translateY(0); }
.ms-track:nth-child(2) { transition-delay: 0.08s; }
.ms-track:nth-child(3) { transition-delay: 0.16s; }
.ms-track:nth-child(4) { transition-delay: 0.24s; }

.ms-track-ongoing { border-left-color: var(--gold-dark); border-left-style: dashed; opacity: 0.85; }
.ms-track-ongoing.is-visible { opacity: 0.92; }

/* Pulserande dot för Pågående för att signalera live-status */
.ms-track-ongoing .ms-track-tid::before {
  content: ""; display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  margin-right: 10px; vertical-align: middle;
  animation: ms-pulse 1.8s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(197,160,89,0.55);
}
@keyframes ms-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(197,160,89,0.55); transform: scale(1); }
  50%      { box-shadow: 0 0 0 10px rgba(197,160,89,0); transform: scale(1.12); }
}

.ms-track-head { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.ms-track-tid {
  font-family: var(--sans);
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 300;
  letter-spacing: -0.018em;
  color: var(--gold);
  line-height: 1.05;
  margin-bottom: 6px;
}
.ms-track-period { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-low); margin-bottom: 10px; }
.ms-track-count { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; color: var(--text-low); text-transform: uppercase; }

.ms-track-list { list-style: none; padding: 0; margin: 0; }
.ms-track-list li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 9px 0; align-items: start; border-bottom: 1px dashed var(--line); }
.ms-track-list li:last-child { border-bottom: none; padding-bottom: 0; }
.ms-track-list li:first-child { padding-top: 0; }

.ms-mark { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-top: 7px; justify-self: center; display: block; }
.ms-track-ongoing .ms-mark { background: var(--gold-dark); opacity: 0.6; }

.ms-item-text { color: var(--text); font-size: 0.94rem; line-height: 1.45; font-weight: 400; }

/* =====================================================
   4. SOURCE-link
   ===================================================== */
.ms-source {
  margin: 0;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--text-low);
}
.ms-source a {
  color: var(--gold); border-bottom: 1px solid rgba(197,160,89,0.3);
  padding-bottom: 1px;
}
.ms-source a:hover { border-bottom-color: var(--gold); }

/* =====================================================
   5. RESPONSIV. Mobile first. Bredda till kolumner pa starre skarmar.
   ===================================================== */

/* >=600px: trots smal mobil, lite mer luft */
@media (min-width: 600px) {
  .ms-section { padding: 64px 0 72px; }
  .ms-wrap { padding: 0 32px; }
  .ms-track { padding: 24px 26px; }
  .ms-h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
}

/* >=860px: tva kolumner */
@media (min-width: 860px) {
  .ms-tracks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}

/* >=1100px: tre eller fyra kolumner */
@media (min-width: 1100px) {
  .ms-tracks[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ms-tracks[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ms-tracks { gap: 22px; }
}

/* Designpaket 1: mjuk listprogression i milstolpar. */
.ms-track-list li {
  opacity: 0; transform: translateY(8px);
  transition: opacity 260ms cubic-bezier(0.22, 1, 0.36, 1), transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
.ms-track.is-visible .ms-track-list li { opacity: 1; transform: translateY(0); }
.ms-track.is-visible .ms-track-list li:nth-child(2) { transition-delay: 40ms; }
.ms-track.is-visible .ms-track-list li:nth-child(3) { transition-delay: 80ms; }
.ms-track.is-visible .ms-track-list li:nth-child(4) { transition-delay: 120ms; }
.ms-track.is-visible .ms-track-list li:nth-child(5) { transition-delay: 160ms; }
@media (prefers-reduced-motion: reduce) {
  .ms-track, .ms-track-list li { opacity: 1; transform: none; transition: none; }
  .ms-track-ongoing .ms-track-tid::before { animation: none; }
}

/* v1.7 Spectral display-rubriker */
.ms-h2, .ms-track-tid { font-family: 'Spectral', Georgia, 'Times New Roman', serif; }
