/* Nordia · home.marquee
 *
 * The infinite-slide plugin wraps `.infiniteSlide-wrapper` at runtime. Keep
 * every visual rule anchored to the markup emitted by marquee-section.blade
 * so editor previews and the storefront share exactly the same layout.
 */

.tf-marquee-style {
    --tf-mq-gap: clamp(12px, 1.5vw, 24px);
    --tf-mq-divider-size: var(--tf-divider-icon-size, clamp(18px, 2vw, 30px));
    --tf-mq-pill-radius: 999px;
    --tf-mq-pill-pad-y: 0.65rem;
    --tf-mq-pill-pad-x: 1.25rem;
}

.tf-marquee-style .infiniteslide_wrap {
    width: 100%;
}

.tf-marquee-style .infiniteSlide-item > p,
.tf-marquee-style .tf-marquee-pill > p {
    margin: 0;
    white-space: nowrap;
}

.tf-marquee-style .tf-marquee-divider-slot {
    min-width: var(--tf-mq-gap);
    margin-inline: var(--tf-mq-gap);
    color: var(--tf-divider-icon-color, currentColor);
}

.tf-marquee-style .tf-marquee__divider-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    color: var(--tf-divider-icon-color, currentColor) !important;
    font-size: var(--tf-mq-divider-size) !important;
    line-height: 1;
}

.tf-marquee-style .br-dot {
    width: clamp(8px, 0.8vw, 12px);
    height: clamp(8px, 0.8vw, 12px);
    margin: 0;
    border: 1px solid currentColor;
    border-radius: 50%;
}

.tf-marquee-style .tf-marquee-empty {
    width: 100%;
    min-height: 56px;
}

/* Vertical motion uses the configured viewport height and a column track. */
.tf-marquee-style .infiniteSlide-wrapper[data-direction="up"],
.tf-marquee-style .infiniteSlide-wrapper[data-direction="down"] {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    min-width: 100% !important;
    white-space: normal !important;
}

.tf-marquee-style .infiniteSlide-wrapper[data-direction="up"] > .infiniteSlide-item,
.tf-marquee-style .infiniteSlide-wrapper[data-direction="down"] > .infiniteSlide-item {
    width: 100%;
    margin: 0;
    padding-block: calc(var(--tf-mq-gap) / 2);
    text-align: center;
}

.tf-marquee-style .infiniteSlide-wrapper[data-direction="up"] > .tf-marquee-divider-slot,
.tf-marquee-style .infiniteSlide-wrapper[data-direction="down"] > .tf-marquee-divider-slot {
    min-height: var(--tf-mq-gap);
    padding-block: 0;
}

/* Style 1 — Classic serif statement. */
.tf-marquee-style--1 {
    padding-block: clamp(16px, 2.4vw, 36px);
}

.tf-marquee-style--1 .infiniteSlide-item > p {
    font-size: clamp(38px, 5.7vw, 80px);
    font-weight: 300;
    line-height: 1.1;
}

/* Style 2 — Compact news ticker. */
.tf-marquee-style--2 {
    --tf-mq-gap: clamp(8px, 1vw, 14px);
    padding-block: clamp(9px, 1.1vw, 14px);
    border-block: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}

.tf-marquee-style--2 .tf-marquee-ticker-text {
    font-size: clamp(12px, 1.05vw, 15px);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.tf-marquee-style--2 .tf-marquee-divider-slot {
    min-width: var(--tf-mq-gap);
}

.tf-marquee-style--2 .infiniteSlide-item {
    margin-inline: 6px;
}

.tf-marquee-style--2 .tf-marquee-slash {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    font-weight: 400;
    line-height: 1;
    opacity: 0.45;
    user-select: none;
}

/* Style 3 — Two rows travelling in opposite directions. */
.tf-marquee-style--3 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(4px, 0.65vw, 10px);
    padding-block: clamp(20px, 3vw, 42px);
}

.tf-marquee-style--3-row {
    flex: 0 0 auto;
    padding: 0 !important;
}

.tf-marquee-style--3-row .infiniteSlide-item > p {
    font-size: clamp(24px, 3.2vw, 48px);
    font-weight: 300;
    line-height: 1.1;
}

.tf-marquee-style--3 > .tf-marquee-style--3-row:nth-child(2) {
    opacity: 0.55;
}

/* Style 4 — Independent pill labels; this style intentionally has no divider. */
.tf-marquee-style--4 {
    --tf-mq-gap: clamp(6px, 0.8vw, 12px);
    padding-block: clamp(18px, 2.5vw, 34px);
}

.tf-marquee-style--4 .infiniteSlide-item {
    margin-inline: var(--tf-mq-gap);
}

.tf-marquee-style--4 .tf-marquee-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--tf-mq-pill-pad-y) var(--tf-mq-pill-pad-x);
    border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
    border-radius: var(--tf-mq-pill-radius);
    background: color-mix(in srgb, currentColor 6%, transparent);
    line-height: 1;
}

