/* =============================================================================
   Shared component: the Opportunities search bar
   Markup: inc/opps-search.php (drive4hhs_opps_search_bar()).
   Enqueued by drive4hhs_opps_search_enqueue() on the pages that print the bar:
   the Opportunities hero, the search band of a posting page and the search band of
   the hiring map page.

   One white pill holding the icon, the field and the button. The focus ring is drawn
   on the pill (focus-within), so it reads as one control; the field's own outline is
   dropped only because the pill carries it.

   --orange-border, --slate and --charcoal are page-level tokens (each page that uses
   them declares them), so they carry their value as a fallback here and the bar looks
   the same on a page that has not declared them.
   ============================================================================= */
.opps-search {
  max-width: 680px;
  margin: 32px auto 0;
}
.opps-search-bar {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 6px 6px 6px 24px;
  background: var(--white);
  border-radius: 40px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}
.opps-search-bar:focus-within {
  outline: 3px solid var(--orange-bright);
  outline-offset: 3px;
}
.opps-search-icon {
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--slate, #576371);
  stroke-width: 2;
  stroke-linecap: round;
}
.opps-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: var(--body-font);
  font-size: 18px;            /* 16px and up keeps iOS from zooming the page on focus */
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}
.opps-search-input:focus { outline: none; }          /* ring is on .opps-search-bar */
.opps-search-input::placeholder { color: var(--slate, #576371); opacity: 1; }
.opps-search-btn {
  flex: none;
  height: 100%;
  padding: 0 32px;
  border: 2px solid var(--orange-border, #C74300);
  border-radius: 40px;
  background: var(--orange);
  font-family: var(--body-font);   /* the Opportunities hero sets its own display font on it */
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--white);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.opps-search-btn:hover { background: var(--orange-border, #C74300); }
.opps-search-btn:focus-visible { outline: 3px solid var(--charcoal, #2A2A2A); outline-offset: 2px; }
.opps-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- Mobile (<=768px) ---- */
@media (max-width: 768px) {
  .opps-search { margin-top: 24px; }
  .opps-search-bar { height: 58px; padding: 5px 5px 5px 20px; }
  .opps-search-input { font-size: 17px; padding: 0 12px; }
  .opps-search-btn { padding: 0 24px; font-size: 15px; }
}

/* ---- Small mobile (<=480px) ---- */
@media (max-width: 480px) {
  /* The magnifier gives its room to the placeholder; the button still says Search. */
  .opps-search-icon { display: none; }
  .opps-search-bar { padding-left: 8px; }
  .opps-search-input { font-size: 16px; }
  .opps-search-btn { padding: 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .opps-search-btn { transition: none; }
}

/* =============================================================================
   On the search band of a posting page (.jp-search, styled in posting.css)
   The posting page goes to its phone layout at 860px, not 768px, so in the approved
   posting design the bar takes its compact size from that width. Only the bar's own
   box is sized here; the band, its photo, its heading and the space between the
   heading and the bar are posting.css.
   ============================================================================= */
@media (max-width: 860px) {
  .jp-search .opps-search-bar { height: 58px; padding: 5px 5px 5px 20px; }
  .jp-search .opps-search-input { font-size: 17px; padding: 0 12px; }
  .jp-search .opps-search-btn { padding: 0 24px; font-size: 15px; }
}

@media (max-width: 480px) {
  .jp-search .opps-search-bar { padding-left: 8px; }
  .jp-search .opps-search-input { font-size: 16px; }
  .jp-search .opps-search-btn { padding: 0 20px; }
}
