/**
 * The Traffic Plans Company - Site Search (THEA-706)
 *
 * Shared by the menu search (every page that links this file) and the
 * results page (search.html). Everything reused by reference:
 *   design-tokens.css / components.css   - furniture, bands, buttons
 *   homepage.css                         - header, burger menu (.tpc-menu),
 *                                           dock, footer, .render-placeholder
 *   knowledge-hub.css                    - .tpc-kh-gcard tile, .tpc-kh-tag,
 *                                           .tpc-kh-suggest dropdown visual
 *                                           language (copied, not linked
 *                                           into a cross-type dropdown: see
 *                                           the .tpc-search-suggest rules
 *                                           below, which are the same shape
 *                                           with a type pill in place of the
 *                                           topic-number circle)
 *   blog.css                             - .tpc-shero--sub (30vh sub-page
 *                                           hero tier), .tpc-blog-grid
 *
 * This file adds only what is genuinely new: the menu's own search row
 * (scoped to .tpc-menu--has-search so it cannot affect any other page's
 * copy of the menu), the cross-type suggest dropdown, and the results-page
 * panel (section headers, result rows, no-results/empty states).
 *
 * FOCUS RINGS - founder rejected the hub search's hard 3px asphalt ring
 * (knowledge-hub.css v3.1); every focus state here is the same soft white
 * or orange halo, never a hard outline (PROJECT-DECISIONS.md s5, this
 * brief's own CTA/focus rule).
 */

/* ─────────────────────────────────────────────────────────────────────
   MENU SEARCH ROW - lives in .tpc-menu__nav, above "More to explore", only
   on a menu carrying .tpc-menu--has-search (i.e. only on the pages this
   task wires it into: blog.html, search.html). The row costs real height
   inside a panel that does not scroll (homepage.css: ".tpc-menu__inner...
   overflow is HIDDEN, not auto... If content ever outgrows the panel the
   answer is to size the content down"), so the nav list's own padding is
   trimmed by the same amount this row adds (measured: 44px row + 14px
   margin added, 8px x 7 links + 6px footer padding recovered = kept inside
   one non-scrolling viewport at 1440x900 and 390x844, see THEA-706 hand-
   back for the render-check that confirmed it). Scoped to the modifier
   class rather than touching the shared .tpc-menu__nav-link rule, so every
   OTHER page's menu (not yet wired into search) is completely unaffected.
   ───────────────────────────────────────────────────────────────────── */
/* v1.1 - founder 2026-10-06: "can we move the search bar to sit on the
   same y axis as the cta's and the logo" / "the more to explore text needs
   to sit on the same y axis as the choose a service text". The row now
   lives in .tpc-menu__bar. The bar's right track (the nav column) is
   already full at 1440 (the CTA pair needs 376px of the 371px before the
   close X, homepage.css v10.50), so the field sits in the LEFT track with
   the logo, right-aligned to the tiles' right edge, and the logo and the
   field share that one grid cell. Same 48px height and same top as the
   CTAs and the close X ((logo - 48) / 2, the CTAs' own formula), so all
   four sit on one line. Out of the nav, "More to explore" is back at the
   top of its column, level with "Choose a service", and the nav keeps the
   site's normal link spacing (the v1.0 trims are no longer needed on
   desktop). */
.tpc-menu--has-search .tpc-menu__bar-mark { grid-area: 1 / 1; }
.tpc-menu--has-search .tpc-menu__bar-actions { grid-area: 1 / 2; }
.tpc-menu__search-row {
  grid-area: 1 / 1;
  justify-self: end;
  align-self: start;
  /* v1.2 - founder 2026-10-06: "can the search bar be left aligned to the
     bigger tile underneath?". The field shares the tiles' track (its right
     edge already meets theirs), so its width is the TMP & TGS tile's own
     share of that track: homepage.css .tpc-menu__tiles is
     `1fr 1.35fr` with a space-4 gap, so the wide tile is
     (track - gap) x 1.35 / 2.35. Derived, not measured: both edges hold
     at every desktop width. Keep in step if that grid ever changes. */
  width: calc((100% - var(--primitive-space-4)) * 1.35 / 2.35);
  margin-top: calc((clamp(56px, 3.4vw, 64px) - 48px) / 2);
}
.tpc-menu__search-row .tpc-site-search { position: relative; }

