/* Announcement bar — dark, RTL, responsive. Sits directly below the site header.
   Loaded only when at least one announcement is active. */

.announcement-bar {
    position: relative;
    z-index: 1000; /* header is 1001 — never cover the navbar */
    width: 100%;
    box-sizing: border-box;
    direction: rtl;
    font-family: inherit;
    line-height: 1.6;
    margin-top: var(--announcement-bar-top, var(--site-header-height, 90px));
}

@media (max-width: 991px) {
    .announcement-bar {
        margin-top: 0;
    }
}

.announcement-bar__slide {
    display: none;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 1.1rem;
    padding-inline-end: 3rem; /* leave room for the close button */
    min-height: 44px;
    box-sizing: border-box;
    background: var(--ab-bg, #1a1a2e);
    color: var(--ab-text, #ffffff);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    border-inline-start: 3px solid var(--ab-accent, #cf1f1f);
}

.announcement-bar__slide.is-active {
    display: flex;
    animation: ab-slide-in 0.45s ease;
}

.announcement-bar__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    color: var(--ab-accent, #cf1f1f);
}

.announcement-bar__content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.8rem;
}

.announcement-bar__text {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.92rem;
    color: var(--ab-text, #ffffff);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.announcement-bar__link {
    flex: 0 0 auto;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ab-accent, #cf1f1f);
    text-decoration: none;
    border: 1px solid var(--ab-accent, #cf1f1f);
    border-radius: 999px;
    padding: 0.15rem 0.75rem;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.announcement-bar__link:hover {
    background: var(--ab-accent, #cf1f1f);
    color: #ffffff;
}

.announcement-bar__close {
    position: absolute;
    top: 50%;
    inset-inline-end: 0.6rem;
    transform: translateY(-50%);
    z-index: 2;
    background: none;
    border: none;
    color: var(--ab-text, #ffffff);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem;
    opacity: 0.65;
    transition: opacity 0.2s ease;
}

.announcement-bar__close:hover {
    opacity: 1;
}

.announcement-bar--dismissing {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

@keyframes ab-slide-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .announcement-bar__slide.is-active {
        animation: none;
    }
    .announcement-bar--dismissing {
        transition: none;
    }
}

@media (max-width: 575px) {
    .announcement-bar__slide {
        gap: 0.5rem;
        padding: 0.55rem 0.85rem;
        padding-inline-end: 2.6rem;
    }
    .announcement-bar__text {
        font-size: 0.85rem;
    }
    .announcement-bar__link {
        font-size: 0.8rem;
        padding: 0.1rem 0.6rem;
    }
}