/* announcement.css — slim top bar above the floating nav. Tokens only. */
.announce {
    position: relative;
    z-index: 51;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    min-height: 40px;
    padding: var(--space-2) var(--space-10) var(--space-2) var(--space-4);
    background: var(--banner-bg);
    border-bottom: 1px solid var(--accent);
    color: var(--banner-ink);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    line-height: 1.3;
    text-align: center;
}
.announce-text { color: inherit; text-decoration: none; }
.announce-text:hover,
.announce-text:focus-visible { text-decoration: underline; text-underline-offset: 3px; outline: none; }
.announce-sep {
    flex: none;
    width: 1px;
    height: 1.1em;
    background: currentColor;
    opacity: 0.55;
}
.announce-cta {
    flex: none;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.02em;
    white-space: nowrap;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--bg);
    transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.announce-cta:hover,
.announce-cta:focus-visible {
    box-shadow: 0 0 16px 2px var(--accent-glow);
    transform: translateY(-1px);
    outline: none;
}
.announce-close {
    position: absolute;
    right: var(--space-2);
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: inherit;
    font-size: var(--text-lg);
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
}
.announce-close:hover,
.announce-close:focus-visible { opacity: 1; background: var(--accent-soft); outline: none; }

.announce-short { display: none; }

/* Phones: the primary audience. One slim row, 44px tall when the text is on
   one line: centred 13px copy, a round 28px arrow and a 32px close on the
   right (the whole sentence is a link too, so the arrow is only a cue). The
   JSON's `mobileText` is short enough for one line at the usual text sizes;
   past that it wraps to as many lines as it needs, up to four, rather than
   being cut off (Android's font size setting scales this text, and the full
   sentence used to lose its end). base.css holds 44px for the bar before it
   exists (--banner-reserve), so keep the two in step. */
@media (max-width: 720px) {
    .announce {
        justify-content: flex-start;
        gap: var(--space-2);
        min-height: 44px;
        /* Centred on the screen like the hero heading below it. The arrow and
           the close button sit on the right, so the left padding mirrors the
           space they take (gap + 28px arrow + gap + 32px close), which puts
           the text column's middle on the screen's middle. */
        padding: var(--space-1) 0 var(--space-1) calc(var(--space-2) + 28px + var(--space-2) + 32px);
        font-size: calc(var(--text-sm) - 1px);
        line-height: 1.35;
        text-align: center;
    }
    .announce-text {
        flex: 1;
        min-width: 0;
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-wrap: balance; /* if it wraps: even lines, not a long one and a stub */
    }
    .announce--has-short .announce-full { display: none; }
    .announce--has-short .announce-short { display: inline; }
    .announce-sep,
    .announce-cta-label { display: none; }
    .announce-cta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        padding: 0;
        border-radius: 50%;
        font-size: var(--text-sm);
    }
    .announce-close {
        position: static;
        transform: none;
        flex: none;
        width: 32px;
        height: 32px;
        margin: 0;
    }
}
@media (prefers-reduced-motion: no-preference) {
    .announce { animation: announce-in var(--dur-slow) var(--ease-out) both; }
    @keyframes announce-in { from { opacity: 0; } to { opacity: 1; } }
}