/* Below 1024 the panel stacks to one column and the bar keeps only the
   logo beside the close X, so the field drops to its own full-width row
   under the bar. The panel does not scroll (homepage.css), so the v1.0
   trims that pay for that row's height come back here only. */
@media (max-width: 1024px) {
  .tpc-menu__search-row {
    grid-area: 2 / 1 / 3 / -1;
    justify-self: stretch;
    width: auto;
    margin-top: var(--primitive-space-4);
    /* the bar keeps 72px of right padding to clear the fixed close X; the
       field sits BELOW the X, so it takes that space back and spans the
       same width as the tiles under it (founder 2026-10-06, mobile fix) */
    margin-right: -72px;
  }
  .tpc-menu--has-search .tpc-menu__nav-link { padding-block: 6px; }
  .tpc-menu--has-search .tpc-menu__footer { padding-top: 10px; }
}
/* homepage.css pads the stacked tiles column down to clear the fixed close X.
   With the search row in the bar, the bar already runs below the X, so that
   clearance only left an empty gap above "Choose a service". */
@media (max-width: 1023px) {
  .tpc-menu--has-search .tpc-menu__tiles-col { padding-top: 0; }
}
.tpc-site-search__icon {
  position: absolute;
  left: var(--primitive-space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--primitive-ink);
  opacity: 0.6;
  pointer-events: none;
}
.tpc-site-search__input {
  width: 100%;
  min-height: 48px;
  padding: 10px var(--primitive-space-4) 10px 42px;
  border-radius: 999px;
  border: none;
  background: var(--primitive-panel-grey);
  color: var(--primitive-asphalt);
  font-family: var(--primitive-font-family);
  font-size: 15px;
}
.tpc-site-search__input::placeholder { color: rgba(65, 65, 66, 0.6); }
.tpc-site-search__input:focus,
.tpc-site-search__input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primitive-orange) 30%, white);
}
/* The visible "Search" label from the lo-fi search block, kept for
   screen readers (the icon-only field reads fine with aria-label too, but
   a REAL <label> costs nothing and the lo-fi already has the word). */
.tpc-site-search__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tpc-site-search__submit {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: var(--primitive-orange);
  color: var(--primitive-white);
  cursor: pointer;
}
.tpc-site-search__submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primitive-orange) 30%, white);
}


/* ─────────────────────────────────────────────────────────────────────
   HERO SEARCH (search.html only) - same field, bigger, white-on-orange
   pill like the Knowledge Hub's (knowledge-hub.css .tpc-kh-hero__search*),
   copied rather than linked across because this page does not carry the
   hub's own hero markup. Byte-identical sizing (52px, 46px left padding).
   ───────────────────────────────────────────────────────────────────── */
.tpc-search-hero__search {
  position: relative;
  max-width: 560px;
  margin-top: var(--primitive-space-5);
}
.tpc-search-hero__search-icon {
  position: absolute;
  left: var(--primitive-space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--primitive-ink);
  opacity: 0.6;
  pointer-events: none;
}
.tpc-search-hero__search-input {
  width: 100%;
  min-height: 52px;
  padding: 12px var(--primitive-space-4) 12px 46px;
  border-radius: 999px;
  border: none;
  background: var(--primitive-white);
  color: var(--primitive-asphalt);
  font-family: var(--primitive-font-family);
  font-size: 16px;
  box-shadow: 0 8px 24px rgba(34, 34, 34, 0.16);
}
.tpc-search-hero__search-input::placeholder { color: rgba(65, 65, 66, 0.6); }
.tpc-search-hero__search-input:focus,
.tpc-search-hero__search-input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.55), 0 8px 24px rgba(34, 34, 34, 0.16);
}

/* ─────────────────────────────────────────────────────────────────────
   SUGGEST DROPDOWN - same shape as the hub's .tpc-kh-suggest (copied: this
   one is cross-type, so the topic-number circle is a TYPE PILL instead).
   Appended to <body> (never inside the menu, which clips, or the hero,
   which the hub's own comment notes is overflow:clip for its figure crop).
   ───────────────────────────────────────────────────────────────────── */
