/* ===================================================================
   ea/listing — the catalogue's card and its containers.

   Ported from two mockup files, and the split is the point:

     css/parts/ea-service-card.css §5.33   the card's shared core
     css/pages/alternatives-to.css §7, §8  the catalogue's own grid, its
                                           overrides and the A-to-Z shell

   THE EMPTY STATE WAS THE THIRD AND IS NO LONGER HERE. It went back to its own
   mockup part, `css/parts/ea-empty.css` §5.25, on 2026-09-09, because three
   surfaces besides the catalogue draw it and none of them loads this file. §6
   below is the pointer.

   WHAT THIS FILE DELIBERATELY DOES NOT DECLARE, so nothing owns a rule twice.
   `.ea-cell` and its shell belong to blocks/service-list/style.css. `.ea-grid`
   belongs to blocks/category-cards/style.css, which sets the three-column
   default and the front page's own 1023 and 639 steps; the catalogue's ladder
   differs at one step (679 rather than 639), so the two rules it needs are
   spelled `.ea-results .ea-grid` at (0,2,0) and win on specificity rather than
   on source order. `.ea-cluster` and its head belong to
   blocks/cluster-band/style.css. `.ea-filter` and the mobile sheet belong to
   css/parts/ea-filter.css. `.ea-pager` is drawn by nothing on this page.

   `05 §3.4` measured 49 selectors declared in two or more page stylesheets, of
   which nine names were two different objects. A second bare `.ea-grid` would
   have been the tenth.

   THE HOVER EXCHANGE'S SCRIPT LANDED (round 18, client item T4). It is
   `blocks/listing/view.js` §3, the merge of `js/pages/filter.js` §8 and
   `js/pages/country-single.js`, and `ea_listing_promise_markup()` now emits the
   three `hidden` spans it reveals. The prediction the old note made held: it was
   a script plus three spans, and the two rules missing from this file were the
   `is-revealing` pair in §3b below.
   ==================================================================*/

/* -------------------------------------------------------------------
   §1 THE WRAPPER

   NO STYLES, AND THAT IS THE RULE RATHER THAN AN OMISSION. `05 §2.4` rule 5:
   a sticky box is released by its containing block, so the bar and the results
   have to share one wrapper, and the wrapper must carry no `overflow`,
   `contain` or `transform`, each of which breaks the sticky outright rather
   than bounding it. The declaration below is the only safe one.
   -------------------------------------------------------------------*/
.ea-catalogue {
    display: block;
}

/* -------------------------------------------------------------------
   §2 THE GRID, at this page's own column ladder

   Two columns down to 680, derived from the card's floor and not from a device
   width (01 §6.2a): the meta line binds at 279px, so the floor is 300px.
   -------------------------------------------------------------------*/
@media (max-width: 1023px) {
    .ea-results .ea-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--ea-s5);
        row-gap: var(--ea-s3);
    }
}
@media (max-width: 679px) {
    .ea-results .ea-grid {
        grid-template-columns: minmax(0, 1fr);
        column-gap: 0;
        row-gap: var(--ea-s2);
    }
}

/* -------------------------------------------------------------------
   §3 THE CARD (§5.33 plus alternatives-to.css §7)

   The card is `class="ea-cell ea-service-card"`. Do not add a title-row
   `minmax()` or a cell `min-height`: the 48px logo spans both head rows and
   fixes the height, which is what makes one-card-height-per-width structural
   rather than a property of the demo copy (rule 2).
   -------------------------------------------------------------------*/
.ea-service-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
        "logo title"
        "logo origin"
        "desc desc"
        "foot foot";
    column-gap: var(--ea-s3);
}
/* `.ea-service-card[hidden]`, `__logo`, `__title`, `__origin`, `__flag`,
   `__foot`, the `__promise` base and the whole exchange family are NOT here.
   They are css/parts/ea-service-card.css, registered as the `ea-service-card`
   handle in ea-taxonomies.php, which this block's block.json names as a
   dependency. That file was written for this consumer and says so: "the build
   record asks for that component's class names verbatim so one partial can
   serve both listing templates", and until this block landed it matched
   nothing on the portal. It now does.

   What stays below is the set the mockup's own page file kept, and it kept it
   because it was measured DIFFERENT from its two siblings rather than because
   it was convenient.
   -------------------------------------------------------------------*/

