/* Genesis site-wide search (inc/genesis-search.php). Tokens follow the
   site vocabulary: brand #284D9A, borders #CDE3FF/#E2E8F0, bg #F8FAFC. */

/* ---------- shared input + dropdown ---------- */
.gm-search { position: relative; width: 100%; }
.gm-search__box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1.5px solid #CDE3FF;
    border-radius: 12px;
    padding: 13px 16px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.gm-search--open .gm-search__box,
.gm-search__box:focus-within {
    border-color: #284D9A;
    box-shadow: 0 6px 22px rgba(28, 39, 74, .13), 0 0 0 4px rgba(40, 77, 154, .09);
}
.gm-search__box > svg { width: 20px; height: 20px; color: #284D9A; flex: 0 0 auto; }
/* While fetching, the magnifier swaps for a spinner in the logo's blue + red. */
.gm-search--loading .gm-search__box > svg { display: none; }
.gm-search--loading .gm-search__box::before {
    content: "";
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    box-sizing: border-box;
    border-radius: 50%;
    border: 2.5px solid rgba(40, 77, 154, .15);
    border-top-color: #284D9A;
    border-bottom-color: #C8262D;
    animation: gm-search-spin .7s linear infinite;
}
@keyframes gm-search-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .gm-search--loading .gm-search__box::before { animation-duration: 1.6s; }
}
.gm-search__input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    font-size: 16.5px;
    color: #0F172A;
}
.gm-search__input:focus { outline: none; }
.gm-search__kbd {
    color: #94A3B8;
    font-size: 12.5px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 3px 8px;
    background: #F8FAFC;
    white-space: nowrap;
    display: none;
}
.gm-search--open .gm-search__kbd { display: inline-block; }
/* Overlay clear/close X. Prefixed for specificity over the theme button reset. */
.gm-search__box .gm-search__x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #64748B;
    cursor: pointer;
    padding: 0;
    transition: background .15s ease, color .15s ease;
}
.gm-search__box .gm-search__x:hover { background: #EEF2F7; color: #0F172A; }
.gm-search__box .gm-search__x svg { width: 17px; height: 17px; }

.gm-search__dd {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .16);
    overflow-y: auto;
    overscroll-behavior: contain;
    max-height: min(60vh, 560px);
    z-index: 120;
}
/* In the overlay the body is scroll-locked, so the list itself scrolls,
   capped to the viewport space under the input. */
