/* ==========================================================================
   Blok „DTS w faktach” (.lift.dl-facts): fakty o firmie na jednej nici w arkuszu
   leżącym na nagłówku. Źródło (prototyp): assets/css/podstrony/dlaczego-dts.css (2. DTS w faktach)
   ========================================================================== */

.lift.dl-facts { padding-bottom: clamp(2.75rem, 5vw, 4rem); }

.dl-facts__list { list-style: none; margin: 1.75rem 0 .25rem; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: 2rem; }
.dl-fact { position: relative; min-width: 0; padding: 2.1rem 1.25rem 0 0; }
/* the thread: a pale track with the orange line over it, one segment per fact */
.dl-fact::before {
  content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; border-radius: 2px;
  background: linear-gradient(var(--orange), var(--orange)) 0 0 / 100% 100% no-repeat, var(--orange-100);
}
.dl-fact:last-child::before {
  -webkit-mask-image: linear-gradient(90deg, #000 35%, transparent);
  mask-image: linear-gradient(90deg, #000 35%, transparent);
}
.dl-fact::after {
  content: ""; position: absolute; left: 0; top: 0; width: 14px; height: 14px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 0 4px var(--orange-50);
}
.dl-fact__fig {
  margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 1rem auto;
  column-gap: .35rem; align-items: baseline; color: var(--navy-900);
}
.dl-fact__pre {
  grid-column: 1 / -1; grid-row: 1; align-self: end;
  font-family: var(--font-ui); font-weight: 500; font-size: .75rem; line-height: 1; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-2);
}
.dl-fact__num {
  grid-column: 1; grid-row: 2; white-space: nowrap;
  font-weight: 300; font-size: clamp(2.125rem, 1.4rem + 1.5vw, 2.75rem); line-height: 1.05; letter-spacing: -.035em; font-variant-numeric: tabular-nums;
}
.dl-fact__unit { grid-column: 2; grid-row: 2; font-size: 1.125rem; font-weight: 500; letter-spacing: -.01em; }
.dl-fact__label { margin: .6rem 0 0; max-width: 21ch; color: var(--muted); font-size: .9375rem; line-height: 1.45; }

/* the thread draws from fact to fact once the sheet is in view (view.js) */
.dl-facts__list.is-armed .dl-fact::before { background-size: 0 100%, auto; }
.dl-facts__list.is-armed .dl-fact::after { background: #fff; box-shadow: inset 0 0 0 2.5px var(--orange-100); }
.dl-facts__list.is-armed.is-on .dl-fact::before {
  background-size: 100% 100%, auto; transition: background-size .38s linear calc(var(--i, 0) * .38s + .25s);
}
.dl-facts__list.is-armed.is-on .dl-fact::after {
  background: var(--orange); box-shadow: 0 0 0 4px var(--orange-50);
  transition: background-color .3s, box-shadow .3s; transition-delay: calc(var(--i, 0) * .38s + .25s);
}

@media (max-width: 1100px) {
  .dl-facts__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dl-fact:nth-child(3)::before { -webkit-mask-image: linear-gradient(90deg, #000 35%, transparent); mask-image: linear-gradient(90deg, #000 35%, transparent); }
}

@media (max-width: 760px) {
  /* the facts run down a vertical thread */
  .dl-facts__list { grid-template-columns: minmax(0, 1fr); row-gap: 0; margin-top: 1.4rem; }
  .dl-fact { display: grid; grid-template-columns: minmax(0, 7.75rem) minmax(0, 1fr); column-gap: 1rem; align-items: center; padding: 0 0 1.35rem 2.1rem; }
  .dl-fact::before { left: 6px; right: auto; top: 1.3rem; bottom: -1.3rem; width: 2px; height: auto; background-size: 100% 100%, auto; }
  .dl-fact:last-child::before, .dl-fact:nth-child(3)::before { -webkit-mask-image: none; mask-image: none; }
  .dl-fact:last-child::before { display: none; }
  .dl-fact::after { top: calc(1.3rem - 7px); }
  .dl-fact__label { margin: 0; max-width: none; }
  .dl-facts__list.is-armed .dl-fact::before { background-size: 100% 0, auto; }
  .dl-facts__list.is-armed.is-on .dl-fact::before { background-size: 100% 100%, auto; }
}

@media (prefers-reduced-motion: reduce) {
  .dl-facts__list.is-armed .dl-fact::before { background-size: 100% 100%, auto; }
  .dl-facts__list.is-armed .dl-fact::after { background: var(--orange); box-shadow: 0 0 0 4px var(--orange-50); }
}
