/* ═══════════════════════════════════════════════
   HEADER — BASE LAYOUT
═══════════════════════════════════════════════ */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    /* height: 64px; */
    height: 85px;
    gap: 1rem;
    position: relative;
    z-index: 1000;
    border-bottom: 1px solid var(--rule);
    background: var(--paper);
}

/* ── Left ── */
.site-header__logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
/* .site-header__logo-img { height: 48px; width: auto; display: block; } */
.site-header__logo-img { height: auto; width: auto; display: block; }

.site-header__org-name { display: flex; flex-direction: column; font-weight: bold; line-height: 1.3; font-size: 0.78rem; white-space: nowrap; }

/* ── Centre ── */
.site-header__title { flex: 1; text-align: center; display: flex; align-items: center; justify-content: center; min-width: 0; }
/* .site-header__title-img { height: 52px; width: auto; max-width: 100%; } */
.site-header__title-img { height: auto; width: auto; }


/* ── Right ── */
.site-header__right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-link { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; text-decoration: none; color: inherit; white-space: nowrap; }
.header-link--cta { background: #c0392b; color: #fff !important; padding: 5px 12px; border-radius: 4px; }

.search-icon-btn {
    background: none; border: none; cursor: pointer; color: inherit; padding: 8px;
    display: flex; align-items: center; justify-content: center; border-radius: 50%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.search-icon-btn:hover { background: rgba(0,0,0,0.08); transform: scale(1.1); }

/* ── Mobile title bar — hidden on desktop ── */
.site-header__mobile-title { display: none; }

/* ═══════════════════════════════════════════════
   SEARCH OVERLAY — MODERN GLASSMORPHISM
═══════════════════════════════════════════════ */

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    justify-content: center;
    padding-top: 80px;
}

.search-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.search-overlay__content {
    width: 90%;
    max-width: 800px;
    position: relative;
}

.search-overlay__close-btn {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 10px;
    transition: color 0.2s, transform 0.2s;
}

.search-overlay__close-btn:hover {
    color: #111;
    transform: rotate(90deg);
}

.search-overlay__container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.search-overlay__input-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 2px solid #e5e7eb;
    position: relative;
    transition: border-color 0.3s;
}

.search-overlay__input-wrapper:focus-within {
    border-color: #c0392b;
}

.search-overlay__input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.75rem;
    font-family: 'Playfair Display', serif;
    color: #111;
    font-weight: 700;
}

.search-overlay__input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* Loading Spinner */
.search-overlay__loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #c0392b;
    border-radius: 50%;
    display: none;
    animation: search-spin 0.6s linear infinite;
}

@keyframes search-spin {
    to { transform: rotate(360deg); }
}

/* Results Area */
.search-results {
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 10px;
}

/* Scrollbar styling */
.search-results::-webkit-scrollbar { width: 6px; }
.search-results::-webkit-scrollbar-track { background: transparent; }
.search-results::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

.search-results__status {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.search-results__list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-result-item {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    background: #fff;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.search-result-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border-color: #f3f4f6;
}

.search-result-item__icon {
    width: 44px;
    height: 44px;
    background: #f9fafb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #4b5563;
}

.search-result-item:hover .search-result-item__icon {
    background: #fee2e2;
    color: #c0392b;
}

.search-result-item__content {
    flex: 1;
    min-width: 0;
}

.search-result-item__title {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item__snippet {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-item__meta {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.search-result-item__badge {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}

.search-result-item__page {
    color: #c0392b;
}

/* Highlight search terms */
mark {
    background: #fff3cd;
    color: #856404;
    padding: 0 2px;
    border-radius: 2px;
}

@media (max-width: 640px) {
    /* Shorter header row */
    .site-header {
        height: 56px;
        padding: 0 0.75rem;
        gap: 0.5rem;
    }

    /* Hide the centred title inside the header row */
    .site-header__title { display: none; }

    /* Smaller logo */
    .site-header__logo-img { height: 36px; }

    /* Slightly smaller org name */
    .site-header__org-name { font-size: 0.68rem; }

    /* Compact auth */
    .header-link { font-size: 0.72rem; }
    .header-link--cta { font-size: 0.72rem; padding: 5px 10px; }

    /* Show the mobile title bar BELOW the header */
    .site-header__mobile-title {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 4px 0.75rem 8px;
        border-bottom: 1px solid #e5e7eb;
    }

    .site-header__mobile-title img {
        height: 40px;
        width: auto;
    }

    .search-overlay { padding-top: 60px; }
    .search-overlay__input { font-size: 1.25rem; }
    .search-result-item { padding: 1rem; gap: 0.75rem; }
    .search-result-item__icon { width: 36px; height: 36px; }
    .search-overlay__close-btn { top: -45px; }
}

@media (min-width: 641px) and (max-width: 900px) {
    .site-header__org-name { font-size: 0.72rem; }
    .site-header__title-img { height: 44px; }
    .header-link { font-size: 0.75rem; }
}
