/* ===================================================================
   European Alternatives, search results (22 §5)

   Ported from concept/mockups/02-site-v1/css/pages/search-results.css.
   Registered as the `ea-search-results` handle in search/render.php and
   enqueued there on `is_search()`, NOT from search.php: a theme template is
   included at `template_include`, long after `wp_head` has printed the head's
   styles, so a `wp_enqueue_style()` written inside it lands in the footer and
   the page paints unstyled first.

   THE HANDLE DECLARES ITS DEPENDENCIES AND THAT IS WHY IT LOADS LAST. Its deps
   are `ea-content`, `ea-search`, `ea-service-list`, `ea-listing`,
   `ea-identity-band` and `ea-closing-band`, which are the six sheets this page
   composes. Nothing below ties any of them on specificity, but build trap 27
   measured a signed-off surface lost on source order alone, so the page sheet
   is placed after the component sheets by declaration rather than by hope.

   Every selector here is this page's own, with ONE stated exception in §3.
   ==================================================================*/

/* ==================================================================
   1. THE MASTHEAD
   ==================================================================*/

/* 560px is the width at which the placeholder "Search a category, a service or
   a tool to replace" sets on one line at 1rem: re-derive it if that string changes. */
.ea-sr-search {
    max-width: 560px;
    margin-top: var(--ea-s4);
}

/* NOT `.ea-search__submit`. blocks/search/style.css states the reason in its own
   comment: folding this onto the shared class would take the white
   `.ea-band :focus-visible` ring rather than the blue one, and this band is
   `--light` rather than `.ea-band`. The two are the same 44px control at the
   same colour and they are deliberately two classes. */
.ea-sr-search__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: none;
    padding: 0;
    border: 0;
    border-radius: var(--ea-radius-card);
    background: var(--ea-blue-700);
    color: #ffffff;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.ea-sr-search__submit:hover {
    background: var(--ea-blue-500);
}
.ea-sr-search__submit:focus-visible {
    outline: 2px solid var(--ea-blue-700);
    outline-offset: 2px;
}
/* WebKit draws a clear affordance INSIDE a `type="search"` input at a size no
   author rule can raise to 44px, in a box that already carries a submit button. */
.ea-search__input::-webkit-search-decoration,
.ea-search__input::-webkit-search-cancel-button {
    appearance: none;
}

/* ==================================================================
   2. THE RESULTS SECTION
   ==================================================================*/
.ea-sr {
    padding: var(--ea-s6) var(--section-padding-x) var(--ea-s7);
}
.ea-sr__shell {
    max-width: var(--site-content-width);
    margin: 0 auto;
}

/* ==================================================================
   3. THE GROUP
   ==================================================================*/
.ea-sr-group + .ea-sr-group {
    margin-top: var(--ea-s7);
}

/* THE ONE SELECTOR HERE THAT IS NOT THIS PAGE'S OWN, AND IT IS A DUPLICATE THIS
   BUILD OWES AN EXTRACTION.

   `.ea-group__head` is a PART (§5.35), which the mockup's own
   css/parts/ea-group-head.css says and which blocks/country-index/style.css
   repeats in its header: "`.ea-crow` (§5.29) and `.ea-group__head` (§5.35) are
   PARTS". In this build the rule lives only inside the country-index BLOCK
   stylesheet, so a template that draws a group head without that block gets no
   rule at all and the count drops onto its own line under the heading.
   Measured on live before this file existed: the three heads grew from 44px to
   85px each.

   Enqueuing `ea-country-index` here would import the rule and ALSO its
   `max-width: 767px` override, which sets `display: block` and whose own
   comment says "search-results keeps the flex row". That override is correct
   for the countries index and wrong for this page, so importing the sheet
   would trade a missing rule for a wrong one below 768.

   So the head is declared here, scoped to `.ea-sr` at (0,2,0) so it beats the
   country-index sheet's (0,1,0) in BOTH directions and cannot be decided by
   source order (build trap 27). It is a second owner for one object and it
   should not stay one: the honest fix is a shared `ea-group-head` handle that
   both consumers name, which needs a file this agent does not own. Recorded in
   concept/wordpress/build/notes-search-parity.md.

   `baseline`, not `center`: the count is 0.88rem beside a heading at 1.5rem and
   centring it hangs it off the heading's optical line. */