/* An unknown value is STATED, not omitted and not drawn (01 §2.10, rule 12).
   `font-style` alone here: the two taxonomy listings state it differently and
   reconciling the three needs the client's ruling, so nothing was unified.
   Round 19 gave that ruling for ONE of the three, the promise line, and its
   size and colour are now set in css/parts/ea-service-card.css beside the
   label they have to match. The origin line's "Country not known" is still
   sized by its own context and the client has not raised it. */
.ea-service-card__unknown {
    font-style: italic;
}

/* THE TWO WORDINGS OF THE EMPTY PROMISE (round 19, item AT5). The long one is
   the default because it is the one the signed-off desktop card shows; the
   compact card below swaps them. Written as a pair rather than as one span with
   a `::after`, because the German short form is not a truncation of the German
   long form and a generated string cannot be translated. */
.ea-service-card__unknown-short {
    display: none;
}

/* The clamp and the caption leading are `.ea-cell__desc`, which reaches this
   page through blocks/article-furniture/style.css (`ea-cluster-band` depends on
   `ea-category-cards`, which depends on it). */
.ea-service-card__desc {
    grid-area: desc;
    margin: var(--ea-s3) 0 0;
}

/* THE TWO-LINE RESERVE, RESTATED HERE BECAUSE ITS OWNER IS NOT ON THIS PAGE.
   `css/parts/ea-cell.css:77` puts it on the CONTAINER and says why: "a cell
   alone in its row owes nobody that height and cannot know which of the two it
   is." Its deployed home is blocks/service-list/style.css, whose handle
   `ea-service-list` this block's block.json does not name, and the copy of
   `.ea-cell` that does reach this page (article-furniture) carries the clamp
   without the reserve. So `.ea-grid .ea-cell__desc` was undeclared here and the
   ledger lost its level: at 1440 the descriptions measured 0, 22 or 44px and
   the cards 145, 167 or 189px, against one height per width on the mockup.

   NOT FIXED BY ADDING `ea-service-list` TO block.json, which was the other
   option. That handle carries a second, byte-identical copy of the whole
   `.ea-cell` shell plus ~200 lines of listing-row CSS this page never draws,
   and this page already gets that shell from article-furniture, so the catalogue
   would end up owning `.ea-cell` twice.

   WHERE THE TWO COPIES MEET, stated rather than hidden: `search/render.php`
   enqueues `ea-listing` AND `ea-service-list` together, so on /search/ this
   selector and the identical one in blocks/service-list/style.css are both in
   the bundle. Neither resolves against anything there, because that page draws
   `.ea-list` rows and no `.ea-grid` at all (measured 2026-09-05: 41 `.ea-cell`
   elements, zero `.ea-grid`, `.ea-cell__desc` computing `min-height: auto`), so
   the duplication is a selector both sheets carry and not a declaration two
   owners fight over. The clean end state is the move that
   blocks/service-list/style.css and blocks/article-furniture/style.css BOTH ask
   for in their headers, `.ea-cell` and its reserve into ea-content.css, after
   which this rule and the service-list copy are deleted together.

   (0,2,0) AND BEFORE §4, WHICH IS THE WHOLE POINT. The compact card's
   `.ea-grid .ea-service-card__desc { min-height: 36px }` below is the same
   specificity, so it wins on source order and RESIZES the reserve rather than
   dropping it. Raising this to (0,3,0) with `.ea-results` would invert that and
   put a 44px reserve on a 112px phone card. */
.ea-grid .ea-cell__desc {
    min-height: 44px;
}