.tpc-search-suggest {
  position: absolute;
  z-index: 150;
  background: var(--primitive-white);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(34, 34, 34, 0.22), 0 2px 6px rgba(34, 34, 34, 0.08);
  padding: 8px;
  max-height: min(440px, 62vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity var(--primitive-duration-fast) var(--primitive-easing-out),
              transform var(--primitive-duration-fast) var(--primitive-easing-out);
}
.tpc-search-suggest[hidden] { display: none; }
.tpc-search-suggest.is-open { opacity: 1; transform: none; }
.tpc-search-suggest__count { margin: 0; padding: 8px 12px 6px; font-size: 12.5px; color: rgba(65, 65, 66, 0.8); }
.tpc-search-suggest__count[hidden] { display: none; }
.tpc-search-suggest__list { list-style: none; margin: 0; padding: 0; }
/* v1.3 - the type pill sits in a FIXED first column (the width of the
   longest pill, "KNOWLEDGE HUB", 131px at 11px/800) so every title starts
   on one line, as the hub's dropdown does with its number badges. Each row
   is its own grid, so `auto` let the titles jump between pill widths. */
.tpc-search-suggest__item {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background-color var(--primitive-duration-fast) var(--primitive-easing-out);
}
.tpc-search-suggest__item[aria-selected="true"] { background: color-mix(in srgb, var(--primitive-orange) 13%, white); }
.tpc-search-suggest__type {
  justify-self: start;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--primitive-panel-grey);
  color: var(--primitive-asphalt);
  white-space: nowrap;
}
/* v1.4 - founder 2026-10-06: "the tag on the left needs to be a different
   colour for each area (service, page, knowledge hub etc)". One colour per
   area, all from the brand profile's palette, used in the dropdown AND on
   the results page rows so an area reads the same everywhere:
     Service        Workwear Navy  #26374F, white text   (12.1:1)
     Page           Hi-Vis Yellow  #D6DD2E, white text   (1.47:1)
     Knowledge Hub  Aussie Sky     #589FDF, white text   (2.82:1)
     Blog           TPC Orange (token), white text, the same pill as the
                    blog's own category tags (site orange rule, 2.31:1)
   v1.5 - founder 2026-10-06: "all text in that tag we just updated needs
   to be white". Every pill now carries WHITE text, the founder's call,
   knowingly under AA on the yellow and the sky (ratios above), same as
   the site's orange rule. Do not "fix" them back to asphalt.
   Imagery colours, used here as small filled labels, never as CTAs. The
   pill keeps its colour when its row is highlighted (the row's own tint
   shows the selection), so the colour never stops meaning the area. */
