/* Homepage only: a slim dark banner above the header pointing to the "Introducing Altigrid" post
   (design-refs/blog-prompt.png). The close button hides it for the rest of the visit; it comes back on the
   next visit (static/promo-banner.js; the inline script in index.html's head hides it before the first paint). */

:root {
    --promo-banner-h: 3.25rem; /* 52px, its usual height, until static/promo-banner.js measures it; the hero subtracts it */
}

html.promo-dismissed {
    --promo-banner-h: 0px;
}

html.promo-dismissed .promo-banner {
    display: none;
}

.promo-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3rem;
    padding: 0.25rem max(var(--gutter), env(safe-area-inset-right)) 0.25rem max(var(--gutter), env(safe-area-inset-left));
    background: #1c1c1f;
    color: #ffffff;
    font-family: "Geist", sans-serif;
    font-size: 0.875rem; /* 14px on phones, 15px from 768px */
    line-height: 1.4;
    letter-spacing: 0;
}

@media (min-width: 768px) {
    .promo-banner {
        min-height: 3.25rem;
        font-size: 0.9375rem;
    }
}

.promo-banner__text {
    margin: 0;
    padding-block: 0.5rem;
    overflow-wrap: anywhere;
}

/* White and underlined; on hover the text and its underline turn grey together, nothing else */
.promo-banner__text a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
    .promo-banner__text a:hover {
        color: #a3a3a3;
    }
}

.promo-banner__text a:focus-visible,
.promo-banner__close:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

/* Close: a small X with a 44px tap area */
.promo-banner__close {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-right: -0.75rem; /* the X itself lines up with the gutter */
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .promo-banner__close:hover {
        color: #ffffff;
    }
}

@media (hover: none) {
    .promo-banner__close:active {
        opacity: 0.6;
    }
}

/* The phone menu fills the screen under the header, so the banner steps aside while it's open */
body.menu-open .promo-banner {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .promo-banner__close {
        transition: none;
    }
}
