/**
 * Styles for the "Resource Search" component (Components/resource_search).
 * The pill mirrors .content-grid-search-input in Components/content_grid/style.css
 * (copied, not shared, so editing one can't change the other).
 */

/* :where() so the shared no-top-pd / no-bottom-pd utilities still win. */
:where(.resource-search-section) {
    padding-top: 30px;
    padding-bottom: 30px;
}

.resource-search {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.resource-search--left {
    align-items: flex-start;
}

.resource-search-field {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
    max-width: 420px;
}

.resource-search-input {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    /* Left clears the search icon, right clears the chevron button. */
    padding: 10px 40px 10px 38px;
    font-family: Montserrat, sans-serif;
    font-size: 0.9375em;
    font-weight: 400;
    color: var(--color-off-black);
    background: var(--color-white);
}

.resource-search-input::placeholder {
    font-weight: 400;
    color: var(--color-off-black);
}

.resource-search-input:focus {
    outline: 2px solid var(--color-teal);
    outline-offset: 1px;
}

.resource-search-icon {
    position: absolute;
    left: 16px;
    color: var(--color-grey);
}

.resource-search-submit {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: none;
    color: var(--color-dark-teal);
    cursor: pointer;
    line-height: 1;
    font-size: 0.875em;
    padding: 0;
}

.resource-search-submit:focus {
    outline: 2px solid var(--color-teal);
    outline-offset: 1px;
}

/* Shown inside a row (under its heading) when the search matches nothing in it. */
.resource-search-noresults {
    margin: 0;
    text-align: center;
    color: var(--color-grey);
}

/* Rows/boxes that don't match the search (set by scripts.js). */
.is-search-hidden {
    display: none !important;
}

/* ---------- Sticky (Stick to Top When Scrolling) ---------- */

/* scripts.js keeps --resource-search-top equal to the bottom of the site's own
   sticky header (main nav, plus the sub-nav on section pages); 82px = the main
   nav's height, used until it has measured. z-index sits under both navs
   (1000 / 999) but over the page content. */
.resource-search-section--sticky {
    position: sticky;
    top: var(--resource-search-top, 82px);
    z-index: 900;
    transition: box-shadow 0.2s ease;
}

/* Once pinned: solid white with a soft shadow so content scrolls cleanly under it
   (the section's own background may be transparent/glass). Padding is NOT changed
   here: resizing on stick would make the page content jump. */
.resource-search-section--sticky.is-stuck {
    background: var(--color-white) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* position: sticky does nothing inside an overflow:hidden ancestor, and the page
   wrapper gets overflow:hidden whenever the Hero's rainbow corner graphic is on
   (ModularPageBuilderBaseStyles.css). overflow:clip clips the same way without
   becoming a scroll container. The id selector beats that rule whatever order
   the stylesheets load in. */
#ModularPageBuilderHub.talos_ts_background-top,
#ModularPageBuilderHub.talos_ts_background-bottom {
    overflow: clip;
}