.tpc-search-suggest__type[data-type="service"],
.tpc-search-row__type[data-type="service"]       { background: #26374F; color: var(--primitive-white); }
.tpc-search-suggest__type[data-type="page"],
.tpc-search-row__type[data-type="page"]          { background: #D6DD2E; color: var(--primitive-white); }
.tpc-search-suggest__type[data-type="knowledge-hub"],
.tpc-search-row__type[data-type="knowledge-hub"] { background: #589FDF; color: var(--primitive-white); }
.tpc-search-suggest__type[data-type="blog"],
.tpc-search-row__type[data-type="blog"]          { background: var(--primitive-orange); color: var(--primitive-white); }
.tpc-search-suggest__text { display: block; min-width: 0; }
.tpc-search-suggest__title { display: block; font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--primitive-asphalt); }
.tpc-search-suggest__desc { display: block; font-size: 12.5px; color: var(--primitive-ink); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpc-search-suggest mark { background: color-mix(in srgb, var(--primitive-orange) 32%, white); color: inherit; border-radius: 3px; padding: 0 1px; }
.tpc-search-suggest__empty { margin: 0; padding: 14px; font-size: 14.5px; line-height: 1.5; color: var(--primitive-ink); }
.tpc-search-suggest__empty[hidden] { display: none; }
.tpc-search-suggest__empty a { color: var(--primitive-asphalt); text-decoration: underline; text-decoration-color: var(--primitive-orange); text-decoration-thickness: 2px; }
@media (max-width: 480px) {
  .tpc-search-suggest__item { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { .tpc-search-suggest { transition-duration: 0.01ms; } }

/* THEA-868 MOBILE FIX - the dropdown (max-height 440px, appended to <body>,
   z-index 150) legitimately sits ABOVE the menu's video tile grid (z-index
   95 - confirmed via computed style, not a stacking bug), but it does not
   cover the whole non-scrolling panel. Whatever row the dropdown's own
   overflow clip lands on is a partial row (the normal "there is more,
   scroll" affordance of any dropdown), and at 390px that clip boundary
   falls mid-way down the tile grid, so the cut-off row's text sat directly
   against a busy autoplaying video tile with nothing between them - no
   z-index issue, just two different pieces of content touching with zero
   visual separation. A bigger buffer inside the scrollable box does not
   help: whatever is visible at scrollTop:0 is bounded by max-height
   regardless of the box's own trailing padding, which only affects the
   very end of the list once scrolled all the way down.
   FIX: dim the rest of the menu (tiles + nav) while the dropdown is open,
   so the backdrop behind any partial row is muted rather than a full-
   contrast photo competing with the result text. :has() is already used
   elsewhere in this file (line ~355); same support bar. Mobile-only -
   desktop's dropdown opens over a static two-column layout, not a video
   tile grid, so it never showed this collision. */
@media (max-width: 699px) {
  body:has(.tpc-search-suggest.is-open) .tpc-menu__tiles-col,
  body:has(.tpc-search-suggest.is-open) .tpc-menu__nav {
    opacity: 0.25;
    transition: opacity var(--primitive-duration-fast) var(--primitive-easing-out);
  }
}
@media (max-width: 699px) and (prefers-reduced-motion: reduce) {
  body:has(.tpc-search-suggest.is-open) .tpc-menu__tiles-col,
  body:has(.tpc-search-suggest.is-open) .tpc-menu__nav { transition: none; }
}

/* ─────────────────────────────────────────────────────────────────────
   RESULTS PAGE - section-grouped rows inside the shared .tpc-kh-panel
   (band-panel_grey ground, white panel: same as the hub/blog). Tiles reuse
   .tpc-kh-gcard/.tpc-blog-grid by reference; this adds only the section
   header and the type pill, plus the compact-row alternative used for
   Page/Service results (see search.html's own comment for why).
   ───────────────────────────────────────────────────────────────────── */
.tpc-search-results__group + .tpc-search-results__group { margin-top: var(--primitive-space-8); }
.tpc-search-results__group-head {
  display: flex;
  align-items: baseline;
  gap: var(--primitive-space-3);
  margin: 0 0 var(--primitive-space-5);
}
.tpc-search-results__group-title { font-size: 20px; font-weight: 800; color: var(--primitive-asphalt); margin: 0; }
.tpc-search-results__group-count { font-size: 14px; color: var(--primitive-ink); }

/* Compact row - Page/Service results: a title link plus its own locked
   meta description, no cover image (brief's sanctioned "one content-led
   difference": these aren't cards with their own imagery in the lo-fi,
   unlike Knowledge Hub/Blog, which already have the gcard tile built). */
.tpc-search-row-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tpc-search-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--primitive-space-4);
  align-items: start;
  padding: var(--primitive-space-4);
  border-radius: 16px;
  transition: background-color var(--primitive-duration-fast) var(--primitive-easing-out);
}
.tpc-search-row:hover { background: var(--primitive-panel-grey); }
.tpc-search-row__type {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--primitive-panel-grey);
  color: var(--primitive-asphalt);
  white-space: nowrap;
}
.tpc-search-row__title { font-size: 17px; font-weight: 700; line-height: 1.35; margin: 0; }
.tpc-search-row__title a { color: var(--primitive-asphalt); text-decoration: none; }
.tpc-search-row__title a:hover,
.tpc-search-row__title a:focus-visible { color: var(--primitive-orange); }
.tpc-search-row__desc { font-size: 15px; line-height: 1.55; color: var(--primitive-ink); margin: 4px 0 0; }
.tpc-search-row mark { background: color-mix(in srgb, var(--primitive-orange) 32%, white); color: inherit; border-radius: 3px; padding: 0 1px; }

.tpc-search-results__empty-query {
  text-align: center;
  padding: var(--primitive-space-7) 0;
  color: var(--primitive-ink);
  font-size: 16px;
}
.tpc-search-noresults { text-align: center; font-size: 16px; color: var(--primitive-ink); padding: var(--primitive-space-7) 0; }
.tpc-search-noresults a { color: var(--primitive-asphalt); text-decoration: underline; text-decoration-color: var(--primitive-orange); }

/* v1.7 - the result count lives inside the hero search bar, right-aligned,
   beside the term it counts (founder 2026-10-06 disliked it as a loose line
   between the H1 and the field). Muted ink with the number in asphalt; the
   field's right padding keeps typed text from running under it, and the
   count hides while the field holds a term that has not been searched yet. */
.tpc-search-hero__count {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: rgba(65, 65, 66, 0.75);
  white-space: nowrap;
  pointer-events: none;
}
.tpc-search-hero__count[hidden] { display: none; }
.tpc-search-hero__count strong { color: var(--primitive-asphalt); font-weight: 700; }
.tpc-search-hero__search:has(.tpc-search-hero__count:not([hidden])) .tpc-search-hero__search-input { padding-right: 116px; }

/* Results rise in with the hub's own 70ms stagger (knowledge-hub.css
   @keyframes tpc-kh-rise, linked into this page - not redeclared). Fresh
   DOM nodes on every render (innerHTML replace, see site-search.js), so
   the animation always plays, the same "display:none restarts it" effect
   the hub gets from toggling an existing node, without needing that
   toggle here. */
.search-js #tpc-search-results[data-rendered] .tpc-kh-gcard,
.search-js #tpc-search-results[data-rendered] .tpc-search-row {
  animation: tpc-kh-rise var(--primitive-duration-mid) var(--primitive-easing-out) both;
  animation-delay: calc(80ms + var(--i, 0) * 70ms);
}
@media (prefers-reduced-motion: reduce) {
  .search-js #tpc-search-results[data-rendered] .tpc-kh-gcard,
  .search-js #tpc-search-results[data-rendered] .tpc-search-row { animation: none; }
}

noscript .tpc-search-noscript {
  display: block;
  text-align: center;
  padding: var(--primitive-space-7) 0;
  color: var(--primitive-ink);
  font-size: 16px;
}

/* ─────────────────────────────────────────────────────────────────────
   v1.6 - RESULTS CAROUSEL (founder 2026-10-06: "instead of making the page
   super long vertical wise, can we please make the knowledge hub and blog
   fields a carousel slider so it sits on 1 row per field").
   Knowledge Hub and Blog results are one horizontal row each: three tiles
   per view on desktop (the blog grid's own width and gaps), two at 1024,
   one and a peek at 640. The track is a column-flow grid with four shared
   rows, so the hub tile's subgrid still lines up labels, summaries, dates
   and "Read article" across every tile. Native scroll with snap, so touch,
   trackpad and tabbing to a tile all work without JS; the buttons page one
   view at a time. The track's overflow would clip the tile hover lift and
   the label shadow, so it carries its own padding and a matching negative
   margin, which keeps the tiles on the panel's content edge.
   ───────────────────────────────────────────────────────────────────── */
.tpc-search-carousel { position: relative; }
.tpc-search-carousel__track {
  --tpc-car-gap: var(--primitive-space-5);
  --tpc-car-per: 3;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(4, auto);
  grid-auto-columns: calc((100% - (var(--tpc-car-per) - 1) * var(--tpc-car-gap)) / var(--tpc-car-per));
  column-gap: var(--tpc-car-gap);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 14px;
  scrollbar-width: none;
  padding: 10px 14px 24px;
  margin: -10px -14px -24px;
}
.tpc-search-carousel__track::-webkit-scrollbar { display: none; }
.tpc-search-carousel__track > .tpc-kh-gcard { grid-row: span 4; scroll-snap-align: start; }
/* A tile without a date (hub articles, an undated post) has one row fewer;
   "Read article" is pinned to the last shared row so it keeps one baseline
   across the whole carousel. */
.tpc-search-carousel__track .tpc-kh-gcard__meta { grid-row: 4; }
@media (max-width: 1024px) { .tpc-search-carousel__track { --tpc-car-per: 2; } }
/* FOUNDER 2026-10-22: one tile in frame and centred on mobile, sitewide.
   1.15 deliberately showed a sliver of the next card as a swipe cue; the
   founder's call is a single full-width tile instead. Snap alignment moves
   to center to match every other carousel on the site. */
@media (max-width: 640px)  { .tpc-search-carousel__track { --tpc-car-per: 1; --tpc-car-gap: var(--primitive-space-4); }
  .tpc-search-carousel__track > .tpc-kh-gcard { scroll-snap-align: center; } }

/* Prev / next: filled discs in the group head, never outlined (site rule),
   soft halo on focus. Panel grey with an asphalt chevron at rest; orange
   with a WHITE chevron on hover, as every orange control on the site. */
.tpc-search-carousel__nav { display: flex; gap: var(--primitive-space-2); margin-left: auto; align-self: center; }
.tpc-search-carousel__nav[hidden] { display: none; }
.tpc-search-carousel__btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primitive-panel-grey);
  color: var(--primitive-asphalt);
  cursor: pointer;
  transition: background-color var(--primitive-duration-fast) var(--primitive-easing-out),
              color var(--primitive-duration-fast) var(--primitive-easing-out),
              opacity var(--primitive-duration-fast) var(--primitive-easing-out);
}
.tpc-search-carousel__btn:hover:not(:disabled) { background: var(--primitive-orange); color: var(--primitive-white); }
.tpc-search-carousel__btn:focus-visible { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--primitive-orange) 30%, white); }
.tpc-search-carousel__btn:disabled { opacity: 0.35; cursor: default; }
@media (prefers-reduced-motion: reduce) { .tpc-search-carousel__track { scroll-behavior: auto; } }

