/* ===================================================================
   ea/service-list — the grid cell (§5.6) and the listing row (§5.23).

   WHERE THIS CAME FROM. `css/parts/ea-cell.css` and `css/parts/ea-listing-row.css`
   value for value. Both are `css/parts/` files, which ea-content.css's header
   excludes by name: "Each part ships as a per-block stylesheet registered
   through its own block.json and is enqueued on block render, not on every
   page." This is that file for two of them.

   WHY BOTH PARTS ARE IN ONE STYLESHEET. `.ea-cell` is the row's SHELL and
   `.ea-row` is its placement, and §5.23's own comment says so: "The shell is
   `.ea-cell` (§5.6) and is not restated here; this is placement." They are one
   component in two files in the mockup because the mockup ships a cell without
   a row on other pages. Here the block that emits one always emits the other,
   so splitting them would mean two handles that are never enqueued apart.

   WHAT IS NOT HERE. `.ea-logo`, `.ea-logo--40`, `.ea-logo--mono` and `.ea-flag`
   are in ea-content.css §5.10 and §4, which every page loads, so the row's mark
   and its flag are already styled. A second copy here would give those
   declarations two owners.

   ONE PORT ARTEFACT DELIBERATELY DROPPED. `css/pages/article-single.css:200`
   resets `margin-right` on `.ea-flag` inside a meta item, because `ea-base.css`
   gave the primitive an 8px right margin that ea-shared.css redeclared without
   resetting. `ea-base.css` does not ship here and ea-content.css §4's `.ea-flag`
   carries no margin at all, so there is nothing to reset and the rule would be
   dead. Verified by reading §4 rather than assumed.

   THE REM VALUES ARE THE MOCKUP'S AND RESOLVE AT 17px (ref-traps.md item 1c).
   ===================================================================*/

/* -------------------------------------------------------------------
   1. THE GRID CELL (§5.6)

   Composition, not inheritance: a row writes `class="ea-cell ea-row"` on one
   element. The equal-height description reserve is the container's, never the
   cell's.

   The title is INK and not a saturated blue link: the whole cell is already the
   link, and a blue heading inside a bordered clickable cell doubles the click
   signal (25 §2.5). Hover and focus move the border and the ink and NOTHING
   MOVES: no lift, no fill change, no arrow (02 §4).
   ------------------------------------------------------------------- */

.ea-cell {
    position: relative;
    height: 100%;
    padding: var(--ea-s4);
    background: var(--ea-surface);
    border: 1px solid var(--ea-line-strong);
    border-radius: var(--ea-radius-card);
    transition:
        border-color var(--transition-fast),
        color var(--transition-fast);
}
.ea-cell:hover,
.ea-cell:focus-within {
    border-color: var(--ea-blue-700);
}

/* The cell, not the anchor, carries the visible focus ring: the anchor is a
   zero-area box stretched over the cell by `::after`, so a ring on it alone is
   drawn around the text run rather than around the object the keyboard is on. */
.ea-cell:focus-within {
    outline: 2px solid var(--ea-blue-700);
    outline-offset: 2px;
}

.ea-cell__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 22px;
    color: var(--ea-ink-900);
}
.ea-cell:hover .ea-cell__title {
    color: var(--ea-blue-700);
}

/* The stretched link. Its radius has to match the cell's or the hit area
   squares off the corners. */
.ea-cell__link {
    color: inherit;
    text-decoration: none;
}
.ea-cell__link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--ea-radius-card);
}
.ea-cell__link:focus-visible {
    outline: none;
}

.ea-cell__desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    margin: 0;
    font-size: 0.88rem;
    line-height: 22px;
    color: var(--ea-ink-500);
}

/* The two-line reserve is the CONTAINER's, never the cell's: a cell alone in
   its row owes nobody that height and cannot know which of the two it is. It
   lives here on `.ea-grid` and on `.ea-list--grid .ea-row__desc` below. */
.ea-grid .ea-cell__desc {
    min-height: 44px;
}

/* -------------------------------------------------------------------
   2. THE LISTING ROW AT THREE DENSITIES (§5.23, 02 §3, 11 §2.5)

   A list always declares a density: compact is the base at every width,
   `--grid` and `--wide` are additive above 768, and there is no default. The
   partial enforces that by falling back to compact rather than emitting a bare
   `.ea-list`.

   `.ea-row` and `.ea-row__desc` were script hooks in the mockup, read by name
   from js/ea-listing.js. Nothing on this install reads them yet and phase 8's
   search will, so neither may leave the markup.
   ------------------------------------------------------------------- */