.gm-search-overlay .gm-search__dd {
    max-height: calc(100vh - max(12vh, 104px) - 120px);
    max-height: calc(100dvh - max(12dvh, 104px) - 120px);
}
.gm-search__group + .gm-search__group { border-top: 1px solid #EEF2F7; }
.gm-search__group { padding: 6px 0 2px; }
.gm-search__h {
    padding: 8px 18px 6px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .08em;
    color: #64748B;
    text-transform: uppercase;
}
.gm-search__item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 9px 18px;
    cursor: pointer;
    text-decoration: none;
}
.gm-search__item:hover,
.gm-search__item.is-sel { background: #F0F6FF; }
.gm-search__ic {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: #EAF1FA;
    color: #284D9A;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
}
.gm-search__ic svg { width: 16px; height: 16px; }
.gm-search__ic img { width: 100%; height: 100%; object-fit: cover; }
.gm-search__txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.gm-search__t { font-size: 15px; color: #0F172A; }
.gm-search__t b { color: #284D9A; }
.gm-search__s { font-size: 12.5px; color: #64748B; }
/* the row is a band; only the text inside it is the link */
.gm-search__all-row {
    display: flex;
    justify-content: center;
    padding: 13px;
    background: #F8FAFC;
    border-top: 1px solid #EEF2F7;
}
.gm-search__all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #284D9A;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}
.gm-search__all:hover,
.gm-search__all.is-sel { text-decoration: underline; }
.gm-search__empty { padding: 18px; text-align: center; color: #64748B; font-size: 14px; }

/* The header search icon is styled by genesis-header.css. */

/* ---------- overlay ---------- */
/* Scroll lock lives on <html>: overflow:hidden on <body> silently breaks
   position:sticky, which scrolled the header off-screen with the page.
   The padding compensates the vanished scrollbar (JS measures the gutter
   into --gm-scrollbar-gap) so the page width never shifts. */
html.gm-search-open {
    overflow: hidden;
    padding-right: var(--gm-scrollbar-gap, 0px);
}

.gm-search-overlay {
    position: fixed;
    inset: 0;
    /* above the sticky header: the bar stays visible through the
       translucent backdrop, dimmed behind the blur */
    z-index: 100000;
    background: rgba(8, 18, 36, .55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* the floor keeps the panel clear of the header on short viewports */
    padding: max(12vh, 104px) 20px 20px;
    /* is-open drives the entrance/exit (JS delays hidden on close) */
    opacity: 0;
    transition: opacity .22s ease;
}
.gm-search-overlay.is-open { opacity: 1; }
.gm-search-overlay__panel {
    width: 100%;
    max-width: 720px;
    transform: translateY(-16px);
    opacity: 0;
    transition: transform .24s ease, opacity .24s ease;
}
.gm-search-overlay.is-open .gm-search-overlay__panel {
    transform: none;
    opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
    .gm-search-overlay,
    .gm-search-overlay__panel { transition: none; transform: none; }
}

/* The quicklinks reuse the header's segmented pill group classes so
   they match it exactly; this wrapper centers and pins the row. */
.gm-search__quick {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: center;
    padding: 12px;
    background: #F8FAFC;
    border-top: 1px solid #EEF2F7;
}
.gm-search__quick .gm-hdr__seg.is-sel { background: #F0F6FF; }
.gm-search__quick .gm-hdr__seg--red.is-sel { background: #a01e23; }

/* popular terms (empty state) + typed suggestions: the label sits on
   its own line; only the chips row under it scrolls horizontally when
   it overflows (mobile), scrollbar hidden */
.gm-search__sug {
    padding: 12px 18px;
    border-bottom: 1px solid #EEF2F7;
}
.gm-search__sug-label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #64748B;
    margin-bottom: 9px;
}
.gm-search__sug-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.gm-search__sug-row::-webkit-scrollbar { display: none; }
.gm-search__sug .gm-search__sug-term {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 6px 13px;
    border: 1px solid #E2E8F0;
    border-radius: 999px;
    background: #F8FAFC;
    color: #284D9A;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
/* every state fully pinned: the theme reset's button:hover repaints the
   colors and the Elementor kit's button:hover zeroes border-width (the
   chip visibly jiggled), so the full border is restated */
.gm-search__sug .gm-search__sug-term:hover,
.gm-search__sug .gm-search__sug-term:focus,
.gm-search__sug .gm-search__sug-term.is-sel {
    border: 1px solid #284D9A;
    background: #fff;
    color: #284D9A;
}

/* ---------- themed search results page (search.php) ---------- */
.gm-serp {
    max-width: 1040px;
    margin: 0 auto;
    padding: 44px 20px 80px;
}
.gm-serp__count {
    text-align: center;
    color: #64748B;
    font-size: 14.5px;
    margin: 0 0 30px;
}
.gm-serp__group + .gm-serp__group { margin-top: 40px; }
/* .gm-serp-prefixed: the Elementor kit h2 rule ties bare qualification
   and its sheet loads later */
.gm-serp h2.gm-serp__h {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #64748B;
    margin: 0 0 14px;
}
.gm-serp__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.gm-serp__card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 16px 18px;
    text-decoration: none !important;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.gm-serp__card:hover {
    border-color: #CDE3FF;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .10);
    transform: translateY(-1px);
}
.gm-serp__ic {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: #EAF1FA;
    color: #284D9A;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
}
.gm-serp__ic svg { width: 20px; height: 20px; }
.gm-serp__ic img { width: 100%; height: 100%; object-fit: cover; }
.gm-serp__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gm-serp__t { font-size: 16.5px; font-weight: 600; color: #0F172A; }
.gm-serp__card:hover .gm-serp__t { color: #284D9A; }
.gm-serp__s { font-size: 13px; color: #64748B; }
.gm-serp__arrow { margin-left: auto; flex: 0 0 auto; color: #CBD5E1; transition: color .15s ease; }
.gm-serp__card:hover .gm-serp__arrow { color: #284D9A; }
.gm-serp__empty { text-align: center; padding: 26px 0 8px; }
.gm-serp h2.gm-serp__empty-t { font-size: 26px; color: #0F172A; margin: 0 0 10px; }
.gm-serp__empty p { color: #64748B; font-size: 15.5px; margin: 0 0 22px; }
.gm-serp__empty p.gm-serp__dym { color: #0F172A; font-size: 17px; margin: 0 0 14px; }
.gm-serp__dym a { color: #284D9A !important; font-weight: 600; text-decoration: underline !important; }
.gm-serp__empty-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.gm-serp__empty-links a {
    display: inline-flex;
    padding: 10px 18px;
    border: 1.5px solid #CDE3FF;
    border-radius: 999px;
    background: #F8FAFC;
    color: #284D9A !important;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none !important;
    transition: border-color .15s ease, background .15s ease;
}
.gm-serp__empty-links a:hover { border-color: #284D9A; background: #fff; }

@media (max-width: 767px) {
    .gm-serp { padding: 30px 16px 60px; }
    .gm-serp__grid { grid-template-columns: 1fr; }
    .gm-search-overlay { padding: 78px 12px 16px; } /* clears the 64px bar */
    .gm-search-overlay .gm-search__dd {
        max-height: calc(100vh - 220px);
        max-height: calc(100dvh - 220px);
    }
    .gm-search__kbd { display: none !important; }
    .gm-search__input { font-size: 16px; } /* prevents iOS zoom */
    /* the quicklinks group stacks vertically, like the old panel group */
    .gm-search__quick .gm-hdr__group {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        border-radius: 16px;
    }
    .gm-search__quick .gm-hdr__seg { justify-content: center; }
    .gm-search__quick .gm-hdr__seg + .gm-hdr__seg {
        border-left: 0;
        border-top: 1px solid #E2E8F0;
    }
}