/* ─────────────────────────────────────────────────────────────────────
   v1.8 - CLEAR CONTROL (founder 2026-10-06: "i don't like the blue cross
   can we find another alternative in terms of positioning and colour").
   The blue cross was WebKit's native search-cancel button; it is hidden
   on every site search field and replaced by one filled disc, panel grey
   with an asphalt cross, orange with a white cross on hover (the site's
   orange rule), soft halo on focus, never outlined. Position: the far
   right end of the hero bar, with the result count moved to its left so
   the bar reads term ... count, clear; in the menu bar it sits just left
   of the orange search button. Shown only while the field has text.
   ───────────────────────────────────────────────────────────────────── */
.tpc-site-search__input::-webkit-search-cancel-button,
.tpc-search-hero__search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.tpc-search-clear {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primitive-panel-grey);
  color: var(--primitive-asphalt);
  cursor: pointer;
  transition: background-color var(--primitive-duration-fast) var(--primitive-easing-out),
              color var(--primitive-duration-fast) var(--primitive-easing-out);
}
.tpc-search-clear[hidden] { display: none; }
.tpc-search-clear:hover { background: var(--primitive-orange); color: var(--primitive-white); }
.tpc-search-clear:focus-visible { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--primitive-orange) 30%, white); }
/* hero bar: clear at the right end, count to its left */
.tpc-search-hero__search .tpc-search-clear { right: 12px; }
.tpc-search-hero__search.has-value .tpc-search-hero__count { right: 52px; }
.tpc-search-hero__search.has-value .tpc-search-hero__search-input { padding-right: 52px; }
.tpc-search-hero__search.has-value:has(.tpc-search-hero__count:not([hidden])) .tpc-search-hero__search-input { padding-right: 148px; }
/* menu bar: the grey field needs a white disc to read; left of the submit */
.tpc-site-search .tpc-search-clear { right: 50px; background: var(--primitive-white); }
.tpc-site-search .tpc-search-clear:hover { background: var(--primitive-orange); }
.tpc-site-search__input { padding-right: 52px; }
.tpc-site-search.has-value .tpc-site-search__input { padding-right: 88px; }

/* ─────────────────────────────────────────────────────────────────────
   THEA-833 - MOBILE PARITY PASS, search.html.
   .tpc-search-row (Service/Page compact results) is `grid-template-
   columns: auto minmax(0,1fr)`, where the "auto" pill column sizes to
   its own longest label ("KNOWLEDGE HUB" white-space:nowrap). Combined
   with the .tpc-kh-panel width-starvation fixed in blog.css for this
   whole page family, the pill-plus-text row still only has ~120-150px
   left for the excerpt once the pill and its gap are subtracted at
   390px, so multi-word labels wrap body copy into a 2-3-word-per-line
   column - confirmed on "Construction Traffic Management Plans (CTMP)"
   at 390px. The dropdown version of this exact row
   (.tpc-search-suggest__item) already solved the same problem at
   <=480px by stacking to one column; reusing that proven answer here
   instead of inventing a second mechanism, just at this page's own
   699px mobile-parity breakpoint.
   ───────────────────────────────────────────────────────────────────── */
@media (max-width: 699px) {
  .tpc-search-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .tpc-search-row__type { justify-self: start; }
}