.ea-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: var(--ea-s3);
}

/* The <li> is a flex box so its single child fills it. `.ea-cell` carries
   `height: 100%`, which needs a parent with a resolved height, and a grid item
   stretched by its row is that parent. */
.ea-list > li {
    display: flex;
}
.ea-list > li > * {
    flex: 1 1 auto;
    min-width: 0;
}

/* -- the base density: the compact row (02 §3.1) --------------------- */
/* `align-content: start` is a guard: `.ea-cell` is `height: 100%`, so a row in
   a multi-column grid is stretched, the auto tracks absorb the slack and the
   clamped description paints its clipped second line through the card. */
.ea-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-areas:
        "logo title"
        "logo meta"
        "desc desc";
    align-content: start;
    column-gap: var(--ea-s3);
    padding: var(--ea-s3);
}
.ea-row__logo {
    grid-area: logo;
    align-self: start;
}
.ea-row__title {
    grid-area: title;
    align-self: center;
}

/* The anchor's own rect is a 22px line box, because `.ea-cell__link::after` is
   what covers the cell. The inline padding is what carries the hit rect to the
   44px target size; vertical padding would move the row. */
.ea-row__title a {
    padding-block: 11px;
}

/* `.ea-row__meta` is a wrapper that becomes `display: contents` above 768, so
   one markup puts the badges beside the country on a phone and in their own
   grid area above it. */
.ea-row__meta {
    grid-area: meta;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ea-s2);
    margin: 0;
    font-size: 0.82rem;
    line-height: 22px;
    color: var(--ea-ink-500);
}
.ea-row__meta-item {
    display: inline-flex;
    align-items: center;
    gap: var(--ea-s2);
}

/* THE BADGE ROW IS NOT EMITTED BY ANY TEMPLATE THIS BUILD SHIPS. The client
   withdrew the badge system on 2026-09-01, verdict pills and neutral value
   chips alike, so `p.ea-row__badges` is dead markup rather than an empty slot;
   removing the thirteen empty ones from the profile changed zero styles, zero
   sizes and zero positions at five widths. The rules stay because they are
   ported, they cost four declarations, and `--grid` and `--wide` both place a
   `badges` area that would otherwise have no rule if the decision is reversed. */
.ea-row__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ea-s2);
    margin: 0;
}
@media (max-width: 767px) {
    .ea-row__badges {
        flex-basis: 100%;
    }
}
.ea-row__badges:empty {
    display: none;
}
/* THE SAME RULE FOR THE META CONTAINER, moved here from
   css/pages/search-results.css on 2026-09-08 where round 19 first fixed it. It
   belongs beside its sibling: this sheet is what makes `.ea-row` a grid and
   `.ea-row__meta` a flex item, so this sheet is what owns the empty case.

   `search/render.php` composes the container and then decides per branch what
   goes in it, so a European record with no stored country emitted an empty
   `<div>` that still measured a **9px** flex box against 22px for a filled one.
   Measured on `/search/?q=analytics`: 21 of 42 rows, identically at 1440 and 390
   and in both languages. The row height did not move (the 40px logo spans two
   tracks and absorbs it); what moved was the title, sitting 17.5px from the row
   top on those 21 rows against 13px on the other 21.

   `:empty` is exact rather than approximate here: the renderer emits the open
   and close tags adjacent with no whitespace, so a container holding a country
   never matches and one holding nothing always does. */
.ea-row__meta:empty {
    display: none;
}

/* 01 §2.10: an unknown country is STATED, never omitted, and the flag slot
   stays as a neutral placeholder so the row does not shift. It is also what a
   row renders while the country flag assets are missing from this install. */
.ea-row__flag-none {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex: none;
    border: 1px dashed var(--ea-ink-300);
    border-radius: 2px;
}
.ea-row__unknown {
    font-style: italic;
}

.ea-row__desc {
    grid-area: desc;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    margin-top: var(--ea-s1);
}

