/* =====================================================================
   MyvanCMS — Articles search band
   ---------------------------------------------------------------------
   The deliberate counterpart to the footer's "Let's Talk" CTA band
   (assets/footer-cta.css). It borrows that band's construction and then
   INVERTS AND SHRINKS it, so the two read as a pair rather than a repeat:

     - the CTA is maroon with white type; this is white with maroon type
     - the CTA's title is 52px; this is ~20px, because it sits directly under
       the hero's own <h1> and must not compete with it
     - the CTA spans the container; this is capped at 760px and centred
     - the same inline arrow, scaled down to match
     - the same overlap trick — the CTA hangs off the TOP of the footer, this
       hangs off the BOTTOM of the hero

   NOT merged into footer-cta.css: that file owns the footer, and one of these
   two will eventually be restyled without the other. They share a look, not an
   implementation.

   Loaded site-wide from layouts/public.php; costs nothing on a page with no
   .search-band.
   ===================================================================== */

:root{
  /* How far the band rides up over the hero's lower edge. Mirrors
     --cta-overlap (78px) in footer-cta.css but is smaller, for two reasons:
     the hero has a breadcrumb sitting just above this point that a deeper pull
     would cover, and the band itself is now a shorter element than the CTA —
     the overlap has to stay proportionate to it or the panel looks like it is
     sliding off the photo. */
  --search-overlap:28px;
}

.search-band-wrap{
  position:relative;
  z-index:3;
  /* The pull-up. Negative TOP margin here, where the CTA band uses a negative
     bottom margin, because this one overlaps the block ABOVE it. */
  margin-top:calc(var(--search-overlap) * -1);
  /*
   * NO bottom margin. The .section that follows already carries the site's
   * standard vertical rhythm, and adding to it here left an obvious dead band
   * between the search and the first card — the two compounded.
   *
   * The pull-up above is also cancelled out of the flow below it: a negative
   * top margin moves the element without reducing the space the NEXT element
   * gets, which is exactly what is wanted here.
   */
}

/*
   INVERTED against the footer's CTA band, on purpose: that band is maroon with
   white type, this one is white with maroon type. Same shape, same radius, same
   shadow, same arrow — reversed palette. It reads as the pair's second half
   rather than as a duplicate, and it keeps a heavy block of brand colour off
   the top of the page where the hero photo is already doing the work.

   A white panel on a near-white page needs its own edge or it dissolves, so it
   carries a hairline border as well as the shadow — the maroon version needed
   neither.
*/
/*
   COMPRESSED AND CENTRED. It no longer spans the container: it is capped and
   auto-margined, so it reads as a search control sitting under the hero rather
   than as a full-width band competing with it. justify-content:center packs the
   title and field together in the middle instead of pushing them to opposite
   edges.
*/
.search-band{
  background:#fff;
  border:1px solid var(--pl-line, #ece7e9);
  border-radius:14px;
  padding:12px 18px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:16px;
  box-shadow:0 14px 34px rgba(23,27,42,.12);
  /* It is a <form>, so the browser's default margin has to go. */
  margin:0 auto;
  max-width:760px;
}

.search-band__title{
  display:flex;
  align-items:center;
  gap:10px;
  margin:0;
  color:var(--pl-brand);
  /* Deliberately smaller than .talk-band__title's 52px. That band is the page's
     closing statement and earns the size; this one sits directly under the
     hero's own <h1> and would compete with it. clamp() also keeps it from
     squeezing the input down to a stub on a laptop. */
  font-size:clamp(16px, 1.5vw, 20px);
  line-height:1.05;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:-.01em;
  white-space:nowrap;
}

/* The title IS the label — clicking it focuses the input. Reset the cursor so
   it does not read as body copy. */
.search-band__title label{margin:0;cursor:pointer}

.search-band__arrow{
  flex:0 0 auto;
  width:34px;height:11px;
  color:var(--pl-brand);
}
.search-band__arrow svg{display:block;width:100%;height:100%}

/* --- the pill control ------------------------------------------------
   Inverted with the panel. On the maroon original this was a solid white pill;
   on white it has to be the other way round or it disappears, so it takes the
   brand's own soft tint (--pl-brand-soft, the same wash .btn-pl-soft uses) with
   a hairline of the brand at low opacity.

   The magnifier button stays FULL maroon. It is the one saturated element left,
   which is what makes the control read as the thing to act on.
   ------------------------------------------------------------------ */
.search-band__field{
  flex:1 1 320px;
  min-width:0;                /* lets the input shrink instead of overflowing */
  display:flex;
  align-items:center;
  background:var(--pl-brand-soft, #F7EAEB);
  border:1px solid rgba(107,18,22,.14);
  border-radius:50px;
  padding:3px 3px 3px 16px;
  transition:border-color .18s ease, box-shadow .18s ease;
}

.search-band__field:focus-within{
  border-color:var(--pl-brand);
  box-shadow:0 0 0 3px rgba(107,18,22,.12);
}

.search-band__field input{
  flex:1 1 auto;
  min-width:0;
  border:0;
  outline:0;
  background:transparent;
  font-size:.9rem;
  color:var(--pl-ink);
  padding:7px 0;
}

.search-band__field input::placeholder{color:#9b8f93}

/* Chrome/Safari draw their own clear affordance on type=search; it collides
   with the button and does not match anything else on the site. */
.search-band__field input::-webkit-search-cancel-button{-webkit-appearance:none}

.search-band__field button{
  flex:0 0 auto;
  width:32px;height:32px;
  border:0;
  border-radius:50%;
  background:var(--pl-brand);
  color:#fff;
  font-size:.82rem;
  line-height:1;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition:background-color .18s ease, transform .18s ease;
}

.search-band__field button:hover{background:var(--pl-ink);transform:scale(1.05)}
/* Brand, not white: a white ring is invisible on the inverted panel. */
.search-band__field button:focus-visible{outline:3px solid var(--pl-brand);outline-offset:2px}

/* --- the live-region status line ------------------------------------
   Sits under the band, not inside it: it appears and disappears as the visitor
   types, and inside the panel that would make the band's height jump on every
   keystroke.
   ------------------------------------------------------------------ */
.search-band__status{
  margin:.7rem auto 0;
  max-width:760px;
  text-align:center;
  padding-inline:8px;
  font-size:.9rem;
  color:#5c5560;
  min-height:1.2em;           /* reserve the line so nothing below shifts */
}

/* --- tablet ----------------------------------------------------------
   The title and the field stop fitting side by side well before the panel
   itself is narrow, so they stack while the panel keeps its shape.
   ------------------------------------------------------------------ */
@media (max-width:991.98px){
  .search-band{
    flex-direction:column;
    align-items:stretch;
    gap:10px;
    padding:12px 16px;
  }
  .search-band__title{justify-content:center;font-size:clamp(15px, 2.6vw, 18px)}
  .search-band__field{flex:1 1 auto}
}

/* --- phone -----------------------------------------------------------
   The overlap is dropped entirely below 576px. The hero is short there and the
   band would sit on top of the breadcrumb rather than beside it.
   ------------------------------------------------------------------ */
@media (max-width:575.98px){
  :root{--search-overlap:0px}
  .search-band{padding:10px 12px;border-radius:12px}
  .search-band__title{font-size:15px;gap:8px}
  .search-band__arrow{width:28px;height:9px}
  .search-band__field{padding-left:16px}
  .search-band__field input{font-size:.9rem;padding:7px 0}
  .search-band__field button{width:30px;height:30px}
}

@media (prefers-reduced-motion:reduce){
  .search-band__field,
  .search-band__field button{transition:none}
  .search-band__field button:hover{transform:none}
}
