/* ===========================================================================
   WEBSITE-WIDE SEARCH  -  Sumandeep Hospital
   ---------------------------------------------------------------------------
   Uses the theme's own custom properties so colour and typography stay in
   sync with the rest of the site. Fallback values are the current palette:
       --pbmit-global-color     #73b475   accent green
       --pbmit-blackish-color   #1489bc   heading blue
       --pbmit-secondary-color  #010d27   near-black
       --pbmit-light-color      #f0f7fd   pale blue panel
   =========================================================================== */

.sh-search {
    --sh-accent: var(--pbmit-global-color, #73b475);
    --sh-blue: var(--pbmit-blackish-color, #1489bc);
    --sh-ink: var(--pbmit-secondary-color, #010d27);
    --sh-panel: var(--pbmit-light-color, #f0f7fd);
    --sh-head-font: var(--pbmit-heading-typography-font-family, "Libre Franklin", sans-serif);
    --sh-body-font: var(--pbmit-body-typography-font-family, "Roboto", sans-serif);
    --sh-line: rgba(3, 27, 78, .10);
}


/* ---------------------------------------------------------------------------
   1. HEADER TRIGGER
   Matches the height and rhythm of the existing header buttons.
   --------------------------------------------------------------------------- */

/* The two-class selector deliberately matches the theme's own
   `.site-header .pbmit-header-search-btn { display: none }` in
   responsive.css (max-width 485px), which used to hide the search on
   phones. Same specificity, loaded later, so the icon now stays
   available on every screen size. */
.site-header .pbmit-header-search-btn {
    display: flex;
    align-items: center;
    margin-left: 22px;
}

.pbmit-header-search-btn>a {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--pbmit-blackish-color, #1489bc);
    background-color: var(--pbmit-light-color, #f0f7fd);
    font-size: 17px;
    line-height: 1;
    text-decoration: none;
    transition: color .25s ease, background-color .25s ease, transform .25s ease;
}

.pbmit-header-search-btn>a:hover,
.pbmit-header-search-btn>a:focus-visible {
    color: #fff;
    background-color: var(--pbmit-global-color, #73b475);
    transform: translateY(-2px);
}

.pbmit-header-search-btn>a:focus-visible {
    outline: 2px solid var(--pbmit-global-color, #73b475);
    outline-offset: 3px;
}


/* ---------------------------------------------------------------------------
   2. OVERLAY SHELL
   --------------------------------------------------------------------------- */

.sh-search {
    position: fixed;
    inset: 0;
    z-index: 100000;
    /* above the theme's fixed header (z-index 999) */
    display: flex;
    flex-direction: column;
    font-family: var(--sh-body-font);
    background: rgba(255, 255, 255, .97);
    opacity: 0;
    visibility: hidden;
    transform: scale(1.02);
    transition: opacity .28s ease, transform .28s ease, visibility 0s linear .28s;
}

@supports (backdrop-filter: blur(6px)) {
    .sh-search {
        background: rgba(255, 255, 255, .92);
        backdrop-filter: blur(8px);
    }
}

.sh-search.is-open {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: opacity .28s ease, transform .28s ease, visibility 0s;
}

/* stops the page behind from scrolling while the overlay is up */
body.sh-search-open {
    overflow: hidden;
}


/* ---------------------------------------------------------------------------
   3. SEARCH BAR
   --------------------------------------------------------------------------- */

.sh-search__bar {
    flex: 0 0 auto;
    border-bottom: 1px solid var(--sh-line);
    background: #fff;
}

.sh-search__bar-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 26px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.sh-search__field {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    background: var(--sh-panel);
    border: 2px solid transparent;
    border-radius: 60px;
    padding: 0 20px;
    transition: border-color .25s ease, box-shadow .25s ease;
}

.sh-search__field:focus-within {
    border-color: var(--sh-accent);
    box-shadow: 0 6px 24px rgba(115, 180, 117, .18);
}

.sh-search__icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    color: var(--sh-blue);
    opacity: .75;
}

.sh-search__input {
    flex: 1 1 auto;
    border: 0;
    background: transparent;
    padding: 18px 14px;
    font-family: var(--sh-body-font);
    font-size: 17px;
    color: var(--sh-ink);
    min-width: 0;
}

.sh-search__input::placeholder {
    color: rgba(1, 13, 39, .45);
}

.sh-search__input:focus {
    outline: none;
}

/* clear (x) inside the field, only while there is text */
.sh-search__clear {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(1, 13, 39, .08);
    color: var(--sh-ink);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background-color .2s ease;
}

.sh-search__clear:hover {
    background: rgba(1, 13, 39, .16);
}

.sh-search.has-query .sh-search__clear {
    display: flex;
}

/* close button */
.sh-search__close {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border: 1px solid var(--sh-line);
    border-radius: 50%;
    background: #fff;
    color: var(--sh-ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .25s ease, background-color .25s ease, border-color .25s ease, transform .25s ease;
}

.sh-search__close:hover {
    color: #fff;
    background: var(--sh-blue);
    border-color: var(--sh-blue);
    transform: rotate(90deg);
}

.sh-search__close svg {
    width: 18px;
    height: 18px;
}


/* ---------------------------------------------------------------------------
   4. RESULTS AREA
   --------------------------------------------------------------------------- */

.sh-search__body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.sh-search__results-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 10px 24px 60px;
}

.sh-search__status {
    font-size: 13px;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-weight: 600;
    color: rgba(1, 13, 39, .5);
    padding: 20px 2px 6px;
}

/* --- one category block --- */

.sh-group+.sh-group {
    margin-top: 26px;
}

.sh-group__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--sh-head-font);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--sh-blue);
    margin: 0 0 10px;
    padding: 0 2px 10px;
    border-bottom: 1px solid var(--sh-line);
}

.sh-group__count {
    font-weight: 500;
    color: rgba(1, 13, 39, .45);
    letter-spacing: .02em;
}

/* --- one result --- */

.sh-hit {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    color: inherit;
    text-decoration: none;
    transition: background-color .2s ease, transform .2s ease;
}

.sh-hit:hover,
.sh-hit.is-active {
    background: var(--sh-panel);
    color: inherit;
    transform: translateX(3px);
}

.sh-hit:focus-visible {
    outline: 2px solid var(--sh-accent);
    outline-offset: 2px;
}

.sh-hit__thumb {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--sh-panel);
}

.sh-hit__badge {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sh-panel);
    color: var(--sh-blue);
    margin-top: 2px;
}

.sh-hit__badge svg {
    width: 18px;
    height: 18px;
}

.sh-hit__main {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
}

.sh-hit__title {
    display: block;
    font-family: var(--sh-head-font);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--sh-blue);
    margin: 0 0 3px;
}

