/* ==========================================================================
   ForeFind — page hero banners + mobile layout fixes
   Loaded after each page's own stylesheet (see forefind_enqueue_banner_css()
   in functions.php) on Home, Industry, Investment, Locations and Popular
   Searches.

   The hero banners are light artwork (pale blue / mint) with the illustration
   on the right, so the heroes switch from the old dark split-photo look to
   dark text on the light banner, as in the approved home mock-up.
     Desktop (> 980px): the wide banner, illustration right, copy left.
     Tablet/phone:      the blurred portrait version, so the illustration
                        stays as texture behind the copy instead of fighting it.
   ========================================================================== */

main.forefind-page {
  --ffb-ink: #0E1117;
  --ffb-body: #3D4555;
  --ffb-muted: #6B7280;
  --ffb-green: #1E9E3A;
  --ffb-line: rgba(14, 17, 23, .10);
}

/* ── INNER PAGES: shared hero shell ─────────────────────────────────────── */
main.forefind-page .page-hero {
  position: relative;
  overflow: hidden;
  background-color: #EEF4FD;
  background-repeat: no-repeat;
  /* Full height, pinned right: the artwork's left side is empty sky, and
     scaling it to the hero's height keeps the illustration clear of the copy
     (cover would blow it up behind the headline). The colour fills the rest
     and matches the artwork's own left edge (the files are extended to the left
     with that edge, so there is no seam up to very wide screens). */
  background-size: auto 100%;
  background-position: right center;
  border-bottom: 1px solid #E2E8F0;
  min-height: 480px;
}
main.forefind-industry .page-hero   { background-image: url('../images/banners/industry.webp');   background-color: #EEF4FD; }
main.forefind-investment .page-hero { background-image: url('../images/banners/investment.webp'); background-color: #EEF4FD; }
main.forefind-locations .page-hero  { background-image: url('../images/banners/locations.webp');  background-color: #EEF4FD; }
main.forefind-popular .page-hero    { background-image: url('../images/banners/popular.webp');    background-color: #EEF4FD; }

/* The old dark wash and the stock-photo panel are replaced by the banner. */
main.forefind-page .page-hero::before,
main.forefind-page .page-hero-media,
main.forefind-page .page-hero-grid { display: none; }

main.forefind-page .page-hero-content { position: relative; z-index: 2; }
main.forefind-page .page-hero-content > * { max-width: 560px; }
main.forefind-investment .page-hero-content .spectrum-wrap { max-width: 560px; }

main.forefind-page .page-hero .page-title { color: var(--ffb-ink); }
main.forefind-page .page-hero .page-title span { color: var(--ffb-green); }
main.forefind-page .page-hero .page-sub { color: var(--ffb-body); }
main.forefind-page .page-hero .breadcrumb,
main.forefind-page .page-hero .breadcrumb span { color: var(--ffb-ink); }
main.forefind-page .page-hero .breadcrumb a,
main.forefind-page .page-hero .breadcrumb a:link,
main.forefind-page .page-hero .breadcrumb a:visited { color: var(--ffb-muted); }
main.forefind-page .page-hero .breadcrumb a:hover { color: var(--ffb-green); }
main.forefind-page .page-hero .breadcrumb svg path { stroke: rgba(14, 17, 23, .35); }

/* Hero stats (Industry, Locations). */
main.forefind-page .page-hero .hstat-val,
main.forefind-page .page-hero .hero-stat-val { color: var(--ffb-ink); }
main.forefind-page .page-hero .hstat-label,
main.forefind-page .page-hero .hero-stat-label { color: var(--ffb-muted); }

/* Industry subcategory search: white field on the light banner. */
main.forefind-industry .page-hero .hero-search {
  background: #fff;
  border: 1px solid #DCE3EC;
  box-shadow: 0 10px 30px -14px rgba(14, 40, 80, .25);
}
main.forefind-industry .page-hero .hero-search input { color: var(--ffb-ink); }
main.forefind-industry .page-hero .hero-search input::placeholder { color: #8E97A8; }

/* Investment spectrum: labels and dividers were tuned for a dark backdrop. */
main.forefind-investment .spectrum-bar { box-shadow: inset 0 0 0 1px rgba(14, 17, 23, .08); }
main.forefind-investment .spectrum-labels { color: var(--ffb-muted); }

/* ── HOME hero ──────────────────────────────────────────────────────────── */
main.forefind-home .hero { background: #E1EFFA; }
main.forefind-home .hero-bg { display: block; }
main.forefind-home .hero-bg picture { display: block; width: 100%; height: 100%; }
main.forefind-home .hero-bg-img { object-position: right center; }
main.forefind-home .hero-bg-overlay,
main.forefind-home .hero-bg-overlay2 { display: none; }
main.forefind-home .hero-inner > * { max-width: 620px; }
main.forefind-home .hero-inner > .hero-search { max-width: 760px; }
main.forefind-home .hero-inner > .hero-quick { max-width: 760px; }

main.forefind-home .hero-eyebrow {
  background: #fff;
  border-color: #E2E8F0;
  color: var(--ffb-ink);
  box-shadow: 0 2px 8px -4px rgba(14, 40, 80, .2);
}
main.forefind-home .hero-h1 { color: var(--ffb-ink); }
main.forefind-home .hero-h1 .teal { color: var(--ffb-green); }
main.forefind-home .hero-sub { color: var(--ffb-body); }

main.forefind-home .hero-search {
  background: #fff;
  border: 1px solid #E2E8F0;
  box-shadow: 0 14px 34px -16px rgba(14, 40, 80, .28);
}
main.forefind-home .hs-label { color: var(--ffb-ink); }
main.forefind-home .hero-search .hs-input { color: var(--ffb-ink); }
main.forefind-home .hs-input::placeholder { color: #8E97A8; }
main.forefind-home .hs-sep { background: #E5E9F0; }

main.forefind-home .hq-label { color: var(--ffb-ink); }
main.forefind-home .hq-pill {
  color: var(--ffb-ink);
  background: #fff;
  border-color: #E2E8F0;
}
main.forefind-home .hq-pill:hover { border-color: var(--ffb-green); color: var(--ffb-green); }

main.forefind-home .hero-stats { border-top-color: var(--ffb-line); }
main.forefind-home .hstat { border-right-color: var(--ffb-line); }
main.forefind-home .hstat-val { color: var(--ffb-ink); }
main.forefind-home .hstat-val em { color: var(--ffb-green); }
main.forefind-home .hstat-label { color: var(--ffb-muted); }

/* ── TABLET + PHONE: blurred portrait banner behind the copy ────────────── */
@media (max-width: 980px) {
  main.forefind-page .page-hero {
    min-height: 0;
    display: block;
    background-size: cover;
    background-position: center top;
  }
  main.forefind-industry .page-hero   { background-image: url('../images/banners/industry-mobile.webp'); }
  main.forefind-investment .page-hero { background-image: url('../images/banners/investment-mobile.webp'); }
  main.forefind-locations .page-hero  { background-image: url('../images/banners/locations-mobile.webp'); }
  main.forefind-popular .page-hero    { background-image: url('../images/banners/popular-mobile.webp'); }
  main.forefind-page .page-hero-content > *,
  main.forefind-investment .page-hero-content .spectrum-wrap { max-width: none; }
  main.forefind-home .hero-inner > *,
  main.forefind-home .hero-inner > .hero-search,
  main.forefind-home .hero-inner > .hero-quick { max-width: none; }
  main.forefind-home .hero-bg-img { object-position: center top; }
}

/* ── MOBILE LAYOUT FIXES ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Hero content had no side padding on some pages (Locations ran edge to
     edge) and doubled it on others: one gutter, set on the content. */
  main.forefind-page .page-hero { padding: 0; }
  main.forefind-page .page-hero-content { padding: 36px var(--ff-gutter) 32px; margin: 0; width: 100%; }

  /* Home search: the stacked rows need hairlines that show on white. */
  main.forefind-home .hs-field { border-bottom-color: #EEF1F5; }
  main.forefind-home .hero-search .hs-label { width: 64px; flex: 0 0 64px; }

  /* Section headings: title, intro and "View all" stack instead of
     squeezing the title into a narrow column beside the link. */
  main.forefind-page .sec-hd,
  main.forefind-page .sec-header,
  main.forefind-page .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* Listing cards and testimonials: one swipeable row instead of a column
     of full-height cards (the home page was ~14,500px tall on a phone). */
  main.forefind-page .lcard-grid,
  main.forefind-home .testi-grid {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 82%;
    gap: 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin-left: calc(var(--ff-gutter) * -1);
    margin-right: calc(var(--ff-gutter) * -1);
    padding: 4px var(--ff-gutter) 14px;
    scroll-padding: 0 var(--ff-gutter);
    scrollbar-width: none;
  }
  main.forefind-page .lcard-grid::-webkit-scrollbar,
  main.forefind-home .testi-grid::-webkit-scrollbar { display: none; }
  main.forefind-page .lcard-grid > *,
  main.forefind-home .testi-grid > * { scroll-snap-align: start; min-width: 0; }
}

@media (max-width: 480px) {
  /* Home hero stats: 2 x 2, not four full-width rows. */
  main.forefind-home .hero-stats { grid-template-columns: repeat(2, 1fr); }
  main.forefind-home .hstat { padding: 16px 0 16px 18px; border-right: 1px solid var(--ffb-line); }
  main.forefind-home .hstat + .hstat { border-top: 0; }
  main.forefind-home .hstat:nth-child(odd) { padding-left: 0; }
  main.forefind-home .hstat:nth-child(even) { border-right: none; }
  main.forefind-home .hstat:nth-child(n+3) { border-top: 1px solid var(--ffb-line); }
  main.forefind-home .hstat-val { font-size: 22px; }

  /* Home "Franchises near you": two cities per row. */
  main.forefind-home .city-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Locations: states and the city directory in two columns instead of
     131 full-width rows. */
  main.forefind-locations .state-grid,
  main.forefind-locations .city-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  main.forefind-locations .loc-block__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main.forefind-locations .city-link,
  main.forefind-locations .state-card { min-width: 0; }
  main.forefind-locations .city-link-name,
  main.forefind-locations .state-name { overflow-wrap: anywhere; }

  /* Industry/Locations hero stats: three across, compact. */
  main.forefind-page .page-hero .hero-stats-row,
  main.forefind-page .page-hero .hero-stats { gap: 22px; }
}
