.highlights {
    padding: 40px 0 20px;
}

.highlights-head {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 34px;
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.highlights-title {
    font-size: 28px;
    font-weight: bold;
    color: #F5F5F7;
    text-align: left;
    margin: 0;
    flex: 1;
}

.highlights-film {
    font-size: 17px;
    color: #2997FF;
    text-decoration: none;
    white-space: nowrap;
}

.highlights-film:hover {
    text-decoration: underline;
}

.highlights-track {
    --card-w: 324px;
    /* Левый край первой карточки совпадает с заголовком секции. */
    --pad: max(34px, calc((100% - 1024px) / 2));
    position: relative;
    display: flex;
    gap: 20px;
    margin-top: 24px;
    padding: 0 var(--pad) 8px;
    scroll-padding-left: var(--pad);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.highlights-track::-webkit-scrollbar {
    display: none;
}

.highlight {
    flex: 0 0 var(--card-w);
    scroll-snap-align: start;
    margin: 0;
    opacity: 0.35;
    transition: opacity 0.4s ease;
    cursor: pointer;
}

.highlight.is-active {
    opacity: 1;
    cursor: default;
}

/* Видео занимает карточку от края до края: камера в роликах наезжает за кадр,
   и срез должен совпадать со скруглённым краем карточки. */
.highlight-media {
    position: relative;
    aspect-ratio: 9 / 16;
    /* Фон роликов чёрный: он кодируется без сдвига цвета, шва с карточкой нет. */
    background-color: #000;
    border-radius: 28px;
    overflow: hidden;
}

.highlight-media::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.highlight-media video,
.highlight-media .highlight-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.highlight-poster {
    transition: opacity 0.5s ease;
}

.highlight.is-playing .highlight-poster {
    opacity: 0;
}

.highlight-name {
    font-size: 19px;
    font-weight: 600;
    color: #F5F5F7;
    margin: 18px 4px 6px;
}

.highlight-text {
    font-size: 15px;
    line-height: 1.45;
    color: #A1A1A6;
    margin: 0 4px;
}

.highlights-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
}

.highlights-dots {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 18px;
    border-radius: 9999px;
    background-color: #1D1D1F;
}

.highlights-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background-color: #6E6E73;
    cursor: pointer;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.highlights-dot.is-active {
    width: 28px;
    background-color: #F5F5F7;
}

.highlights-button {
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: #1D1D1F;
    color: #F5F5F7;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

.highlights-button:hover {
    background-color: #2C2C2E;
}

.highlights-button:disabled {
    opacity: 0.3;
    cursor: default;
}

.highlights-button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.highlights-toggle .icon-play,
.highlights.is-paused .highlights-toggle .icon-pause {
    display: none;
}

.highlights.is-paused .highlights-toggle .icon-play {
    display: block;
}

.highlights-dot:focus-visible,
.highlights-button:focus-visible,
.highlight:focus-visible .highlight-media {
    outline: 2px solid #2997FF;
    outline-offset: 3px;
}

@media (max-width: 768px) {
    .highlights-track {
        --card-w: min(76vw, 324px);
        --pad: 24px;
        gap: 14px;
    }

    .highlights-head {
        padding: 0 24px;
    }

    .highlights-title {
        font-size: 24px;
    }

    .highlight-media {
        border-radius: 24px;
    }

    /* На телефоне листают свайпом, стрелки не помещаются рядом с точками. */
    .highlights-button[data-highlights-prev],
    .highlights-button[data-highlights-next] {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .highlights-track {
        scroll-behavior: auto;
    }

    .highlight,
    .highlight-poster {
        transition: none;
    }
}
