/**
 * OGB Top Slider — Front office styles.
 *
 * Uses CSS custom properties for dynamic theming from module configuration.
 * Swiper handles all carousel mechanics (slide/fade transitions, a11y, autoplay).
 */

/* -------------------------------------------------------------------- */
/*  ROOT VARIABLES (defaults)                                            */
/* -------------------------------------------------------------------- */

.ps-top-slider {
    --ogb-top-slider-bg: #00a859;
    --ogb-top-slider-color: #ffffff;
    --ogb-top-slider-height: 44px;
    --ogb-top-slider-speed: 500ms;

    position: relative;
    min-height: var(--ogb-top-slider-height);
    height: auto !important;  /* let content set height, not Swiper */
    background-color: var(--ogb-top-slider-bg);
    color: var(--ogb-top-slider-color);
    overflow: hidden;
    z-index: 100;
    font-size: 15px;
    line-height: 1.4;
    width: 600px;
    max-width: 100%;
}

#header .header-nav .ps-top-slider {
    margin-top: -0.5714285714rem;
    margin-bottom: -0.5714285714rem;
}

/* -------------------------------------------------------------------- */
/*  SWIPER OVERRIDES                                                     */
/* -------------------------------------------------------------------- */

.ps-top-slider .swiper-wrapper {
    min-height: var(--ogb-top-slider-height);
}

.ps-top-slider .swiper-slide {
    min-height: var(--ogb-top-slider-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

/* -------------------------------------------------------------------- */
/*  MARQUEE MODE — continuous scroll, no arrows / play-pause            */
/* -------------------------------------------------------------------- */

.ps-top-slider[data-mode="marquee"] {
    width: 100%;
    mask-image: linear-gradient(to right,
                transparent 0%,
                white 10%,
                white 90%,
                transparent 100%);
}

/* Track is duplicated (JS) and animated via an inline `animation` shorthand
   pointing at a one-off @keyframes rule injected per instance. */
.ps-top-slider[data-mode="marquee"] .swiper-wrapper.ps-marquee-track {
    display: flex;
    width: max-content;
    will-change: transform;
}

.ps-top-slider[data-mode="marquee"]:hover .swiper-wrapper.ps-marquee-track {
    animation-play-state: paused;
}

.ps-top-slider[data-mode="marquee"] .swiper-slide {
    width: auto;
    flex-shrink: 0;
    justify-content: flex-start;
    white-space: nowrap;
    margin: 0 40px;
    position: relative;
}

/* Separator dot centered in the gap between two consecutive slides. */
.ps-top-slider[data-mode="marquee"] .swiper-slide::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -40px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    opacity: 0.6;
    transform: translate(50%, -50%);
}

.ps-top-slider[data-mode="marquee"] .ps-top-slide-content {
    width: auto;
    white-space: nowrap;
}

/* -------------------------------------------------------------------- */
/*  CONTENT                                                              */
/* -------------------------------------------------------------------- */

.ps-top-slide-link {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
}

.ps-top-slide-link:hover,
.ps-top-slide-link:focus {
    color: inherit !important;
    text-decoration: none;
}

.ps-top-slide-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    width: 100%;
    min-height: var(--ogb-top-slider-height);
}

/* -------------------------------------------------------------------- */
/*  ICON                                                                 */
/* -------------------------------------------------------------------- */

.ps-top-slide-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.ps-top-slide-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* -------------------------------------------------------------------- */
/*  TEXT                                                                 */
/* -------------------------------------------------------------------- */

.ps-top-slide-text {
    display: inline;
    font-weight: 500;
}

.ps-top-slide-text p {
    margin: 0;
    padding: 0;
}

.ps-top-slide-text a {
    color: inherit;
    text-decoration: underline;
}

/* -------------------------------------------------------------------- */
/*  CONTROLS (arrows + play/pause)                                       */
/* -------------------------------------------------------------------- */

.ps-top-slider-prev,
.ps-top-slider-next,
.ps-top-slider-playpause {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.ps-top-slider-prev::after,
.ps-top-slider-next::after {
    content: none !important;  /* kill Swiper's default arrow icons */
}

.ps-top-slider-prev:hover,
.ps-top-slider-next:hover,
.ps-top-slider-playpause:hover,
.ps-top-slider-prev:focus-visible,
.ps-top-slider-next:focus-visible,
.ps-top-slider-playpause:focus-visible {
    opacity: 1;
    /*outline: 2px solid currentColor;
    outline-offset: 2px;*/
}

.ps-top-slider-prev {
    left: 8px;
}

.ps-top-slider-next {
    right: 8px;
}

.ps-top-slider-playpause {
    right: 36px;
}

/* -------------------------------------------------------------------- */
/*  RESPONSIVE                                                           */
/* -------------------------------------------------------------------- */

@media (max-width: 768px) {
    .ps-top-slider {
        font-size: 0.82rem;
        width: 500px;
    }

    .ps-top-slide-content {
        padding: 0 8px;
        gap: 6px;
    }

    .ps-top-slide-icon {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .ps-top-slider {
        font-size: 0.9rem;
        width: 100%;
    }

    .ps-top-slide-text strong {
        font-weight: 600;
    }
}
