/* BWA Announcement Bar */
.bwa-announcement-bar {
    /* Resolution chain per role, highest precedence first, resolved into
       DISTINCT --ab-* locals:
         1. AI Assist short token (--bg / --text / --accent / --link /
            --link-hover) injected by a live "recolor" expression.
         2. Live BrandCorpus inheritance — the :root `--bwa-announcement-bar-*`
            vars emitted by BrandCorpusController.WriteBrandCorpusCssFile from
            this manifest's brandInheritance map (e.g.
            --bwa-announcement-bar-bg → var(--bwa-color-primary)).
         3. Plugin default hex fallback.
       IMPORTANT: do NOT redeclare --bwa-announcement-bar-* here referencing
       itself (`--bwa-announcement-bar-bg: var(--bg, var(--bwa-announcement-bar-bg,..))`).
       A custom property that references itself is a CYCLE and computes to the
       guaranteed-invalid value (renders transparent). The corpus var must be
       referenced only as the middle fallback of a DISTINCT local var. */
    --ab-bg:         var(--bg,         var(--bwa-announcement-bar-bg, #ffd700));
    --ab-text:       var(--text,       var(--bwa-announcement-bar-text, #333333));
    --ab-accent:     var(--accent,     var(--bwa-announcement-bar-accent, var(--ab-text)));
    --ab-link:       var(--link,       var(--bwa-announcement-bar-link, var(--ab-text)));
    --ab-link-hover: var(--link-hover, var(--bwa-announcement-bar-link-hover, var(--ab-link)));

    background-color: var(--ab-bg);
    color: var(--ab-text);
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
    padding: 10px 24px;
    /* --ab-font-* are set by the dialog-driven modifier classes below; each
       falls back to the prior default so an unconfigured bar is unchanged. */
    font-family: var(--ab-font-family, var(--bwa-font-body, inherit));
    font-size: var(--ab-font-size, 14px);
    font-weight: var(--ab-font-weight, 400);
    line-height: 1.5;
    box-sizing: border-box;
    transition: transform 0.4s ease, opacity 0.4s ease, max-height 0.4s ease;
    max-height: 200px;
    overflow: hidden;
}

.bwa-announcement-bar--visible {
    opacity: 1;
    transform: translateY(0);
}

.bwa-announcement-bar--dismissing {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    transform: translateY(-100%);
}

.bwa-announcement-bar__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 16px;
}

.bwa-announcement-bar__message {
    flex: 1;
    text-align: center;
    margin: 0;
}

.bwa-announcement-bar__link {
    color: var(--ab-link);
    font-weight: 600;
    text-decoration: underline;
    margin-left: 8px;
    white-space: nowrap;
}

.bwa-announcement-bar__link:hover {
    color: var(--ab-link-hover);
}

/* Defends the Learn More link against tenant CSS that targets generic
   anchors or button classes:
     - Typography (font-size, font-weight) bleeds inflate the link past
       the bar's 14px/600 intent.
     - Hover button rules (`.btn:hover{background:#X !important}` in
       tenant custom.css) add pill backgrounds and padding.
   Stacked class names raise specificity to (0,4,1); paired with
   !important this beats anything short of inline style or an ID-laden
   selector. Re-asserts the plugin's own visual intent so it survives
   the cascade in any tenant. */
.bwa-announcement-bar.bwa-announcement-bar a.bwa-announcement-bar__link,
.bwa-announcement-bar.bwa-announcement-bar a.bwa-announcement-bar__link:hover,
.bwa-announcement-bar.bwa-announcement-bar a.bwa-announcement-bar__link:focus,
.bwa-announcement-bar.bwa-announcement-bar a.bwa-announcement-bar__link:active {
    background: transparent !important;            /* bwa-allow-important: defend against tenant a{} button-fill bleed */
    background-color: transparent !important;      /* bwa-allow-important: defend against tenant a{} button-fill bleed */
    padding: 0 !important;                          /* bwa-allow-important: defend against tenant a{} padding bleed */
    border: 0 !important;                           /* bwa-allow-important: defend against tenant a{} border bleed */
    border-radius: 0 !important;                    /* bwa-allow-important: defend against tenant a{} border-radius bleed */
    box-shadow: none !important;                    /* bwa-allow-important: defend against tenant a{} box-shadow bleed */
    transform: none !important;                     /* bwa-allow-important: defend against tenant a:hover{} transform bleed */
    font-size: inherit !important;                  /* bwa-allow-important: defend against brand-corpus a{font-size:1.4rem} bleed */
    font-weight: 600 !important;                    /* bwa-allow-important: re-assert plugin's link weight against tenant a{font-weight} bleed */
    line-height: inherit !important;                /* bwa-allow-important: defend against tenant a{line-height} bleed */
    text-decoration: underline !important;          /* bwa-allow-important: re-assert plugin's link underline against tenant a{text-decoration:none} bleed */
    text-transform: none !important;                /* bwa-allow-important: defend against tenant a{text-transform:uppercase} bleed */
    letter-spacing: normal !important;              /* bwa-allow-important: defend against tenant a{letter-spacing} bleed */
}

.bwa-announcement-bar__close {
    background: none;
    border: none;
    color: var(--ab-accent);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.bwa-announcement-bar__close:hover {
    opacity: 1;
}

.bwa-announcement-bar__close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .bwa-announcement-bar {
        padding: 8px 16px;
        /* Respect an explicit custom size on mobile too; only the default
           shrinks to 13px. */
        font-size: var(--ab-font-size, 13px);
    }

    .bwa-announcement-bar__inner {
        gap: 8px;
    }
}

/* ─────────────────────────────────────────────────────────────────────
   Native presentation settings (dialog-driven). Each modifier class is
   emitted by the render only when the editor picks a non-default value,
   so an unconfigured bar renders exactly as before. Font family/size/
   weight set DISTINCT --ab-* locals consumed by the .bwa-announcement-bar
   root rule above.
   ───────────────────────────────────────────────────────────────────── */

/* Font family */
.bwa-announcement-bar--font-heading { --ab-font-family: var(--bwa-font-heading, inherit); }
.bwa-announcement-bar--font-sans    { --ab-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.bwa-announcement-bar--font-serif   { --ab-font-family: Georgia, Cambria, "Times New Roman", Times, serif; }
.bwa-announcement-bar--font-mono    { --ab-font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace; }

/* Font size */
.bwa-announcement-bar--size-12 { --ab-font-size: 12px; }
.bwa-announcement-bar--size-13 { --ab-font-size: 13px; }
.bwa-announcement-bar--size-14 { --ab-font-size: 14px; }
.bwa-announcement-bar--size-16 { --ab-font-size: 16px; }
.bwa-announcement-bar--size-18 { --ab-font-size: 18px; }
.bwa-announcement-bar--size-20 { --ab-font-size: 20px; }
.bwa-announcement-bar--size-24 { --ab-font-size: 24px; }

/* Font weight */
.bwa-announcement-bar--weight-medium   { --ab-font-weight: 500; }
.bwa-announcement-bar--weight-semibold { --ab-font-weight: 600; }
.bwa-announcement-bar--weight-bold     { --ab-font-weight: 700; }

/* Message / button alignment (center is the default — no class needed) */
.bwa-announcement-bar--align-left  .bwa-announcement-bar__message { text-align: left; }
.bwa-announcement-bar--align-right .bwa-announcement-bar__message { text-align: right; }

/* Button placement: pinned to the right edge of the bar */
.bwa-announcement-bar--place-pinned .bwa-announcement-bar__message {
    display: flex;
    align-items: center;
    gap: 12px;
}
.bwa-announcement-bar--place-pinned .bwa-announcement-bar__link {
    margin-left: auto;
}

/* Button placement: on its own row beneath the message (centered by default) */
.bwa-announcement-bar--place-row .bwa-announcement-bar__message {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}
.bwa-announcement-bar--place-row.bwa-announcement-bar--align-left  .bwa-announcement-bar__message { align-items: flex-start; }
.bwa-announcement-bar--place-row.bwa-announcement-bar--align-right .bwa-announcement-bar__message { align-items: flex-end; }

/* ─────────────────────────────────────────────────────────────────────
   Button styles. The text-link defense block above hard-pins the link to a
   plain underlined link at specificity (0,3,1). When the
   editor chooses a button look, each rule carries one extra class
   (.--btn-*) to raise specificity to (0,4,1) — above the defense — and
   re-pins every property the defense zeroes, turning the link into a real
   button. --ab-btn-bg / --ab-btn-text come from the inline style on the
   root and fall back to the bar accent / white.
   ───────────────────────────────────────────────────────────────────── */
.bwa-announcement-bar.bwa-announcement-bar a.bwa-announcement-bar__link.bwa-announcement-bar__link--btn-solid,
.bwa-announcement-bar.bwa-announcement-bar a.bwa-announcement-bar__link.bwa-announcement-bar__link--btn-pill {
    background-color: var(--ab-btn-bg, var(--ab-accent)) !important;   /* bwa-allow-important: override the text-link defense to fill a button */
    color: var(--ab-btn-text, #ffffff) !important;                     /* bwa-allow-important: override the text-link defense button text */
    padding: 6px 18px !important;                                      /* bwa-allow-important: button needs the padding the link defense zeroes */
    border: 0 !important;                                              /* bwa-allow-important: re-assert no border for a filled button */
    text-decoration: none !important;                                  /* bwa-allow-important: a button is not underlined */
    font-weight: 600 !important;                                       /* bwa-allow-important: re-assert button weight over the defense */
}
.bwa-announcement-bar.bwa-announcement-bar a.bwa-announcement-bar__link.bwa-announcement-bar__link--btn-solid { border-radius: 6px !important; }   /* bwa-allow-important: button needs the radius the link defense zeroes */
.bwa-announcement-bar.bwa-announcement-bar a.bwa-announcement-bar__link.bwa-announcement-bar__link--btn-pill  { border-radius: 999px !important; } /* bwa-allow-important: pill radius over the link defense */

.bwa-announcement-bar.bwa-announcement-bar a.bwa-announcement-bar__link.bwa-announcement-bar__link--btn-outline {
    background-color: transparent !important;                          /* bwa-allow-important: outline button has no fill */
    color: var(--ab-btn-bg, var(--ab-link)) !important;               /* bwa-allow-important: outline text uses the button color */
    padding: 5px 17px !important;                                      /* bwa-allow-important: button padding over the link defense */
    border: 2px solid var(--ab-btn-bg, currentColor) !important;       /* bwa-allow-important: outline border over the link defense */
    border-radius: 6px !important;                                     /* bwa-allow-important: button radius over the link defense */
    text-decoration: none !important;                                  /* bwa-allow-important: a button is not underlined */
    font-weight: 600 !important;                                       /* bwa-allow-important: re-assert button weight over the defense */
}

/* Button hover: subtle darken for filled, fill-in for outline. */
.bwa-announcement-bar.bwa-announcement-bar a.bwa-announcement-bar__link.bwa-announcement-bar__link--btn-solid:hover,
.bwa-announcement-bar.bwa-announcement-bar a.bwa-announcement-bar__link.bwa-announcement-bar__link--btn-pill:hover {
    filter: brightness(0.93);
}
.bwa-announcement-bar.bwa-announcement-bar a.bwa-announcement-bar__link.bwa-announcement-bar__link--btn-outline:hover {
    background-color: var(--ab-btn-bg, var(--ab-link)) !important;     /* bwa-allow-important: outline fills on hover over the link defense */
    color: var(--ab-btn-text, #ffffff) !important;                    /* bwa-allow-important: outline hover text over the link defense */
}