.tf-marquee-style--4 .tf-marquee-pill-text {
    font-size: clamp(13px, 1.25vw, 18px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tf-marquee-style--4 .tf-marquee-pill .troke-text_black {
    -webkit-text-stroke-width: 1px;
}

/* Style 5 — One announcement enters, pauses, then leaves before the next one. */
.tf-marquee-style--5 {
    --tf-announcement-enter-x: 0;
    --tf-announcement-enter-y: 100%;
    --tf-announcement-leave-x: 0;
    --tf-announcement-leave-y: -100%;
    width: 100%;
    min-width: 0;
    padding-block: clamp(8px, 1vw, 12px);
    overflow: hidden;
}

.tf-marquee-style--5[data-direction="down"] {
    --tf-announcement-enter-y: -100%;
    --tf-announcement-leave-y: 100%;
}

.tf-marquee-style--5[data-direction="left"] {
    --tf-announcement-enter-x: 100%;
    --tf-announcement-enter-y: 0;
    --tf-announcement-leave-x: -100%;
    --tf-announcement-leave-y: 0;
}

.tf-marquee-style--5[data-direction="right"] {
    --tf-announcement-enter-x: -100%;
    --tf-announcement-enter-y: 0;
    --tf-announcement-leave-x: 100%;
    --tf-announcement-leave-y: 0;
}

.tf-announcement-rotator__viewport {
    position: relative;
    width: 100%;
    min-width: 0;
    height: 1.5em;
    overflow: hidden;
}

.tf-announcement-rotator__item {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    color: var(--tf-marquee-color, currentColor);
    font-size: clamp(11px, 1vw, 14px);
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.14em;
    text-align: center;
    text-transform: uppercase;
    opacity: 0;
    pointer-events: none;
    transform: translate(var(--tf-announcement-enter-x), var(--tf-announcement-enter-y));
    transition:
        transform var(--tf-announcement-transition, 500ms) cubic-bezier(0.4, 0, 0.2, 1),
        opacity var(--tf-announcement-transition, 500ms) ease;
    will-change: transform, opacity;
}

.tf-announcement-rotator__text {
    width: 100%;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-align: inherit;
    text-overflow: ellipsis;
    text-transform: inherit;
    white-space: nowrap;
}

.tf-announcement-rotator__item.is-active {
    z-index: 2;
    opacity: 1;
    pointer-events: auto;
    transform: translate(0, 0);
}

.tf-announcement-rotator__item.is-leaving {
    z-index: 1;
    opacity: 0;
    transform: translate(var(--tf-announcement-leave-x), var(--tf-announcement-leave-y));
}

.tf-section.tf-has-section-height[data-tf-type="home.marquee"] .tf-marquee-style--5 .tf-announcement-rotator__viewport,
.tf-section.tf-has-section-height[data-tf-type="layout.footer"] .tf-marquee-style--5 .tf-announcement-rotator__viewport {
    flex: 0 0 auto;
    width: 100%;
}

/* A merchant-defined section height must centre the active style without
 * retaining the legacy plugin's negative bottom margin. */
.tf-section.tf-has-section-height[data-tf-type="home.marquee"] .tf-marquee-style:not(.tf-marquee-style--3-row),
.tf-section.tf-has-section-height[data-tf-type="layout.footer"] .tf-marquee-style:not(.tf-marquee-style--3-row) {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--tf-marquee-height);
    min-height: 0 !important;
    max-height: var(--tf-marquee-height);
    padding-block: 0 !important;
}

.tf-section.tf-has-section-height[data-tf-type="home.marquee"] .tf-marquee-style--3 {
    flex-direction: column;
}

.tf-section.tf-has-section-height[data-tf-type="home.marquee"] .tf-marquee-style:not(.tf-marquee-style--3-row) > .infiniteslide_wrap,
.tf-section.tf-has-section-height[data-tf-type="home.marquee"] .tf-marquee-style:not(.tf-marquee-style--3-row) > .infiniteSlide-wrapper,
.tf-section.tf-has-section-height[data-tf-type="layout.footer"] .tf-marquee-style:not(.tf-marquee-style--3-row) > .infiniteslide_wrap,
.tf-section.tf-has-section-height[data-tf-type="layout.footer"] .tf-marquee-style:not(.tf-marquee-style--3-row) > .infiniteSlide-wrapper {
    flex: 0 0 auto;
    width: 100%;
}

/* The topbar supplies its own compact row dimensions. All variants must
 * remain inside that column instead of applying their full homepage spacing. */
.tf-section[data-tf-type="layout.topbar"] .tf-section[data-tf-type="home.marquee"] .tf-marquee-style,
.tf-zone--header > .tf-section[data-tf-type="structural.row"]:has(.tf-section[data-tf-type="layout.topbar"])
    .tf-section[data-tf-type="home.marquee"] .tf-marquee-style {
    padding-block: 0 !important;
}

.tf-section[data-tf-type="layout.topbar"] .tf-section[data-tf-type="home.marquee"] .tf-marquee-style--3,
.tf-zone--header > .tf-section[data-tf-type="structural.row"]:has(.tf-section[data-tf-type="layout.topbar"])
    .tf-section[data-tf-type="home.marquee"] .tf-marquee-style--3 {
    gap: 2px;
}

@media (max-width: 767.98px) {
    .tf-marquee-style {
        --tf-mq-gap: 10px;
    }

    .tf-marquee-style--1 {
        padding-block: 14px;
    }

    .tf-marquee-style--1 .infiniteSlide-item > p {
        font-size: clamp(30px, 10vw, 48px);
    }

    .tf-marquee-style--2 {
        padding-block: 8px;
    }

    .tf-marquee-style--2 .tf-marquee-ticker-text {
        font-size: 11px;
        letter-spacing: 0.14em;
    }

    .tf-marquee-style--3 {
        gap: 4px;
        padding-block: 16px;
    }

    .tf-marquee-style--3-row .infiniteSlide-item > p {
        font-size: clamp(20px, 6.5vw, 30px);
    }

    .tf-marquee-style--4 {
        --tf-mq-pill-pad-y: 0.55rem;
        --tf-mq-pill-pad-x: 1rem;
        padding-block: 16px;
    }

    .tf-marquee-style--4 .tf-marquee-pill-text {
        font-size: 12px;
    }

    .tf-announcement-rotator__item {
        font-size: 11px;
        letter-spacing: 0.1em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tf-announcement-rotator__item {
        transition-duration: 0.01ms !important;
    }
}
