/* ── Newsticker (content block vrrkit/news-ticker) ────────────────────────────
   Label fixed on the left, entries move (track), the background image stays.
   Speed: --news-ticker-duration is set by news-ticker.js from the content width.
   Lives in vrr_kit (not in the content block assets): the asset symlinks of content blocks
   are not reliably published on deployments. */

.vrrkit-news-ticker {
    --news-ticker-height: 4rem;
    --news-ticker-gap: 6rem;
    position: relative;
    display: flex;
    align-items: stretch;
    min-height: var(--news-ticker-height);
    overflow: hidden;
    color: #fff;
    --news-ticker-tint: rgba(83, 123, 148, .3); /* #537B94, light layer between image and text */
    /* Image from the template (inline --news-ticker-bg): own image of the element or the default
       Resources/Public/Images/NewsTicker/background.webp */
    background:
        linear-gradient(var(--news-ticker-tint), var(--news-ticker-tint)),
        #050708 var(--news-ticker-bg, none) center 30% / cover no-repeat;
}

/* ── Label (not animated) ── */
.vrrkit-news-ticker__label {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin: 0;
    padding: 0 3rem;
    border-radius: 0 .5rem .5rem 0;
    background: rgba(66, 66, 66, .92);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

/* Optional link on the label: the whole label box is clickable */
.vrrkit-news-ticker__label-link {
    color: inherit;
    text-decoration: none;
}

.vrrkit-news-ticker__label-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.vrrkit-news-ticker__label-link:hover,
.vrrkit-news-ticker__label-link:focus {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: .2em;
}

.vrrkit-news-ticker__label-link:focus-visible {
    outline: none;
}

.vrrkit-news-ticker__label:has(.vrrkit-news-ticker__label-link:focus-visible) {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

/* ── Moving part ── */
.vrrkit-news-ticker__viewport {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    container-type: inline-size;
    /* Soft edge next to the label */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 2rem);
    mask-image: linear-gradient(to right, transparent 0, #000 2rem);
}

.vrrkit-news-ticker__track {
    display: flex;
    width: max-content;
    animation: vrrkit-news-ticker var(--news-ticker-duration, 40s) linear infinite;
    will-change: transform;
}

@keyframes vrrkit-news-ticker {
    from { transform: translate3d(0, 0, 0); }
    /* Two identical lists: moving by one list width loops seamlessly */
    to { transform: translate3d(-50%, 0, 0); }
}

/* Pause: hover (devices with a real pointer), keyboard focus, tap (class from news-ticker.js) */
@media (hover: hover) {
    .vrrkit-news-ticker__viewport:hover .vrrkit-news-ticker__track {
        animation-play-state: paused;
    }
}

.vrrkit-news-ticker__viewport:focus-within .vrrkit-news-ticker__track,
.vrrkit-news-ticker.is-paused .vrrkit-news-ticker__track {
    animation-play-state: paused;
}

.vrrkit-news-ticker__list {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: var(--news-ticker-gap);
    /* At least as wide as the visible area, so short tickers loop without a gap */
    min-width: 100cqw;
    margin: 0;
    padding: 0 var(--news-ticker-gap) 0 2.5rem;
    list-style: none;
}

.vrrkit-news-ticker__item {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: .75rem;
    margin: 0;
    padding: 0;
    font-size: .9375rem;
    font-weight: 600;
    white-space: nowrap;
}

.vrrkit-news-ticker__dot {
    flex: 0 0 auto;
    width: 1.375rem;
    height: 1.375rem;
    border: .1875rem solid #fff;
    border-radius: 50%;
    background: #c9d2d5;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
}

.vrrkit-news-ticker__subline {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-left: .5rem;
}

.vrrkit-news-ticker__subline::before {
    content: "";
    width: .375rem;
    height: .375rem;
    border-radius: 50%;
    background: currentColor;
}

.vrrkit-news-ticker__button {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    margin-left: .75rem;
    padding: .5rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: .375rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
    transition: background-color .2s ease-in-out, color .2s ease-in-out;
}

.vrrkit-news-ticker__button:hover,
.vrrkit-news-ticker__button:focus {
    background: #fff;
    color: #0f5959;
    text-decoration: none;
}

.vrrkit-news-ticker__button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.vrrkit-news-ticker__button svg {
    flex: 0 0 auto;
}

/* ── Mobile ── */
@media (max-width: 767.98px) {
    .vrrkit-news-ticker {
        --news-ticker-height: 3.5rem;
        --news-ticker-gap: 3rem;
    }

    .vrrkit-news-ticker__label {
        padding: 0 1rem;
        font-size: 1rem;
    }

    .vrrkit-news-ticker__list {
        padding-left: 1.5rem;
    }

    .vrrkit-news-ticker__item {
        font-size: .875rem;
    }

    .vrrkit-news-ticker__dot {
        width: 1.125rem;
        height: 1.125rem;
        border-width: .15625rem;
    }

    .vrrkit-news-ticker__button {
        padding: .375rem 1rem;
        font-size: .875rem;
    }
}

/* ── Reduced motion: no movement, entries can be scrolled instead ── */
@media (prefers-reduced-motion: reduce) {
    .vrrkit-news-ticker__track {
        animation: none;
    }

    .vrrkit-news-ticker__viewport {
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .vrrkit-news-ticker__list--copy {
        display: none;
    }

    .vrrkit-news-ticker__list {
        min-width: 0;
    }
}