@media (min-width: 768px) {
    /* Scoped to `--grid` and `--wide` because only those two declare
       `grid-area: badges`. Unscoped, `display: contents` let a compact list
       above 768 auto-place the badge row into the 40px logo column. */
    .ea-list--grid .ea-row__meta,
    .ea-list--wide .ea-row__meta {
        display: contents;
    }
    .ea-list--grid .ea-row__meta-item,
    .ea-list--wide .ea-row__meta-item {
        grid-area: meta;
        font-size: 0.82rem;
        line-height: 22px;
        color: var(--ea-ink-500);
    }

    /* -- the grid card (02 §3.2) ------------------------------------ */
    .ea-list--grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--ea-s4);
    }
    .ea-list--grid .ea-row {
        grid-template-columns: 48px minmax(0, 1fr);
        grid-template-rows: auto auto 1fr auto;
        grid-template-areas:
            "logo title"
            "logo meta"
            ".    desc"
            ".    badges";
        column-gap: var(--ea-s3);
        padding: var(--ea-s4);
    }
    /* `align-self: start` is not optional: the description sits in the one `1fr`
       track, and a stretched `-webkit-box` taller than its clamp draws the
       ellipsis at line two and goes on painting lines three and four below it. */
    .ea-list--grid .ea-row__desc {
        -webkit-line-clamp: 2;
        line-clamp: 2;
        align-self: start;
        margin-top: var(--ea-s3);
        min-height: 44px;
    }
    .ea-list--grid .ea-row__badges {
        grid-area: badges;
        margin: var(--ea-s3) 0 0;
    }

    /* -- the full-width row (02 §3.3 at listing density) --------------
       264px is two badges on one line at the longest pair the system can
       produce, measured rather than chosen; below it they wrap, which is why
       the track is a `minmax`. */
    .ea-list--wide {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--ea-s3);
    }
    .ea-list--wide .ea-row {
        grid-template-columns: 48px minmax(0, 1fr) minmax(0, 264px);
        grid-template-areas:
            "logo title  badges"
            "logo meta   badges"
            "logo desc   badges";
        column-gap: var(--ea-s4);
        padding: var(--ea-s4);
    }
    .ea-list--wide .ea-row__logo {
        align-self: center;
    }
    .ea-list--wide .ea-row__desc {
        -webkit-line-clamp: 2;
        line-clamp: 2;
        margin-top: var(--ea-s2);
    }
    .ea-list--wide .ea-row__badges {
        grid-area: badges;
        align-content: start;
        justify-content: flex-end;
    }
}

/* 340px rather than 264 above 1200: a three-value fact list needs its labels at
   91 + 78 + 79 = 248px plus gaps, which is the whole of 264, so at 264 the
   labels have to repeat on every row instead of being stated once. */
@media (min-width: 1200px) {
    .ea-list--wide .ea-row {
        grid-template-columns: 48px minmax(0, 1fr) minmax(0, 340px);
    }
}

@media (min-width: 1024px) {
    .ea-list--grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* -------------------------------------------------------------------
   3. THE BLOCK'S OWN THREE ELEMENTS

   `.ea-list__intro` is the rename of `p.ea-article-note`, whose values it takes
   (css/pages/article-single.css:191). `ref-concepts.md` line 521 names that
   class among seven page-prefixed names on markup a portable block has to emit,
   and names THIS block as the reason: "the moment ea/service-list renders on
   the expert profile, it emits a class named after a page it is not on."

   `.ea-list__more` takes `.ea-article-more`'s values (:203). The block padding
   rather than a height is load-bearing: the link is the whole paragraph, so
   WCAG 2.2 SC 2.5.8's inline exception does not cover it and 250 by 22 is 2px
   under the minimum, and inline block padding does not enter the line box.

   `.ea-list__empty` has no mockup source and is not `.ea-empty__*`. That object
   is the filter-results card, and `expert-profile.md` §2.5 says in as many
   words that a profile's empty list "must not be the filter-results empty
   state's wording". This is one quiet line of prose in a section that has
   nothing to list, so it is styled as prose.
   ------------------------------------------------------------------- */

.ea-list__intro {
    max-width: var(--ea-measure);
    margin-bottom: var(--ea-s5);
}

.ea-list__more {
    margin: var(--ea-s4) 0 0;
    font-size: 0.94rem;
    line-height: 26px;
}
.ea-list__more a {
    display: inline-block;
    padding-block: 2px;
}

.ea-list__empty {
    max-width: var(--ea-measure);
    margin: 0;
    color: var(--ea-ink-500);
}
