/*
 * Front-page slider «Актуелно» (inc/home-slider.php, assets/js/home-slider.js).
 * The track scrolls on its own with scroll-snap (works with no JavaScript); every slide is as wide
 * as the lead column and the track is as tall as the tallest slide, so nothing below moves.
 * The bar's buttons show only when scripts run (html.js, set in the head); the items are links.
 */

.ed-hslider { position: relative; min-width: 0; }

.ed-hslider__track {
    position: relative;
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.ed-hslider__track::-webkit-scrollbar { display: none; }
.ed-hslider__track:focus-visible { outline: 2px solid var(--ed-ink); outline-offset: -2px; }

.ed-hslider__slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}
.ed-hslider__slide > .ed-story { height: 100%; }

/* Kicker: the section in its colour, then the sub-section. */
.ed-hslider__kicker { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--ed-s2); }
.ed-hslider__kicker .ed-hslider__sec { color: var(--sd-c-text, var(--ed-ink)); font-weight: 700; }
.ed-hslider__kicker .ed-hslider__sub { color: var(--ed-ink-4); }
.ed-hslider__kicker .ed-hslider__sub::before { content: "·"; margin-right: var(--ed-s2); color: var(--ed-ink-4); }

/* ---- the bar */
.ed-hslider__bar {
    display: flex;
    align-items: center;
    gap: var(--ed-s1);
    margin-top: var(--ed-s4);
    border-top: 1px solid var(--ed-line);
    font-family: var(--ed-sans);
    font-size: 0.8125rem;
    line-height: 1.2;
    color: var(--ed-ink-3);
}
.ed-hslider__label {
    flex: none;
    margin-right: var(--ed-s2);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ed-ink);
}
.ed-hslider__tabs {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow: hidden;
}
.ed-hslider__tabs > li { flex: 0 1 auto; min-width: 0; margin: 0; padding: 0; }
.ed-hslider__tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 0 var(--ed-s2);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}
.ed-hslider__tab:hover { color: var(--ed-ink); }
.ed-hslider__tab[aria-current] { color: var(--ed-ink); font-weight: 600; }
.ed-hslider__name { overflow: hidden; text-overflow: ellipsis; }
.ed-hslider__dot {
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sd-c, var(--ed-ink));
}
/* The thin line in the section's colour: full on the active item, filling while autoplay waits. */
.ed-hslider__fill {
    position: absolute;
    left: 0;
    right: 0;
    top: -1px;
    height: 2px;
    background: var(--sd-c, var(--ed-ink));
    transform: scaleX(0);
    transform-origin: 0 50%;
}
.ed-hslider__tab[aria-current] .ed-hslider__fill { transform: scaleX(1); }
.ed-hslider.is-auto .ed-hslider__tab[aria-current] .ed-hslider__fill {
    animation: ed-hslider-fill 6.5s linear forwards;
    animation-play-state: paused;
}
.ed-hslider.is-auto.is-running .ed-hslider__tab[aria-current] .ed-hslider__fill { animation-play-state: running; }
@keyframes ed-hslider-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.ed-hslider__btn {
    display: none;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--ed-ink);
    cursor: pointer;
}
.js .ed-hslider__btn { display: inline-flex; }
.ed-hslider__btn:hover { background: var(--ed-bg-2); }
.ed-hslider__btn:focus-visible,
.ed-hslider__tab:focus-visible { outline: 2px solid var(--ed-ink); outline-offset: -2px; }
.ed-hslider__play .ed-hslider__iplay { display: none; }
.ed-hslider__play[aria-pressed="true"] .ed-hslider__iplay { display: inline; }
.ed-hslider__play[aria-pressed="true"] .ed-hslider__ipause { display: none; }

.ed-hslider__count { display: none; flex: none; padding: 0 var(--ed-s1); font-variant-numeric: tabular-nums; }
.ed-hslider__count b { color: var(--ed-ink); font-weight: 700; }

/* Desktop: the «Актуелно» column beside the slider already carries the heading. */
@media (min-width: 1024px) {
    .ed-hslider__label { display: none; }
}

/* Dots in place of names: phones (a second row of 44px targets) and the narrow desktop column. */
@media (max-width: 739.98px), (min-width: 1024px) and (max-width: 1279.98px) {
    .ed-hslider__tab { justify-content: center; width: 32px; min-height: 42px; padding: 0; }
    .ed-hslider__name {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .ed-hslider__dot { width: 8px; height: 8px; opacity: 0.45; }
    .ed-hslider__tab[aria-current] .ed-hslider__dot { opacity: 1; transform: scale(1.25); }
    .ed-hslider__fill { left: 6px; right: 6px; }
    .ed-hslider__count { display: inline; }
}
@media (min-width: 1024px) and (max-width: 1279.98px) {
    .ed-hslider__tabs { flex: 1 1 auto; justify-content: center; }
    .ed-hslider__tabs > li { flex: none; }
}
@media (max-width: 739.98px) {
    .ed-hslider__bar { flex-wrap: wrap; gap: 0; padding-inline: var(--ed-gutter); }
    .ed-hslider__label { margin-right: auto; }
    .ed-hslider__tabs { order: 5; flex: 1 0 100%; justify-content: center; border-top: 1px solid var(--ed-line); }
    .ed-hslider__tabs > li { flex: none; }
    .ed-hslider__tab { width: 44px; min-height: 44px; }
    .ed-hslider__fill { left: 12px; right: 12px; }
    .ed-hslider__btn { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .ed-hslider__track { scroll-behavior: auto; }
    .ed-hslider.is-auto .ed-hslider__tab[aria-current] .ed-hslider__fill { animation: none; transform: scaleX(1); }
}

/* Even slides: every summary is held to the same number of lines and the meta line sits at the foot of
   the slide, so a slide with a shorter headline leaves no hole above the bar. */
.ed-hslider__slide > .ed-story { display: flex; flex-direction: column; }
.ed-hslider__slide > .ed-story > .ed-story__body { display: flex; flex: 1 1 auto; flex-direction: column; }
.ed-hslider__slide .ed-story__dek { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.ed-home .ed-hslider__slide .ed-meta { margin-top: auto; padding-top: var(--ed-s2); }
.ed-hslider__bar { margin-top: var(--ed-s3); }
@media (min-width: 740px) {
    .ed-hslider__slide .ed-story__dek { -webkit-line-clamp: 2; line-clamp: 2; }
}
/* Phones: the counter and the arrows are enough; the row of dots only added height. */
@media (max-width: 739.98px) {
    .js .ed-hslider__tabs { display: none; }
}
/* A long headline one step smaller (see aed_home_slider_html). */
.ed-home .ed-hslider__slide--long .ed-story__headline { font-size: calc(var(--ed-fs-xl) * 0.86); }
