/* ==========================================================================
   FCC Announcement Ticker — Front-end Styles v2.0.0
   ========================================================================== */

/* -------------------------------------------------------------------------
   Shared banner base
   ------------------------------------------------------------------------- */
.fcc-at-banner {
    position: relative;
    overflow: hidden;
    line-height: 1.4;
    box-sizing: border-box;
    width: 100%;
    max-height: 200px; /* initial max-height for dismiss animation */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fcc-at-banner--visible {
    opacity: 1;
}

/* -------------------------------------------------------------------------
   Static banners (inline, placed where shortcode is)
   ------------------------------------------------------------------------- */
.fcc-at-banner--static {
    margin: 0;
    padding: 10px 16px;
}

/* -------------------------------------------------------------------------
   Floating banners (fixed to viewport top)
   ------------------------------------------------------------------------- */
#fcc-at-float-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    pointer-events: none;
}

.fcc-at-banner--float {
    position: relative;
    left: 0;
    right: 0;
    z-index: 99999;
    padding: 10px 16px;
    pointer-events: auto;
}

/* -------------------------------------------------------------------------
   Track — the scrolling / centering container
   ------------------------------------------------------------------------- */
.fcc-at-banner__track {
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    width: 100%;
}

/* ---- Non-scrolling: center the text ---- */
.fcc-at-banner:not(.fcc-at-banner--scrolling) .fcc-at-banner__track {
    justify-content: center;
}

/* ---- Scrolling: ticker animation ---- */
.fcc-at-banner--scrolling .fcc-at-banner__track {
    overflow: visible;
    width: max-content;
    animation: fcc-at-ticker-scroll var(--fcc-at-duration, 10s) linear infinite;
    will-change: transform;
}

/* Pause on hover / focus-within */
.fcc-at-banner--scrolling .fcc-at-banner__track:hover,
.fcc-at-banner--scrolling .fcc-at-banner__track:focus-within {
    animation-play-state: paused;
}

/* -------------------------------------------------------------------------
   Text
   ------------------------------------------------------------------------- */
.fcc-at-banner__text {
    display: inline-block;
    padding-right: 80px; /* gap between clones in ticker mode */
}

/* Non-scrolling: centered, wrapping text with no extra padding */
.fcc-at-banner:not(.fcc-at-banner--scrolling) .fcc-at-banner__text {
    padding-right: 0;
    display: block;
    text-align: center;
    white-space: normal;
    overflow: visible;
}

/* -------------------------------------------------------------------------
   Link styling
   ------------------------------------------------------------------------- */
.fcc-at-banner__link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.fcc-at-banner__link:hover {
    text-decoration: underline;
}

/* In scrolling mode, link must be inline to flow with the track */
.fcc-at-banner--scrolling .fcc-at-banner__link {
    display: inline;
}

/* Non-scrolling link: center its block contents */
.fcc-at-banner:not(.fcc-at-banner--scrolling) .fcc-at-banner__link {
    display: block;
    text-align: center;
}

/* -------------------------------------------------------------------------
   Dismiss (close) button
   ------------------------------------------------------------------------- */
.fcc-at-banner__close {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    padding: 0;
    z-index: 1;
}

.fcc-at-banner__close:hover,
.fcc-at-banner__close:focus-visible {
    background: rgba(0, 0, 0, 0.35);
    outline: none;
}

/* -------------------------------------------------------------------------
   Dismiss animation
   ------------------------------------------------------------------------- */
.fcc-at-banner--dismissing {
    transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.3s ease;
    max-height: 0 !important;
    opacity: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
}

/* -------------------------------------------------------------------------
   Placeholder slot (hidden when empty)
   ------------------------------------------------------------------------- */
.fcc-at-slot:empty {
    display: none;
}

/* -------------------------------------------------------------------------
   Ticker keyframes
   ------------------------------------------------------------------------- */
@keyframes fcc-at-ticker-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* -------------------------------------------------------------------------
   Reduced motion preference
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .fcc-at-banner--scrolling .fcc-at-banner__track {
        animation: none;
        overflow: hidden;
        width: 100%;
    }

    .fcc-at-banner--scrolling .fcc-at-banner__text {
        padding-right: 0;
        white-space: normal;
        text-align: center;
    }
}
