/* ============================================================================
   global-search.css
   ----------------------------------------------------------------------------
   Scoped styles for the AJAX header search dropdown.

   EVERY SELECTOR is prefixed with `.global-search`, `.global-search-wrapper`,
   `.global-search-dropdown`, etc. — they cannot match anything outside the
   header search component.

   Authored 2026-05-07 at the user's explicit request.
   ========================================================================= */

.global-search-wrapper {
    position: relative;
}

.global-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    margin-top: 0.5rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.05);
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    color: #111827;
    line-height: 1.4;
}

.global-search-dropdown[hidden] {
    display: none;
}

.global-search-empty {
    padding: 1rem 1.25rem;
    color: #6b7280;
    font-size: 0.9rem;
    text-align: center;
}

.global-search-loading {
    color: #94a3b8;
    font-style: italic;
}

.global-search-section + .global-search-section {
    border-top: 1px solid #f1f5f9;
}

.global-search-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0.55rem 1rem 0.4rem;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.global-search-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #475569;
}

.global-search-section-all {
    font-size: 0.72rem;
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 500;
}

.global-search-section-all:hover {
    text-decoration: underline;
}

.global-search-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.global-search-item {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #f8fafc;
}

.global-search-item:last-child {
    border-bottom: none;
}

.global-search-item.is-featured {
    background: linear-gradient(to right, #fffbeb 0%, transparent 30%);
}

.global-search-link {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    text-decoration: none;
    color: #1f2937;
    transition: background-color 100ms ease;
}

.global-search-link:hover,
.global-search-link-active {
    background: #f1f5f9;
}

.global-search-icon {
    font-size: 1.1rem;
    line-height: 1.2;
    flex-shrink: 0;
    margin-top: 0.05rem;
    width: 1.6rem;
    text-align: center;
}

.global-search-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.global-search-title {
    font-size: 0.92rem;
    font-weight: 500;
    color: #0f172a;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.global-search-subtitle {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.3;
}

.global-search-snippet {
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.35;
    margin-top: 0.15rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.global-search-meta {
    flex-shrink: 0;
    font-size: 0.72rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
    align-self: flex-start;
    margin-top: 0.15rem;
}

.global-search-match {
    background: #fef08a;
    color: inherit;
    padding: 0 0.05rem;
    border-radius: 2px;
    font-weight: 600;
}

@media (max-width: 640px) {
    .global-search-dropdown {
        max-height: 80vh;
        border-radius: 8px;
    }
    .global-search-link {
        padding: 0.55rem 0.75rem;
        gap: 0.55rem;
    }
    .global-search-section-header {
        padding: 0.45rem 0.75rem 0.35rem;
    }
    .global-search-title { font-size: 0.88rem; }
    .global-search-meta  { font-size: 0.68rem; }
}
