/* ==========================================================================
   initiatives.css
   Styles used only on the Scientific Initiatives page (initiatives.html):
   one folding block per year (the block itself: components.css), the year
   large beside the places line. Colours: --timeline-* tokens in base.css.
   ========================================================================== */

.initiatives {
  padding-top: .5rem;
}

.page-sub .icon {
  margin-right: .35rem;
  color: var(--icon);
}

/* heading row: the year (with a dot) and the places line */
.tl-item .item-title > span {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 2rem;
  align-items: baseline;
}

.tl-year {
  position: relative;
  padding-left: 1.4rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  color: var(--timeline-year);
}

.tl-year::before {                     /* the dot */
  content: "";
  position: absolute;
  top: .35em;
  left: 0;
  width: .6rem;
  height: .6rem;
  background: var(--timeline-dot);
  border-radius: 50%;
}

/* inside: lined up under the places line */
.tl-body {
  padding-left: calc(11rem + 2rem);
}

.tl-date {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--ink-soft);
}

/* events: each links to its spot on the year page */
.tl-events {
  margin: .9rem 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-small);
}

.tl-events li {
  position: relative;
  padding: .2rem 0 .2rem 1rem;
}

.tl-events li::before {                /* a short pine-green dash */
  content: "";
  position: absolute;
  top: .85em;
  left: 0;
  width: .45rem;
  height: 1px;
  background: var(--accent);
}

.tl-events a {
  color: var(--ink-soft);
  text-decoration: none;
}

.tl-events a:hover,
.tl-events a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.tl-event-place {
  font-weight: 600;
  color: var(--ink);
}

.tl-events a:hover .tl-event-place {
  color: inherit;
}

/* the tag to the year page */
.tl-body > .item-links {
  margin-top: 1.25rem;
}

@media (max-width: 640px) {
  .tl-item .item-title > span {
    grid-template-columns: 1fr;
    gap: .5rem;
  }

  .tl-body {
    padding-left: 0;
  }
}

/* All years at a glance, above the timeline: each leads to its row */
.year-grid {
  display: grid;
  grid-auto-flow: column;              /* wide screens: all years in one row */
  grid-auto-columns: minmax(0, 1fr);
  gap: .5rem;
  margin: 0 0 2.25rem;
  padding: 0;
  list-style: none;
}

.year-jump {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
  color: var(--timeline-year);
  text-decoration: none;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.year-jump:hover,
.year-jump:focus-visible {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 900px) {
  .year-grid {
    grid-auto-flow: row;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .year-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .year-jump {
    min-height: 2.75rem;
    font-size: .95rem;
  }
}

@media print {
  .year-grid {
    display: none;
  }
}
