/* ============================================================================
 * PWA install smart banner
 * ----------------------------------------------------------------------------
 * Renders at the very top of the page, just below the fixed-height navbar,
 * pushing site content down by its own height. Mobile-only, dismissible,
 * and self-hides if the user already installed the PWA. See companion JS
 * file (pwa-install-banner.js) for the show/hide policy.
 * ========================================================================== */

.pwa-install-banner {
    /* Positioned in normal flow (not sticky), so it scrolls away naturally
       and never competes with bottom-of-screen browser UI on iOS Safari. */
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    color: #111827;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    padding: 0.5rem 0;
}

.pwa-install-banner__inner {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.pwa-install-banner__left {
    align-items: center;
    color: inherit;
    display: flex;
    flex: 1 1 auto;
    gap: 0.75rem;
    min-width: 0;
    text-decoration: none;
}

.pwa-install-banner__left:hover,
.pwa-install-banner__left:focus {
    color: inherit;
    text-decoration: none;
}

.pwa-install-banner__left:focus-visible {
    border-radius: 4px;
    outline: 2px solid #00a651;
    outline-offset: 2px;
}

.pwa-install-banner__icon {
    border-radius: 8px;
    flex: 0 0 auto;
    height: 40px;
    width: 40px;
}

.pwa-install-banner__copy {
    flex: 1 1 auto;
    line-height: 1.25;
    min-width: 0;
}

.pwa-install-banner__title {
    color: #111827;
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pwa-install-banner__subtitle {
    color: #6b7280;
    display: block;
    font-size: 0.8rem;
    margin-top: 0.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pwa-install-banner__right {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 0.25rem;
}

.pwa-install-banner__cta {
    background: #00a651;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 0.9rem;
    text-decoration: none;
    transition: background 120ms ease;
    white-space: nowrap;
}

.pwa-install-banner__cta:hover,
.pwa-install-banner__cta:focus {
    background: #008a44;
    color: #ffffff;
    text-decoration: none;
}

.pwa-install-banner__close {
    background: transparent;
    border: 0;
    border-radius: 4px;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
}

.pwa-install-banner__close:hover {
    color: #111827;
}

/* :focus-visible (keyboard focus only) gets an explicit visible ring so
   keyboard users can see where they are. Mouse-click focus does NOT get
   the ring (browsers handle :focus-visible heuristics). Previously this
   block used `outline: none` which was an accessibility regression
   flagged in PR #98 review — never blanket-remove the focus indicator
   without supplying a replacement. */
.pwa-install-banner__close:focus-visible {
    color: #111827;
    outline: 2px solid #00a651;
    outline-offset: 2px;
}

/* ----------------------------------------------------------------------------
 * Visibility policy
 * ----------------------------------------------------------------------------
 * Three independent reasons the banner must NOT show:
 *   1. Desktop / tablet  — installing the PWA there is an edge case and the
 *      banner would steal attention from primary CTAs.
 *   2. Already installed — `display-mode: standalone` (Chrome/Edge/Android)
 *      and `navigator.standalone` (iOS Safari) both indicate the page is
 *      being viewed AS the installed app; obviously redundant to ask
 *      someone to install something they already have.
 *   3. User dismissed   — handled by JS via localStorage.
 *
 * We use CSS `display: none` for #1 and #2 (cheap, applies before JS runs,
 * so no flicker on desktop). #3 is JS-only because localStorage isn't a
 * media query.
 *
 * Tablet breakpoint matches Bootstrap's md (768px) used elsewhere on the
 * site — keep it in lockstep with the existing layout.
 * ========================================================================== */

@media (min-width: 768px) {
    .pwa-install-banner {
        display: none !important;
    }
}

@media (display-mode: standalone) {
    .pwa-install-banner {
        display: none !important;
    }
}
