/* Funktioner autoplay: the rest between two demos (showcase.js). The kit holds a demo's end for the rest (figure[data-dk-resting], its real length
   in --dk-rest) and showcase.js marks Nästa with data-resting meanwhile: the pen draws a line along Nästa's lower edge for that long, at an even pace
   (it is a clock). The line follows the kit's clock: it is paused whenever the figure is not playing (Pausa, out of view, hidden tab), so it never says
   more than the kit knows. Nästa (tabs.css) is `position: relative`, the anchor of the line. */
.tabs-next[data-resting]::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 3px; pointer-events: none;
  clip-path: polygon(0 0, 100% 35%, 100% 65%, 0 100%);   /* a taper, fixed in the box */
  background: linear-gradient(var(--pen), var(--pen)) 0 0 / 0% 100% no-repeat;   /* the red grows through the taper, so the shape does not stretch */
  animation: rest-draw var(--dk-rest, 4s) linear forwards;
}
.dk-demo:not([data-dk-state="playing"]) .tabs-next[data-resting]::after { animation-play-state: paused; }
@keyframes rest-draw { to { background-size: 100% 100%; } }
@media (forced-colors: active) { .tabs-next[data-resting]::after { forced-color-adjust: none; background-image: linear-gradient(Highlight, Highlight); } }
@media (prefers-reduced-motion: reduce) { .tabs-next[data-resting]::after { display: none; } }
