/* ==========================================================================
   Blok „Arkusz »Od 2004 roku«” (.yrs): łańcuch do trzech liczb (lekkie cyfry Figure,
   pomarańczowe łączniki jak w izotypie) i linijka lat (kreski granatowe, lata z osi czasu
   wyższe i klikalne, ostatni rok najdłuższy – jak linijka „21 lat” w ekologii).
   ========================================================================== */

.yrs__chain {
  display: flex; align-items: flex-start; gap: 1rem clamp(1rem, 2.4vw, 2rem);
  margin: 0; padding: clamp(1.5rem, 3vw, 2.25rem) 0 clamp(1.5rem, 3vw, 2rem);
}
.yrs__fig { flex: 1 1 0; display: flex; flex-direction: column; min-width: 0; margin: 0; }
.yrs__pre {
  font-family: var(--font-ui); font-weight: 500; font-size: .8125rem; line-height: 1.2;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2);
}
.yrs__num { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .45rem; color: var(--navy-900); }
.yrs__fig:not(:has(.yrs__pre)) .yrs__num { margin-top: 1rem; }
.yrs__n {
  font-weight: 300; font-size: clamp(2.75rem, 2rem + 2.3vw, 3.875rem); line-height: .95; letter-spacing: -.035em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.yrs__unit { font-size: 1.125rem; font-weight: 500; letter-spacing: -.01em; }
.yrs__cap { margin-top: .55rem; max-width: 26ch; font-size: 1rem; line-height: 1.45; color: var(--muted); }
.yrs__op {
  flex: none; align-self: center; margin-top: -1.5rem; padding: .45em .8em; border-radius: 3px; background: var(--orange);
  font-family: var(--font-ui); font-weight: 500; font-size: .75rem; line-height: 1.2; color: var(--navy-900); white-space: nowrap;
}

/* linijka: jedna kreska na rok na granatowej podstawie */
.yrs__ruler { padding: 1.4rem 0 .4rem; border-top: 1px solid var(--line); }
.yrs__ticks {
  position: relative; list-style: none; margin: 0; padding: 0 0 1.6rem; height: calc(42px + 1.6rem);
  display: flex; justify-content: space-between; align-items: flex-end;
}
.yrs__ticks::after { content: ""; position: absolute; left: 0; right: 0; bottom: 1.6rem; height: 2px; background: var(--navy-900); border-radius: 1px; }
.yrs__tick { position: relative; width: 0; height: 100%; display: flex; justify-content: center; align-items: flex-end; }
.yrs__tick > a, .yrs__mark {
  position: absolute; bottom: 0; left: 50%; display: flex; justify-content: center; width: 22px; height: 46px; margin-left: -11px;
  color: inherit; text-decoration: none;
}
.yrs__tick > a::before, .yrs__mark::before {
  content: ""; position: absolute; bottom: 0; left: 50%; width: 3px; height: 14px; margin-left: -1.5px; border-radius: 2px 2px 0 0;
  background: var(--line-strong); transform-origin: bottom; transition: transform .45s var(--ease) calc(var(--i) * 38ms), background-color .2s, height .2s;
}
.yrs__tick.is-event > a::before { height: 28px; background: var(--navy-900); }
.yrs__tick.is-last > a::before, .yrs__tick.is-last .yrs__mark::before { height: 42px; width: 4px; margin-left: -2px; background: var(--navy-900); }
.yrs__y {
  position: absolute; top: calc(100% + .45rem); left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-family: var(--font-ui); font-weight: 500; font-size: .75rem; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums;
  opacity: 0; transition: opacity .2s, color .2s;
}
.yrs__tick.has-label .yrs__y { opacity: 1; }
.yrs__tick > a:hover::before, .yrs__tick > a:focus-visible::before { background: var(--orange-600); height: 34px; }
.yrs__tick > a:hover .yrs__y, .yrs__tick > a:focus-visible .yrs__y { opacity: 1; color: var(--navy-900); }
.yrs__tick > a:focus-visible { outline: none; }
.yrs__tick > a:focus-visible::after { content: ""; position: absolute; inset: -4px -2px; border-radius: 4px; box-shadow: 0 0 0 2px var(--navy-900); }
.yrs__ticks:has(a:hover, a:focus-visible) .has-label:not(:has(a:hover, a:focus-visible)) .yrs__y { opacity: .35; }

.yrs__key { display: flex; align-items: center; gap: .55rem; margin: .4rem 0 0; font-family: var(--font-ui); font-size: .75rem; color: var(--muted); }
.yrs__key-tall { width: 3px; height: 14px; border-radius: 2px 2px 0 0; background: var(--navy-900); }

/* ruch: kreski rosną od podstawy po kolei, gdy arkusz wchodzi w widok */
.yrs.is-armed .yrs__tick > a::before, .yrs.is-armed .yrs__mark::before { transform: scaleY(.15); }
.yrs.is-drawn .yrs__tick > a::before, .yrs.is-drawn .yrs__mark::before { transform: none; }

@media (max-width: 767px) {
  .yrs__chain { flex-direction: column; gap: .9rem; }
  .yrs__op { align-self: flex-start; margin: 0; }
  .yrs__fig:not(:has(.yrs__pre)) .yrs__num { margin-top: 0; }
  .yrs__tick.has-label:not(.is-last):not(:first-child) .yrs__y { opacity: 0; }
  .yrs__tick:nth-child(5n+2).has-label .yrs__y { opacity: 1; }
}
@media (max-width: 420px) {
  .yrs__tick > a, .yrs__mark { width: 14px; margin-left: -7px; }
  .yrs__tick > a::before, .yrs__mark::before { width: 2px; margin-left: -1px; }
}
@media (prefers-reduced-motion: reduce) {
  .yrs__tick > a::before, .yrs__mark::before { transition: none; }
}