/* Do not set this in --font-heading: only its 400, 600 and 800 faces are
   loaded, so a 700 request there resolves upward to 800 (01 §4.1). Lato ships
   a real 700. */
.ea-service-card__count {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 26px;
    color: var(--ea-ink-900);
    transition:
        opacity var(--transition-base) var(--ea-alt-ease-opacity),
        margin-right calc(var(--transition-base) / 2) var(--ea-alt-ease-travel);
}
.ea-service-card__promise-label {
    margin-left: var(--ea-s1);
    font-size: 0.82rem;
    color: var(--ea-ink-500);
}
/* The colon is a pseudo-element so it stays out of a copy and out of the
   accessibility tree; in the markup it would give the resting line
   "12 European alternatives:". It holds its 4px at all times, so only its
   opacity moves. */
.ea-service-card__promise-label::after {
    content: ":";
    opacity: 0;
    transition: opacity var(--transition-fast) var(--ea-alt-ease-opacity);
}

/* -------------------------------------------------------------------
   §3b THE REVEAL'S TWO MISSING RULES (client item T4)

   Ported from `css/pages/alternatives-to.css` §157-190. Without them the count
   stays where it is and the three names are laid out AFTER it, so the line
   reads "12 European alternatives Plausible Analytics" and then ellipsises.
   These are what take the count out of the flow, for the length of the reveal
   only.

   `--ea-count-shift` is the label's left edge minus the line's, measured per
   card by view.js §3 on the first hover, with a 0px fallback. Do not collapse
   the count's box instead: an inline-block with `overflow: hidden` takes its
   baseline from its bottom margin edge, 6.8px off.

   The delayed half of the transition is deliberate and is the mockup's: the
   opacity runs over the full `--transition-base`, the margin over half of it
   starting at the halfway point, so the count fades before its space closes and
   the incoming name does not appear to shove it.
   -------------------------------------------------------------------*/
.ea-service-card__promise.is-revealing .ea-service-card__count {
    opacity: 0;
    margin-right: calc(-1 * var(--ea-count-shift, 0px));
    transition:
        opacity var(--transition-base) var(--ea-alt-ease-opacity),
        margin-right calc(var(--transition-base) / 2) var(--ea-alt-ease-travel) calc(var(--transition-base) / 2);
}
.ea-service-card__promise.is-revealing .ea-service-card__promise-label::after {
    opacity: 1;
    transition: opacity var(--transition-fast) var(--ea-alt-ease-opacity) 0.1s;
}

/* -------------------------------------------------------------------
   §3c `.is-off`, THE SORT'S OWN CHANNEL

   Ported from `css/pages/alternatives-to.css:19-24`, whose comment states the
   contract this file has to keep: "`.is-off` and `[hidden]` are two independent
   channels on the same cluster: the script sets `hidden` from the filter and
   `is-off` from the sort mode, so neither may be folded into the other." A
   cluster hidden by the filter and a cluster switched off by the A-to-Z view
   are different facts, and the script has to be able to set and clear each
   without disturbing the other.

   `!important` is the mockup's, and it is what makes the two channels
   independent: `[hidden]` on the same element is (0,1,1) against this (0,1,0),
   so without it a band the filter had hidden would come back the moment the
   sort turned `is-off` off.

   `[hidden]` itself is NOT restated here for any of the four containers. Each
   of `.ea-service-card` (css/parts/ea-service-card.css:58), `.ea-empty`
   (css/parts/ea-empty.css §1), `.ea-cluster` (blocks/cluster-band/style.css, which declares
   padding and background and no `display`) and `.ea-az__group` (§5 below, same)
   already honours the attribute, the first two by an explicit rule and the
   other two because the user-agent's `display: none` has nothing author-level
   to beat.
   -------------------------------------------------------------------*/
.is-off {
    display: none !important;
}

/* -------------------------------------------------------------------
   §4 THE COMPACT CARD, 1023px and below
   -------------------------------------------------------------------*/