.sh-hit__sub {
    display: block;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--sh-ink);
    opacity: .85;
    margin: 0 0 2px;
}

.sh-hit__detail {
    display: block;
    font-size: 13px;
    line-height: 1.45;
    color: var(--sh-accent);
    font-weight: 600;
    margin: 2px 0 0;
}

.sh-hit__excerpt {
    display: block;
    font-size: 13px;
    line-height: 1.55;
    color: rgba(1, 13, 39, .62);
    margin: 4px 0 0;
}

.sh-hit__action {
    display: block;
    flex: 0 0 auto;
    align-self: center;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--sh-accent);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity .2s ease, transform .2s ease;
}

.sh-hit:hover .sh-hit__action,
.sh-hit.is-active .sh-hit__action {
    opacity: 1;
    transform: translateX(0);
}

/* the highlighted keyword */
.sh-search mark {
    background: rgba(115, 180, 117, .22);
    color: inherit;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 700;
}


/* ---------------------------------------------------------------------------
   5. EMPTY, LOADING AND NO-RESULT STATES
   --------------------------------------------------------------------------- */

.sh-suggest {
    padding: 26px 2px 0;
}

.sh-suggest__label {
    font-family: var(--sh-head-font);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(1, 13, 39, .45);
    margin: 0 0 14px;
}

.sh-suggest__list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 30px;
    padding: 0;
    list-style: none;
}

.sh-chip {
    border: 1px solid var(--sh-line);
    background: #fff;
    border-radius: 40px;
    padding: 9px 18px;
    font-family: var(--sh-body-font);
    font-size: 13.5px;
    color: var(--sh-ink);
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.sh-chip:hover {
    color: #fff;
    background: var(--sh-blue);
    border-color: var(--sh-blue);
}

.sh-empty {
    text-align: center;
    padding: 60px 20px 40px;
}

.sh-empty__icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--sh-panel);
    color: var(--sh-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sh-empty__icon svg {
    width: 26px;
    height: 26px;
}

.sh-empty__title {
    font-family: var(--sh-head-font);
    font-size: 19px;
    font-weight: 600;
    color: var(--sh-blue);
    margin: 0 0 8px;
}

.sh-empty__text {
    font-size: 14.5px;
    line-height: 1.6;
    color: rgba(1, 13, 39, .6);
    max-width: 430px;
    margin: 0 auto;
}

.sh-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 34px 4px;
    font-size: 14px;
    color: rgba(1, 13, 39, .55);
}

.sh-loading__spin {
    width: 20px;
    height: 20px;
    border: 2px solid var(--sh-line);
    border-top-color: var(--sh-accent);
    border-radius: 50%;
    animation: sh-spin .7s linear infinite;
}

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


/* ---------------------------------------------------------------------------
   6. RESPONSIVE
   --------------------------------------------------------------------------- */

/* Below xl the theme's hamburger (.navbar-toggler) is absolutely
   positioned at right:0 of the header, so the search icon has to leave
   room for it or the two overlap. 40px button + 8px gap. */
@media (max-width: 1199.98px) {
    .site-header .pbmit-header-search-btn {
        margin-right: 48px;
    }
}

@media (max-width: 991px) {
    .site-header .pbmit-header-search-btn {
        margin-left: 14px;
    }

    .sh-search__bar-inner {
        padding: 18px 16px;
        gap: 12px;
    }

    .sh-search__results-wrap {
        padding: 6px 16px 50px;
    }
}

@media (max-width: 767px) {
    .sh-search__field {
        padding: 0 14px;
    }

    .sh-search__input {
        font-size: 16px;
        /* 16px stops iOS Safari zooming on focus */
        padding: 15px 10px;
    }

    .sh-search__close {
        width: 42px;
        height: 42px;
    }

    .pbmit-header-search-btn>a {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .sh-hit {
        padding: 12px 12px;
        gap: 11px;
    }

    .sh-hit__title {
        font-size: 15px;
    }

    /* the hover-only action label has no meaning on touch */
    .sh-hit__action {
        display: none;
    }

    .sh-hit__excerpt {
        display: none;
    }
}

@media (max-width: 480px) {

    /* phone header is tight - the icon shrinks rather than disappearing */
    .site-header .pbmit-header-search-btn {
        margin-left: 8px;
    }

    .pbmit-header-search-btn>a {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }
}

@media (max-width: 420px) {
    .sh-hit__thumb,
    .sh-hit__badge {
        display: none;
    }
}

/* respect the visitor's motion preference */
@media (prefers-reduced-motion: reduce) {

    .sh-search,
    .sh-hit,
    .sh-search__close,
    .pbmit-header-search-btn>a,
    .sh-hit__action {
        transition-duration: .01ms;
    }

    .sh-loading__spin {
        animation-duration: 2s;
    }
}
