/* ============================================================
   Site Search (Tier 1) — PatientCentricCare.AI
   Placement: top-right under the Harvard validation strip,
              above the page headline.
   Design: white magnifying glass icon + white-framed input.
   Engine: Pagefind (static, generated at deploy time).
   ============================================================ */

.pcc-search-bar {
    /* full-width strip so we can right-align the control on every page,
       regardless of the page's own container */
    width: 100%;
    background: #0b1f3a;            /* same dark navy as the nav/header band */
    padding: 10px 24px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 50;
}

.pcc-search-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1.5px solid #ffffff;     /* white frame, as requested */
    border-radius: 999px;
    padding: 6px 14px 6px 12px;
    transition: width 0.25s ease, background-color 0.2s ease;
    width: 240px;
    max-width: 60vw;
}

.pcc-search-control:focus-within {
    background: rgba(255, 255, 255, 0.08);
    width: 320px;
}

.pcc-search-bar svg.pcc-search-icon,
.pcc-search-icon {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    max-width: 18px;
    flex-shrink: 0;
    color: #ffffff;                  /* white magnifying glass */
    display: inline-block;
}

/* Defensive: some pages set img/svg width:100%; protect our control */
.pcc-search-bar img,
.pcc-search-bar svg { vertical-align: middle; }

.pcc-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.92rem;
    width: 100%;
    padding: 2px 0;
    letter-spacing: 0.01em;
}

.pcc-search-input::placeholder {
    color: rgba(255, 255, 255, 0.65);
    font-style: italic;
}

/* ---- Results panel (overlay below the input) ---- */
.pcc-search-results {
    position: absolute;
    top: calc(100% + 4px);
    right: 24px;
    width: min(520px, calc(100vw - 48px));
    max-height: 70vh;
    overflow-y: auto;
    background: #ffffff;
    color: #1f2937;
    border-radius: 10px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
    padding: 10px 4px;
    display: none;
    z-index: 100;
}

.pcc-search-results.is-open {
    display: block;
}

.pcc-search-results .pagefind-ui__result {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
}

.pcc-search-results .pagefind-ui__result:last-child {
    border-bottom: none;
}

.pcc-search-results .pagefind-ui__result-title a {
    color: #0d9488;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.98rem;
}

.pcc-search-results .pagefind-ui__result-title a:hover {
    text-decoration: underline;
}

.pcc-search-results .pagefind-ui__result-excerpt {
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.45;
    margin-top: 4px;
}

.pcc-search-results mark {
    background: #fef3c7;
    color: #1f2937;
    padding: 0 2px;
    border-radius: 2px;
}

.pcc-search-results .pagefind-ui__message {
    padding: 14px;
    color: #475569;
    font-size: 0.9rem;
}

/* Hide Pagefind's default chrome that we don't need */
.pcc-search-results .pagefind-ui__form,
.pcc-search-results .pagefind-ui__drawer { display: none; }

/* ---- Mobile ---- */
@media (max-width: 720px) {
    .pcc-search-bar {
        padding: 8px 14px;
        justify-content: stretch;
    }
    .pcc-search-control {
        width: 100%;
        max-width: 100%;
    }
    .pcc-search-control:focus-within {
        width: 100%;
    }
    .pcc-search-results {
        right: 14px;
        left: 14px;
        width: auto;
    }
}