@media (max-width: 1023px) {
    .ea-service-card {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "logo title   title"
            "logo origin  promise"
            "desc desc    desc";
        column-gap: var(--ea-s3);
        padding: var(--ea-s3);
    }
    .ea-service-card[hidden] {
        display: none;
    }
    /* 40px, not 48: the logo spans the title and origin rows, 22 + 20 = 42px,
       so anything larger sets the card's height by itself. */
    .ea-service-card__logo {
        width: 40px;
        height: 40px;
        align-self: start;
        font-size: 0.88rem;
    }
    /* `nowrap` is load-bearing: the origin and the count share this row and
       grid gives the flexible track what the auto track leaves, so without it
       the country wraps on the two-digit cards and those rows run 17px taller
       than the rest. */
    .ea-service-card__origin {
        gap: var(--ea-s2);
        flex-wrap: nowrap;
        white-space: nowrap;
        font-size: 0.8rem;
        line-height: 20px;
    }
    /* Spelled at (0,2,0) so the reserve beats `.ea-grid .ea-cell__desc`, which
       is the same specificity and earlier in the cascade. The reserve is not
       dropped here, it is RESIZED to 36. */
    .ea-grid .ea-service-card__desc {
        margin-top: var(--ea-s2);
        -webkit-line-clamp: 2;
        line-clamp: 2;
        font-size: 0.8rem;
        line-height: 18px;
        min-height: 36px;
        color: var(--ea-ink-700);
    }
    /* `display: contents` dissolves the foot row: its child becomes a grid
       item of the card itself, so the count lands in the promise column. */
    .ea-service-card__foot {
        display: contents;
    }
    /* The count and the country share this row and print on ONE baseline,
       which is a line-box question and not a box-top one. The strut is spelled
       at the origin's own 0.8rem so the two struts are identical, and the
       count is taken out of the line-box arithmetic below. Measured on the
       signed-off page over 147 cards: 5px of offset before, 0px after, with
       the card unchanged at 112px. */
    .ea-service-card__promise {
        grid-area: promise;
        align-self: center;
        height: 20px;
        line-height: 20px;
        padding-left: var(--ea-s1);
        font-size: 0.8rem;
    }
    /* `line-height: 0` is what stops the 1rem numeral raising the line box.
       Do not restate it as `20px`, which leaves the numeral's box the tallest
       one on the line, and do not reach for `1` either, which clears the strut
       by 0.76px and would flip on the fallback face. */
    .ea-service-card__count {
        font-size: 1rem;
        line-height: 0;
    }
    /* 2px, not 4: this row has no slack to give. */
    .ea-service-card__promise-label {
        margin-left: 2px;
        font-size: 0.7rem;
    }
    .ea-service-card__alt {
        display: none;
    }
    /* Neutralised, not merely unused: a pointer that entered a card at 1440
       and a window narrowed to 900 leaves `is-revealing` on the line. */
    .ea-service-card__promise.is-revealing .ea-service-card__count {
        opacity: 1;
        margin-right: 0;
    }
    .ea-service-card__promise-label::after {
        content: none;
    }
    /* "European " is in its own span so this rule can drop the word below
       1024, where the meta line has no slack for the full label. */
    .ea-service-card__promise-eu {
        display: none;
    }
    /* THE EMPTY PROMISE SWAPS TO ITS SHORT FORM ON THE SAME BREAKPOINT AND FOR
       THE SAME REASON (round 19, item AT5). Measured at 390 before the change:
       the empty line ran 204px in English and 258px in German where a filled
       card's ran 80 and 84, because the filled card drops "European" here and
       the empty one had nothing to drop. */
    .ea-service-card__unknown-long {
        display: none;
    }
    .ea-service-card__unknown-short {
        display: inline;
    }
    /* The label steps down to 0.7rem in this block, so the sentence that stands
       in for it does too, or the empty card would print the larger of the two
       sizes on the row with the least slack. */
    .ea-service-card__promise .ea-service-card__unknown {
        font-size: 0.7rem;
    }
}

