/* cogitator/codex-col2.css v7 */
/* Codex Viewer Column 2 — Unit list content styles. DevAgent15 - 2026-06-02 */

/* DevAgent29 - 2026-07-19
   What: v7 — .ub-card__badges stays one line; badge padding + size tightened.
   Why:  Two badges wrapped to a second line and pushed the card taller. The row
         is now single-line with overflow hidden, and the badge is smaller and
         tighter so two fit side by side — the card height (.ub-card 70px) is
         fixed and must not grow. */

/* DevAgent29 - 2026-07-19
   What: v6 — .ub-card__badges, a wrapping row for one-or-more sub-faction
         badges (codex-col2.js v10 now renders every non-base faction keyword,
         not just one).
   Why:  A unit can carry two sub-factions (e.g. a Harlequins sheet also tagged
         Asuryani), so the badges need to sit in a wrapping row rather than a
         single element. */

/* DevAgent29 - 2026-07-19
   What: v5 — .ub-card__category--subfaction, the neutral badge that replaces
         the role badge on the card (codex-col2.js v9).
   Why:  The base .ub-card__category rule lives in army-builder-col1.css, which
         this agent is scoped out of; this Codex-only modifier gives the
         sub-faction badge an explicit neutral style rather than inheriting a
         role colour it should not have. A sub-faction has no fixed colour. */

/* DevAgent29 - 2026-07-19
   What: v4 — .cc2-glyph-squircle REMOVED. The glyph fills the slot itself.
   Why:  It is the photo's placeholder, so it takes the photo's geometry: 70px
         wide, full card height, 6px left margin — the same box .ub-card__photo
         occupies on the three Army surfaces.
         ⚠ mask-size is CONTAIN, not cover. The glyphs have wildly different
         aspect ratios (the Votann mark is roughly 1:1.8, the Astartes eagle is
         wider than tall); cover would crop them. Contain fits each within the
         box and centres it. */

/* DevAgent29 - 2026-07-19
   What: v3 — squircle 46 → 56px, glyph 28 → 34px, and the corner radius becomes
         var(--radius-lg) instead of 30%.
   Why:  Jérôme: bigger, matching the card's corner, without the card growing.
         ⚠ The size is bounded by arithmetic, not preference. .ub-card is a
         fixed height: 70px; the 2px accent border leaves 66px of interior, so
         56px clears 5px top and bottom. The 64px first suggested would leave
         1px and read as jammed against the edge.
         ⚠ The radius is a TOKEN, not a percentage. 30% scales with the box, so
         it drifted away from the card's corner the moment the squircle was
         resized — var(--radius-lg) is what .ub-card itself uses
         (army-builder-col1.css:355) and stays in step at any size. */

/* DevAgent29 - 2026-07-19
   What: v2 — .ub-card--simple gains rules, plus .cc2-glyph* for the faction
         glyph squircle that replaces the never-populated photo slot.
   Why:  No datasheet has a photo and none will — photo_url is dropped and
         Wahapedia publishes no image URLs — so the card carries its faction's
         mark instead.
         ⚠ .ub-card--simple previously matched NO rule anywhere in /cogitator
         (see codex-col2.js v4) while being cited across four files as a reason
         not to touch the photo element. It is defined here now, and it is
         Codex-only by design: .ub-card lives in army-builder-col1.css and is
         shared with three Army surfaces DevAgent29 is scoped out of.
         ⚠ The glyph is a MASK, not an image. mask-image + background-color
         paints the faction accent through the file's alpha, so the 304
         pre-existing assets tint correctly despite carrying their own fills.
         An <img> could not be recoloured at all. */

/* DevAgent15 - 2026-06-02
   What: v1 — Gate 4. List container + status/empty/error states. The unit cards
         themselves reuse .ub-card* and the .ab-category-header primitive from
         army-builder-col1.css (loaded globally), so this file is thin.
   Why:  Col2 renders the filtered, category-grouped unit list. */

/* Scroll handled by .codex-col__body; this is just inner padding. */
.cc2-list {
  padding: var(--space-2);
}

/* Status / empty / error */
.cc2-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-10) var(--space-4);
  text-align: center;
  color: var(--text-dim);
  font-size: var(--text-sm);
  font-style: italic;
  line-height: 1.5;
}

.cc2-status--error {
  color: var(--red);
  font-style: normal;
}

/* ── Card ── */
/* Codex-only. Border colour and selected ring are set INLINE per card from the
   faction accent (codex-col2.js v5); the ring must beat .ub-card:hover, which
   outranks .ub-card--selected. */
.ub-card--simple {
  border-width: 2px;
}

/* ── Faction glyph — stands in for the photo that never exists ── */
.cc2-glyph-slot {
  width: 70px;
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
}

.cc2-glyph {
  display: block;
  /* The photo slot's own box — see the v4 note. */
  width: 100%;
  height: 100%;
  /* background-color and mask-image are set inline per faction. */
  -webkit-mask-size: contain;
          mask-size: contain;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
}

/* Sub-faction badge — neutral. Shown only on units carrying a faction keyword
   beyond the base one (chapter reprints, mainly). */
.ub-card__category--subfaction {
  background: var(--surface-lo);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.ub-card__badges {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-1);
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

/* Tighter than the old role badge so two sit on one line without growing the
   card. */
.ub-card__badges .ub-card__category--subfaction {
  height: 16px;
  padding: 0 6px;
  font-size: 0.55rem;
  white-space: nowrap;
  flex-shrink: 0;
}
