/* v8: extracted from header.php (static, was ~10KB inline on every page) — same cascade position via <link>. */
/* ───────────── HEADER (60/30/10) ─────────────
       60% dominant: white surface + soft neutral canvas
       30% secondary: --primary brand blue (logo pip, search CTA, hover chips)
       10% accent: red/amber notification badges, status pills only */
    :root {
        --hdr-surface: var(--bg-card, #ffffff);
        --hdr-canvas:  var(--bg-body, #eef2f7);
        --hdr-border:  var(--border, #dce0e6);
        --hdr-soft:    var(--primary-soft, #e6f2ff);
        --hdr-ink:     var(--text-main, #2a2a33);
        --hdr-muted:   var(--text-muted, #596b82);
        --hdr-brand:   var(--primary, #006AFF);
        --hdr-brand-d: var(--primary-dark, #0056cf);
        --hdr-radius:  12px;
        --hdr-shadow:  0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
    }
    body { font-family: var(--font-body, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif); }

    header {
        position: sticky;
        top: 0;
        /* Must outrank the property tab nav (.sticky-nav-wrapper, also sticky at
           z-index:100) so the user-menu dropdown inside the header isn't trapped
           below the tab nav's stacking context. */
        z-index: 1000;
        background: rgba(255,255,255,.92);
        backdrop-filter: saturate(180%) blur(12px);
        -webkit-backdrop-filter: saturate(180%) blur(12px);
        border-bottom: 1px solid var(--hdr-border);
        box-shadow: 0 1px 2px rgba(15,23,42,.03);
        /* Stabilize the backdrop-filter on its own compositing layer so it
           repaints cleanly as sticky bars below it pass the top of the scroll.
           Without this Chrome can leave a stale blurred strip over the bar's top
           edge. Kept on the HEADER (not the bar) so any 1px layer-edge artifact
           lands at y:0 / under the header's own border, where it's invisible. */
        transform: translateZ(0);
    }
    header .container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 6px 24px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }

    /* ── LOGO: uses the real site PNG from uploads/assets/logo.png ── */
    .logo-link {
        display: inline-flex;
        align-items: center;
        text-decoration: none;
        color: var(--hdr-ink);
        flex-shrink: 0;
        transition: transform .2s ease, opacity .2s ease;
    }
    .logo-link:hover { transform: translateY(-1px); opacity: .92; }
    .logo-img {
        height: 40px;
        width: auto;
        max-width: 160px;
        object-fit: contain;
        display: block;
    }

    /* ── SEARCH BAR: pill-style, matches index.php hero vocabulary ── */
    .search-bar-header { flex: 1; max-width: 560px; }
    .search-bar-header .search-form {
        display: flex;
        align-items: center;
        background: #fff;
        border: 1px solid var(--hdr-border);
        border-radius: 999px;
        padding: 4px 4px 4px 18px;
        box-shadow: 0 1px 2px rgba(15,23,42,.03);
        transition: border-color .2s, box-shadow .2s;
    }
    .search-bar-header .search-form:focus-within {
        border-color: var(--hdr-brand);
        box-shadow: 0 0 0 4px rgba(0,106,255,.1);
    }
    .search-bar-header .search-input {
        border: none !important;
        outline: none !important;
        background: transparent !important;
        box-shadow: none !important;
        -webkit-appearance: none !important;
        appearance: none !important;
        border-radius: 0 !important;
        padding: 0 10px 0 0;
        font-size: .92rem;
        font-family: inherit;
        color: var(--hdr-ink);
        flex: 1;
        min-width: 0;
        width: 100%;
        align-self: stretch;
    }
    .search-bar-header .search-input::placeholder { color: var(--hdr-muted); }
    .search-bar-header .search-input:focus,
    .search-bar-header .search-input:focus-visible {
        outline: none !important;
        box-shadow: none !important;
        border: none !important;
    }
    .search-bar-header .header-search-btn {
        background: var(--hdr-brand);
        color: #fff;
        border: 0;
        border-radius: 999px;
        width: 38px;
        height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background .2s, transform .2s, box-shadow .2s;
        flex-shrink: 0;
    }
    .search-bar-header .header-search-btn:hover {
        background: var(--hdr-brand-d);
        transform: scale(1.04);
        box-shadow: 0 6px 16px rgba(0,106,255,.28);
    }

    /* ── NAV CLUSTER (right side) ── */
    header nav { gap: 6px; }
    .nav-icon-link {
        position: relative;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--hdr-muted);
        text-decoration: none;
        transition: background .2s, color .2s;
    }
    .nav-icon-link:hover { background: var(--hdr-soft); color: var(--hdr-brand); }
    .nav-icon-link i { font-size: 1.05rem !important; color: inherit !important; }
    .nav-badge {
        position: absolute;
        top: 4px;
        right: 4px;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 999px;
        background: var(--danger, #d93c3c);
        color: #fff;
        font-size: .62rem;
        font-weight: 800;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 2px solid #fff;
        line-height: 1;
    }

    /* ── AVATAR + DROPDOWN ── */
    .user-menu-container { position: relative; }
    .user-avatar-btn {
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important;
        padding: 0;
        background: none;
        border: 2px solid var(--hdr-border) !important;
        cursor: pointer;
        overflow: hidden;
        transition: border-color .2s, box-shadow .2s;
        position: relative;
    }
    .user-avatar-btn:hover { border-color: var(--hdr-brand) !important; box-shadow: 0 0 0 3px rgba(0,106,255,.12); }
    .user-avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }

    .dropdown-menu {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        min-width: 300px;
        background: var(--hdr-surface);
        border: 1px solid var(--hdr-border);
        border-radius: 14px;
        box-shadow: var(--hdr-shadow);
        padding: 6px;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-6px);
        transition: opacity .2s, transform .2s;
        z-index: 9999;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    .dropdown-menu.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
    .dropdown-item {
        display: flex !important;
        align-items: center;
        gap: 12px;
        padding: 10px 12px !important;
        border-radius: 9px;
        color: var(--hdr-ink);
        text-decoration: none;
        font-size: .88rem;
        font-weight: 600;
        transition: background .15s;
    }
    .dropdown-item:hover { background: var(--hdr-soft); color: var(--hdr-brand); }
    .dropdown-item i { width: 22px; text-align: center; color: var(--hdr-muted); font-size: .92rem; }
    .dropdown-item:hover i { color: var(--hdr-brand); }

    /* ── LOGGED-OUT CTAS ── */
    .hdr-auth-row { display: flex; gap: 10px; align-items: center; }
    .hdr-auth-login {
        color: var(--hdr-ink);
        font-weight: 700;
        font-size: .9rem;
        text-decoration: none;
        padding: 8px 14px;
        border-radius: 10px;
        transition: background .15s;
    }
    .hdr-auth-login:hover { background: var(--hdr-soft); color: var(--hdr-brand); }
    .hdr-auth-signup {
        background: var(--hdr-brand);
        color: #fff;
        font-weight: 800;
        font-size: .9rem;
        padding: 10px 18px;
        border-radius: 10px;
        text-decoration: none;
        box-shadow: 0 4px 12px rgba(0,106,255,.2);
        transition: background .2s, transform .2s, box-shadow .2s;
    }
    .hdr-auth-signup:hover {
        background: var(--hdr-brand-d);
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(0,106,255,.28);
    }

    /* ── MOBILE HAMBURGER (shown < 768) ── */
    .hdr-mobile-toggle {
        display: none;
        width: 40px; height: 40px;
        border-radius: 10px;
        border: 1px solid var(--hdr-border);
        background: #fff;
        color: var(--hdr-ink);
        cursor: pointer;
        align-items: center;
        justify-content: center;
    }
    .hdr-mobile-toggle:hover { background: var(--hdr-soft); color: var(--hdr-brand); border-color: var(--hdr-brand); }

    /* Accessibility */
    .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }

    /* ── RESPONSIVE ─ mobile-first breakpoints ── */
    @media (max-width: 1024px) { .search-bar-header { max-width: 380px; } }
    @media (max-width: 900px) {
        header .container { padding: 5px 14px; gap: 10px; }
        .logo-img { height: 36px; max-width: 130px; }
        .nav-icon-link { display: none; }
    }
    @media (max-width: 768px) {
        .search-bar-header { display: none; }
        .search-bar-header.mobile-open {
            display: block;
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: #fff;
            padding: 12px 14px;
            border-bottom: 1px solid var(--hdr-border);
            max-width: none;
            box-shadow: 0 8px 24px rgba(15,23,42,.08);
        }
        .hdr-mobile-toggle { display: inline-flex; }
        .hdr-auth-login { padding: 6px 10px; font-size: .84rem; }
        .hdr-auth-signup { padding: 8px 14px; font-size: .84rem; }
        .dropdown-menu { right: -4px; min-width: 280px; max-width: calc(100vw - 20px); }
    }
    @media (max-width: 480px) { .logo-img { height: 32px; max-width: 110px; } }
/* v8 a11y: skip link — off-screen until focused */
.skip-link{position:absolute;left:12px;top:-60px;z-index:100000;background:#0f172a;color:#fff;padding:10px 16px;border-radius:0 0 10px 10px;font-weight:700;text-decoration:none;transition:top .15s}
.skip-link:focus{top:0;outline:3px solid #60a5fa;outline-offset:2px}
main:focus{outline:none}

/* v8 line icons (lib/icons.php) */
.ic{display:inline-block;vertical-align:-3px;flex:0 0 auto}