/* -- the wide single column, 600 to 679 ------------------------------ */
@media (min-width: 600px) and (max-width: 679px) {
    .ea-grid .ea-service-card__desc {
        -webkit-line-clamp: 1;
        line-clamp: 1;
        min-height: 18px;
    }
}

/* -------------------------------------------------------------------
   §5 A TO Z MODE

   The same card nodes, reparented into letter groups rather than
   re-rendered, so the DOM a crawler sees in the default mode is the DOM that
   exists. The control that switches to it lives in the filter bar, so nothing
   fills this container in this build. See render.php.
   -------------------------------------------------------------------*/
.ea-az[hidden] {
    display: none;
}
.ea-az__group {
    padding: var(--ea-s6) var(--section-padding-x) var(--ea-s7);
    background: var(--ea-surface);
    /* THE OFFSET IS THE BAR ALONE, and `var(--header-height)` is gone from it
       for two separate reasons that both landed in round 18. The bar is now
       `top: 0` (css/parts/ea-filter.css §5.11d), so the only thing covering an
       anchor target is the bar itself. And `--header-height` was the wrong
       token in any case: ea-content.css §0a records that Blocksy shadows it on
       `<body>` with the DECLARED 120px while the header RENDERS 80, so this
       reserved 199px for a 79px obstruction. */
    scroll-margin-top: var(--ea-bar-h, 0px);
}
.ea-az__group--wash {
    background: var(--ea-blue-050);
}
.ea-az__head {
    position: relative;
    margin-bottom: var(--ea-s5);
    padding-bottom: var(--ea-s3);
    border-bottom: 1px solid var(--ea-line);
}
.ea-az__letter {
    margin: 0;
    color: var(--ea-blue-900);
}

/* -------------------------------------------------------------------
   §6 THE EMPTY STATE — MOVED OUT, AND THIS NOTE IS THE WHOLE SECTION.

   Every `.ea-empty*` rule this file used to declare now lives in
   `css/parts/ea-empty.css`, unchanged. The object is emitted by one function,
   `ea_filter_empty_markup()`, on four surfaces, and only one of them loaded
   this sheet: the two taxonomy archives rendered the panel with no ground, no
   border and no radius at all. `css/pages/category-single.css` §4 had already
   recorded that as "this part has no owner in the deploy tree".

   NOTHING BREAKS FOR THE CATALOGUE OR FOR THE SEARCH PAGE. `ea-enqueue.php`
   declares the new `ea-empty` handle a dependency of `ea-listing`, so both
   surfaces that reach the panel through this handle still receive the rules,
   and receive them BEFORE this file, which is where they were anyway.
   -------------------------------------------------------------------*/

/* -------------------------------------------------------------------
   §7 THE FILTER BAR, THIS PAGE'S OWN MEASUREMENTS

   THESE RULES BELONG IN css/parts/ea-filter.css AND THAT FILE HAS ANOTHER
   OWNER RIGHT NOW, so they are here, scoped to `.ea-catalogue` at (0,2,0) so
   they cannot reach the two taxonomy archives, which draw the same bar from
   the same part sheet and must not move. Ported from
   `css/pages/alternatives-to.css` §5 and §12 and from `css/parts/ea-filter.css`
   §5.26, which this build's copy of that part does not carry. Whoever owns the
   part sheet next should take `.ea-filter__open` and `.ea-filter__switch` off
   this file: they are shared objects wearing a page's scope.

   THE BAR IS 79px FROM 768 UP AND 67 BELOW IT, which is the mockup's own
   number and the reason `--ea-bar-h` is set on the wrapper: `.ea-az__group`
   above already reads it for its scroll offset and was resolving the 0px
   fallback, because until now there was no bar for it to clear.
   -------------------------------------------------------------------*/
.ea-catalogue {
    --ea-bar-h: 79px;
}

