/**
 * Budgeted header overlays — live search panel + mobile drawer.
 */
.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-height: min(70vh, 420px);
    overflow-y: auto;
    display: none;
}

.search-results.is-open {
    display: block;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.close-search {
    width: 44px;
    height: 44px;
    border: 0;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
}

.search-result-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border);
}

.search-result-item:hover {
    background: var(--surface-2);
}

.search-result-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-result-title {
    font-weight: 650;
    color: var(--text);
    font-size: 0.92rem;
}

.search-result-excerpt,
.search-result-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.search-result-type {
    color: var(--primary);
    font-weight: 650;
    text-transform: uppercase;
}

.no-results,
.loading-spinner {
    padding: 1.25rem;
    text-align: center;
    color: var(--text-muted);
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    z-index: 1290;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.drawer-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.app-drawer[hidden],
.drawer-backdrop[hidden],
.search-results[hidden] {
    display: none !important;
}

.app-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1300;
    width: min(88vw, 360px);
    max-width: 100%;
    height: 100%;
    height: 100dvh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.22s ease;
    display: flex;
    flex-direction: column;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    outline: none;
}

.app-drawer.is-open {
    transform: translateX(0);
}

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.drawer-head strong {
    font-family: var(--font-display);
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.drawer-nav a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 44px;
    padding: 0 0.75rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
}

.drawer-nav a i {
    width: 1.1rem;
    color: var(--primary);
}

.drawer-nav a[aria-current="page"],
.drawer-nav a:hover {
    background: var(--primary-soft);
}

.drawer-cta {
    margin: 1rem 0;
    width: 100%;
}

.drawer-social {
    margin-top: auto;
    padding-top: 1.25rem;
    display: flex;
    gap: 0.5rem;
}

.drawer-social a {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
