/* ============================================
   News Banner — sticky top-bar carousel
   Shown above the fixed site-header on home page.
   ============================================ */

/* Banner container — fixed at very top, above the site-header (z 9999) */
.news-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 76px;
    z-index: 10001;
    background: linear-gradient(90deg, rgba(13, 24, 33, 0.98) 0%, rgba(19, 31, 43, 0.98) 100%);
    border-bottom: 1px solid rgba(0, 217, 126, 0.35);
    box-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.news-banner.is-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.news-banner__inner {
    position: relative;
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 12px 0 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Slides track */
.news-banner__track {
    position: relative;
    flex: 1;
    height: 100%;
    min-width: 0;
}

.news-banner__slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateX(12px);
    transition: opacity 0.45s ease, transform 0.45s ease;
    pointer-events: none;
}

.news-banner__slide.is-active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.news-banner__link {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    /* Visual order: text on the left, image (slide) on the right — so the
       image sits next to the close button, text next to the CTA button. */
    flex-direction: row-reverse;
}

.news-banner__img {
    height: calc(100% - 8px);
    width: auto;
    max-width: 240px;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 217, 126, 0.2);
}

.news-banner__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.news-banner__tag {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #00d97e;
    text-shadow: 0 0 8px rgba(0, 217, 126, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-banner__title {
    font-size: 17px;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* All 5 slides use the same tag/title size — the lead/announcement slide
   no longer gets a separate larger size. The is-lead class is kept on the
   first slide for semantic/tracking purposes only. */

/* CTA button — compact green site-style button on the left, next to the slide track.
   Its href is synced to the active slide by news-banner.js.
   Kept minimal: small padding but font-size preserved for readability. */
.news-banner__cta-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    min-height: 28px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    color: #0c1a14;
    background: linear-gradient(135deg, #00d97e 0%, #00a35f 100%);
    border: 1px solid rgba(0, 217, 126, 0.5);
    box-shadow: 0 2px 8px rgba(0, 217, 126, 0.2);
    transition: all 0.2s ease;
    cursor: pointer;
}

.news-banner__cta-btn:hover {
    background: linear-gradient(135deg, #00f08c 0%, #00d97e 100%);
    box-shadow: 0 0 16px rgba(0, 217, 126, 0.55), 0 2px 10px rgba(0, 217, 126, 0.35);
    transform: translateY(-1px);
    color: #0a1410;
}

.news-banner__cta-btn:active {
    transform: translateY(0);
}

/* Dots */
.news-banner__dots {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}

.news-banner__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.news-banner__dot.is-active {
    background: #00d97e;
    transform: scale(1.25);
    box-shadow: 0 0 6px rgba(0, 217, 126, 0.7);
}

.news-banner__dot:hover {
    background: rgba(0, 217, 126, 0.6);
}

/* Close button — flex item to the right of the CTA button */
.news-banner__close {
    flex-shrink: 0;
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.news-banner__close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Layout shifts: push the fixed site-header down
   by the banner height and add the banner height
   to the body padding-top on the home page.
   These only apply while the banner is visible.
   ============================================ */
body.home-page.has-news-banner .site-header {
    top: 76px !important;
}

body.home-page.has-news-banner {
    padding-top: 146px !important;
}

/* ============================================
   Mobile: compact text-only bar (image hidden)
   ============================================ */
@media (max-width: 768px) {
    .news-banner {
        height: 64px;
    }
    .news-banner__img {
        display: none;
    }
    .news-banner__inner {
        padding: 0 12px 0 12px;
        gap: 8px;
    }
    .news-banner__title {
        font-size: 16px;
        white-space: normal;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .news-banner__tag {
        font-size: 12px;
    }
    /* Hide the CTA button on mobile — the whole slide is clickable via the link */
    .news-banner__cta-btn {
        display: none;
    }
    body.home-page.has-news-banner .site-header {
        top: 64px !important;
    }
    body.home-page.has-news-banner {
        padding-top: 184px !important;
    }
}

/* RTL (Farsi) — mirror the layout */
[dir="rtl"] .news-banner__inner {
    padding: 0 16px 0 12px;
    flex-direction: row-reverse;
}
/* In RTL, compensate the base row-reverse so the image stays on the leading
   (right) side and the text on the trailing (left) side, matching the
   right-to-left reading direction. */
[dir="rtl"] .news-banner__link {
    flex-direction: row;
}