/* A WRAP CONSTRAINT, NOT A WIDTH PREFERENCE (the mockup's own words):
   `flex-wrap` places items on a line by their flex BASE size and only shrinks
   them afterwards. 320 is this page's basis against the category page's 240,
   because this bar carries three controls and that one carries six. */
.ea-catalogue .ea-search {
    flex: 1 1 320px;
    min-width: 0;
    max-width: 30rem;
}

/* `css/parts/ea-filter.css` sets `padding: var(--ea-s3) 0 0` and says in as
   many words that the bottom row is each page's own. This is this page's. */
.ea-catalogue .ea-filter__bar {
    padding-bottom: var(--ea-s3);
}

/* The desktop/phone switch for `.ea-filter__switch` and `.ea-filter__open`
   moved to css/parts/ea-filter.css §5.11g when the archives got the sheet too.
   This file's §7 header asked for exactly that move: they are shared objects
   and were only ever wearing this page's scope. */

/* BLOCKSY'S BUTTON SKIN BEATS `.ea-control` ON THIS PAGE AND ONLY ON THIS PAGE,
   which is build trap 27 (a tie on specificity is decided by source order)
   arriving from the theme rather than from us. `[type="submit"]` in Blocksy's
   own sheet is (0,1,0), exactly what `.ea-control` is, and on a composed PAGE
   the theme sheet is emitted after the block sheet, so the Apply button came
   out solid blue with white text. It does NOT happen on the two taxonomy
   archives: measured on /services/web-analytics/ the same button computes
   `rgb(255,255,255)` on `rgb(51,51,51)`, because their page sheets are
   enqueued later in the chain. Restated at (0,3,0) so the one control face is
   the same object on all three surfaces, and NOT changed in
   css/parts/ea-filter.css, which would have moved the archives too.

   Only the five properties the theme actually sets are restated; the rest of
   the face still comes from `.ea-control` and cannot drift. */
.ea-catalogue .ea-filter__bar .ea-control[type="submit"] {
    padding: 0 var(--ea-s3);
    border: 1px solid var(--ea-border-control);
    border-radius: var(--ea-radius-card);
    background-color: var(--ea-surface);
    color: var(--ea-ink-700);
}
.ea-catalogue .ea-filter__bar .ea-control[type="submit"]:hover {
    border-color: var(--ea-blue-700);
    background-color: var(--ea-surface);
    color: var(--ea-ink-700);
}

@media (max-width: 767px) {
    /* -- the collapsed bar (14 §2.5) -----------------------------------
       48 + 8 + 8 = 64, plus the 3px gold rule = the mockup's 67. */
    .ea-catalogue .ea-filter__bar {
        gap: var(--ea-s2);
        padding: var(--ea-s2) 0;
    }
    .ea-catalogue .ea-search {
        flex: 1 1 200px;
        max-width: none;
    }
    .ea-catalogue .ea-search__box {
        height: 48px;
        padding-left: var(--ea-s3);
    }

    /* THE FACET PANEL FLOWS INLINE ON A PHONE INSTEAD OF HANGING OVER THE ROW,
       and this is a correctness rule rather than a taste one. The panel is
       `position: absolute` in css/parts/ea-filter.css, which is right on a
       desktop bar where Categories sits to the LEFT of Sort and Apply. In the
       stacked phone panel it hangs straight down over both of them: measured
       with Playwright, the open panel intercepted every pointer event aimed at
       the Apply button, so a reader who ticked a category could not submit it
       without closing the panel first. Static here, and the row grows instead. */
    .ea-filter__controls .ea-facets__panel {
        position: static;
        min-width: 0;
        max-height: 46vh;
        box-shadow: none;
    }
    .ea-filter__controls .ea-sort__wrap {
        flex: 1 1 auto;
    }
}

@media (max-width: 400px) {
    .ea-catalogue .ea-search {
        flex: 1 1 140px;
    }
    .ea-catalogue .ea-search__box {
        padding-inline: var(--ea-s2);
    }
}