.ea-sr .ea-group__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--ea-s4);
    margin-bottom: var(--ea-s4);
    padding-bottom: var(--ea-s3);
    border-bottom: 1px solid var(--ea-line);
}

/* The head itself is css/parts/ea-group-head.css §5.35 and the markup writes
   `.ea-group__head`: it was declared here byte-identically under a second name,
   which is the shape 26 §4 asked to avoid. `__title` and `__count` differ from
   the countries index's and stay. */
.ea-sr-group__title {
    margin: 0;
    font-weight: 600;
    color: var(--ea-blue-900);
}
.ea-sr-group__count {
    flex: none;
    margin: 0;
    font-size: 0.88rem;
    line-height: 22px;
    color: var(--ea-ink-500);
}
.ea-sr-group__more {
    margin: var(--ea-s4) 0 0;
    font-size: 0.88rem;
    line-height: 22px;
}
.ea-sr-group__more a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--ea-blue-700);
    text-underline-offset: 0.18em;
}

/* ==================================================================
   4. THE TWO THINGS A RESULT ROW ADDS
   ==================================================================*/

.ea-sr-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: var(--ea-radius-card);
    background: var(--ea-blue-100);
    color: var(--ea-blue-700);
}

/* THE MATCH HIGHLIGHT, TURNED BACK OFF, AND IT IS A REGRESSION THIS FILE
   INTRODUCED RATHER THAN ONE IT FOUND.

   `search/render.php` wraps the matched substring of every result title in
   `.ea-suggest__hl`, transcribed from `js/pages/search.js:798`, which is the
   SUGGEST PANEL's highlighter. `blocks/search/style.css` gives that class
   `font-weight: 700`, and it is the only one of its 21 `.ea-suggest*` selectors
   that can match here, because every other one needs the panel this page never
   draws. Until 2026-09-05 the span rendered unstyled because no sheet was
   enqueued at all, so the bold arrived the moment `ea-search` was pulled in for
   the masthead field.

   The signed-off page has no highlighting: `ea-suggest__hl` occurs ZERO times in
   `search-results.html` and zero times in `js/pages/search-results.js`, whose own
   header says every result is already in the HTML and nothing there creates a
   node. Measured on the composed page before this rule: 41 titles with a bold
   run inside them, against 0 in the mockup.

   So the weight is reset rather than the markup changed. The span is a hook a
   later phase or the client may want, deleting it would touch the renderer for a
   rendering question, and one scoped declaration is reversible in one line. The
   question of whether the results page should highlight at all is the client's
   and is recorded in concept/wordpress/build/notes-search-parity.md. */
.ea-sr .ea-suggest__hl {
    font-weight: inherit;
}

.ea-sr-meta {
    flex-wrap: wrap;
    gap: 0 var(--ea-s2);
}
.ea-sr-meta__part {
    display: inline-flex;
    align-items: center;
    gap: var(--ea-s2);
    white-space: nowrap;
}
/* THE CLIENT RESTORED THE MOCKUP'S COLOUR ON 2026-09-07, KNOWINGLY.

   This separator had been darkened, with two of its siblings, because a
   rendered `·` is text and WCAG 1.4.3 AA asks 4.5:1 for text on a portal
   that states Level AA. `OPEN-DECISIONS.md` carried the question as A2 and the
   answer was "Bitte wie Mockup umsetzen und Reduktion der Barrierefreiheit in
   Kauf nehmen." So the mockup's value is back and the shortfall is a DECLARED
   DEVIATION the client accepted, not an oversight.

   What that costs, stated rather than left implicit: the inherited ink is `--ea-ink-500` #5b6472, and at `opacity: 0.7` it composites
   over white to rgb(140,147,156), which computes **3.11:1**. Reading `color` alone
   says 5.34:1 and passes, so only a composited measurement sees it at all.

   What it does not cost. The dot stays a pseudo-element, so it is still out of
   the accessibility tree, out of a selection and out of a find-in-page: a
   screen reader still reads two values rather than one run-on string. The
   accessibility loss is confined to the contrast of a decorative glyph whose
   information is carried by the layout either way.

   The standing run WILL report this again under check 1c, pseudo-element
   contrast. That is correct and must not be "fixed": it is the instrument
   working. Attribute it to this deviation rather than reopening it. */
