/*
 * «Актуелно» on a section page (inc/article-akt.php, templates/archive.php): a band under the
 * page's lead package with one story from each of the other sections — the front page's
 * «Актуелно» laid in columns. Every row carries its own section's colour (data-sec on the row):
 * the kicker with the section's dot and name, the headline, the time, a square picture.
 *
 * Three columns from 1024px, two from 740px, hairlines between them; on phones one row that
 * slides sideways, so the section's own stories stay close under the lead.
 */

.ed-akt-band__head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
.ed-akt-band__sub { font-weight: 500; color: var(--ed-ink-4); }
.ed-akt-band__strip { margin-bottom: var(--ed-s2); }

.ed-akt-band__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}
.ed-akt-band__list > .ed-art-akt__row {
  position: relative;
  isolation: isolate;
  min-width: 0;
  padding-block: 12px;
  border-top: 1px solid var(--ed-line);
}
.ed-akt-band__list > .ed-art-akt__row:first-child { border-top: 0; }

/* The row: as in the columns beside a story and on the front page. */
.ed-akt-band .ed-art-akt__item { --ed-thumb: 64px; column-gap: 12px; align-items: start; }
.ed-akt-band .ed-art-akt__kicker {
  margin: 0 0 4px;
  font-family: var(--ed-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ed-akt-band .ed-art-akt__kicker > a,
.ed-akt-band .ed-art-akt__kicker > span { display: inline-flex; align-items: center; color: var(--sd-c-text, var(--ed-ink)); text-decoration: none; }
.ed-akt-band .ed-art-akt__kicker > a:hover { text-decoration: underline; text-underline-offset: 2px; }
.ed-akt-band .ed-art-akt__dot {
  flex: none;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--sd-c, var(--ed-ink));
}
.ed-akt-band .ed-art-akt__item .ed-story__headline { font-size: 1rem; line-height: 1.25; }
.ed-akt-band .ed-art-akt__time {
  margin: 4px 0 0;
  font-family: var(--ed-sans);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ed-ink-4);
}
.ed-akt-band .ed-media { background-color: var(--sd-c-wash-2, var(--ed-bg-3)); }

/* The row under the pointer or the keyboard: a soft wash in its section's colour. */
.ed-akt-band__list > .ed-art-akt__row::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 -8px;
  background: var(--sd-c-wash, var(--ed-bg-2));
  opacity: 0;
  pointer-events: none;
}
.ed-akt-band__list > .ed-art-akt__row:hover::before,
.ed-akt-band__list > .ed-art-akt__row:focus-within::before { opacity: 1; }

/* Phones: one row that slides, edge to edge; the next story shows at the right as the cue. */
@media (max-width: 739.98px) {
  .ed-akt-band__list {
    display: flex;
    margin-inline: calc(-1 * var(--ed-gutter));
    padding-inline: var(--ed-gutter);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: var(--ed-gutter);
    scrollbar-width: none;
  }
  .ed-akt-band__list::-webkit-scrollbar { display: none; }
  .ed-akt-band__list > .ed-art-akt__row {
    flex: 0 0 min(80vw, 320px);
    box-sizing: border-box;
    margin-right: 14px;
    padding: 4px 14px 4px 0;
    border-top: 0;
    border-right: 1px solid var(--ed-line);
    scroll-snap-align: start;
  }
  .ed-akt-band__list > .ed-art-akt__row:last-child { margin-right: 0; padding-right: 0; border-right: 0; }
  .ed-akt-band__list > .ed-art-akt__row::before { inset: 0 6px 0 -6px; }
}

/* Tablets: two columns. */
@media (min-width: 740px) {
  .ed-akt-band .ed-art-akt__item { --ed-thumb: 72px; }
  .ed-akt-band__list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: calc(2 * var(--ed-col-pad, 12px) + 8px); }
  .ed-akt-band__list > .ed-art-akt__row:nth-child(-n+2) { border-top: 0; }
  .ed-akt-band__list > .ed-art-akt__row::after {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: calc(-1 * var(--ed-col-pad, 12px) - 4px);
    border-left: 1px solid var(--ed-line);
    pointer-events: none;
  }
}
@media (min-width: 740px) and (max-width: 1023.98px) {
  .ed-akt-band__list > .ed-art-akt__row:nth-child(2n+1)::after { content: none; }
}
/* Inside a page's main column (Кујна) the band keeps two columns on desktops too. */
@media (min-width: 1024px) {
  .ed-akt-band--narrow .ed-akt-band__list > .ed-art-akt__row:nth-child(2n+1)::after { content: none; }
}

/* Desktops: three columns. */
@media (min-width: 1024px) {
  .ed-akt-band:not(.ed-akt-band--narrow) .ed-akt-band__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ed-akt-band:not(.ed-akt-band--narrow) .ed-akt-band__list > .ed-art-akt__row:nth-child(-n+3) { border-top: 0; }
  .ed-akt-band:not(.ed-akt-band--narrow) .ed-akt-band__list > .ed-art-akt__row:nth-child(3n+1)::after { content: none; }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .ed-akt-band__list > .ed-art-akt__row::before { transition: opacity 0.28s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .ed-akt-band .ed-media > img { transition: transform 0.42s var(--fx-ease, ease), opacity 0.36s var(--fx-ease, ease); }
  .ed-akt-band .ed-story:hover .ed-media > img { transform: scale(1.03); }
}

@media print {
  .ed-akt-band { display: none; }
}

/* Phones: every card of the sliding row is three headline lines at most, so the row has one height. */
@media (max-width: 739.98px) {
  .ed-akt-band .ed-art-akt__item .ed-story__headline {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }
}