.ea-sr-meta__part:not(:last-child)::after {
    content: "·";
    opacity: 0.7;
}

/* ==================================================================
   5. THE ZERO STATE (24 §3)
   ==================================================================*/

/* Do not move this cap onto `.ea-empty__shell`: a shell cap was removed there for
   moving the state's left edge 166px right of the rest of the page
   (css/parts/ea-empty.css §5.25). */
/* `.ea-sr-empty .ea-empty__what` sat here beside the hint until 2026-09-10 and
   matched nothing: the search zero state stopped emitting `p.ea-empty__what`
   when its "Tell us about a service we are missing" line was dropped on the
   client's ruling. Checked on the rendered zero state in both languages, where
   `ea-empty__what` appears zero times and `ea-empty__hint` once. */
.ea-sr-empty .ea-empty__hint {
    max-width: var(--ea-measure);
    margin-inline: auto;
}

.ea-sr-empty__submit {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.ea-sr-empty__more {
    margin: var(--ea-s4) 0 0;
    font-size: 0.88rem;
    line-height: 22px;
    color: var(--ea-ink-500);
}

/* ==================================================================
   5b. THE EMPTY-QUERY PROMPT, WHICH THE MOCKUP DOES NOT HAVE
   ==================================================================*/

/* THE MOCKUP IS SILENT HERE AND THIS RULE SAYS SO RATHER THAN PRETENDING
   OTHERWISE. `search-results.html` ships two states, a query with results and a
   query with none. `/search/` with no term at all is a third, added by the
   build because core's own route reaches it, and it has no mockup counterpart
   and therefore no ported values.

   Nothing is invented: the three declarations below are the same three
   `.ea-sr-empty__more` carries in §5, which is the mockup's own treatment for a
   quiet sentence under the results region. If the client ever draws this state,
   replace this block rather than extending it. */
.ea-sr-prompt {
    margin: 0;
    font-size: 0.88rem;
    line-height: 22px;
    color: var(--ea-ink-500);
}

/* ==================================================================
   6. THE CLOSING BAND
   ==================================================================*/

/* ea-content.css §5.2 declares `.ea-closing__row` as a two-track grid and
   deliberately leaves the width at which it becomes one track to the page,
   because the corner arc is anchored to the WINDOW and the action column to the
   RAIL. This is that page's number. */
@media (max-width: 999px) {
    .ea-closing__row {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--ea-s6);
        align-items: start;
    }
}

/* -- THE CORNER ARC, RE-SPELLED ONTO THE PSEUDO-ELEMENT -------------
   The mockup writes these two rules against `img.ea-stars--closing-corner`.
   This build has no such element: phase 4 made the arc
   `.ea-closing--stars-closing-corner::before` in blocks/closing-band/style.css,
   for the three reasons that file states. A verbatim port of the mockup's
   selector would therefore be two rules matching nothing, silently, which is
   build trap 47's exact shape.

   The declarations are the mockup's, value for value. The selectors carry this
   page's own `.ea-sr-closing` modifier, passed by search.php, at (0,3,0): the
   base placement in the block sheet is (0,1,0), so these win in both directions
   rather than on source order (build trap 27). `height` follows from the base
   rule's `aspect-ratio: 1`, where the mockup's <img> got it from the asset. */
@media (max-width: 1319px) {
    .ea-sr-closing.ea-closing--stars-closing-corner::before {
        top: auto;
        right: -74px;
        bottom: -98px;
        width: 190px;
        transform: rotate(180deg);
    }
}
/* -- 600 AND BELOW: THE ARC MOVES AGAIN ----------------------------
   The mockup restates this in full at (0,3,0) so it beats the 1319 rule above
   and ea-shared.css §5.5 on specificity rather than on source order. Kept in
   full here for the same reason, and at the same specificity relative to its
   own neighbours: (0,3,0) against the 1319 rule's (0,3,0), decided by source
   order WITHIN this one file, which is the only place source order is safe. */
@media (max-width: 600px) {
    .ea-sr-closing.ea-closing--stars-closing-corner::before {
        top: auto;
        right: -80px;
        bottom: -40px;
        width: 190px;
        transform: rotate(180deg);
    }
}
