/* faction-block.css — the "Frakcijos" block (FRONTPAGE-POLISH E4): a seat bar
   and one tinted card per faction, coloured by the faction key
   (js/faction-key.js) through --faction-<key> and --faction-<key>-tint
   (css/tokens.css, both themes). On the homepage; Žmonės – Frakcijos has its own
   css/faction-view.css (FRAKCIJOS-VIEW).
   Also the homepage's random-MP card (rmp-, FRONTPAGE-POLISH E5), below.
   Prefix fb- (zmones.html's Frakcijos view already uses fx-). */
.fb[hidden] { display: none; }
.fb { margin: 0 0 48px; }
.fb__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 0 0 16px; }
.fb__title { font-family: 'Source Serif 4', serif; font-weight: 600; font-size: var(--text-h2); line-height: 1.25; color: var(--text-primary); margin: 0; }
.fb__all { font-size: var(--text-small); color: var(--text-primary); white-space: nowrap; }

/* seat bar: one segment per faction, width in proportion to its members, 2px apart */
.fb-bar { display: flex; gap: 2px; height: 28px; margin: 0 0 16px; }
.fb-bar__seg { min-width: 2px; height: 100%; }
.fb-bar__seg:first-child { border-radius: 4px 0 0 4px; }
.fb-bar__seg:last-child  { border-radius: 0 4px 4px 0; }

/* cards: six across, a seventh (MSNG today) on its own full row; two across on phones */
.fb-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.fb-grid > .fb-card:nth-child(7):last-child { grid-column: 1 / -1; }
.fb-card {
  min-width: 0; display: flex; flex-direction: column; gap: 2px;
  background: var(--bg-surface); border: 1px solid var(--border-hair); border-radius: 8px; padding: 14px 16px;
  color: var(--text-primary); text-decoration: none;
}
.fb-card:hover { border-color: var(--border-strong); }
.fb-card:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.fb-card__dot { width: 12px; height: 12px; border-radius: 50%; margin-bottom: 6px; }
.fb-card__n { font-family: 'Source Serif 4', serif; font-weight: 600; font-size: var(--text-h1); line-height: 1.1; font-variant-numeric: tabular-nums; }
.fb-card__abbr { font-size: var(--text-label); font-weight: 600; margin-top: 4px; }
.fb-card__name { font-size: var(--text-small); color: var(--text-secondary); line-height: 1.4; overflow-wrap: anywhere; }

/* per faction: tint for the card, colour for the dot and the bar segment */
.fb-card.lsdpf  { background: var(--faction-lsdpf-tint); }
.fb-card.tslkdf { background: var(--faction-tslkdf-tint); }
.fb-card.naf    { background: var(--faction-naf-tint); }
.fb-card.dfvl   { background: var(--faction-dfvl-tint); }
.fb-card.lsf    { background: var(--faction-lsf-tint); }
.fb-card.lvzksf { background: var(--faction-lvzksf-tint); }
.fb-card.misri  { background: var(--faction-misri-tint); }
.fb-swatch.lsdpf  { background: var(--faction-lsdpf); }
.fb-swatch.tslkdf { background: var(--faction-tslkdf); }
.fb-swatch.naf    { background: var(--faction-naf); }
.fb-swatch.dfvl   { background: var(--faction-dfvl); }
.fb-swatch.lsf    { background: var(--faction-lsf); }
.fb-swatch.lvzksf { background: var(--faction-lvzksf); }
.fb-swatch.misri  { background: var(--faction-misri); }
.fb-swatch.unknown { background: var(--text-faint); }

/* the random-MP card (FRONTPAGE-POLISH E5, index.html): on the MP's faction
   tint; the Speaker (no faction, key 'unknown') on --bg-sunken. The button
   keeps its --text-primary border: its --bg-surface fill alone is about 1.1:1
   against a tint. */
.rmp.lsdpf  { background: var(--faction-lsdpf-tint); }
.rmp.tslkdf { background: var(--faction-tslkdf-tint); }
.rmp.naf    { background: var(--faction-naf-tint); }
.rmp.dfvl   { background: var(--faction-dfvl-tint); }
.rmp.lsf    { background: var(--faction-lsf-tint); }
.rmp.lvzksf { background: var(--faction-lvzksf-tint); }
.rmp.misri  { background: var(--faction-misri-tint); }
.rmp.unknown { background: var(--bg-sunken); }
.rmp-name {
  display: inline-block; font-family: 'Source Serif 4', serif; font-weight: 600; font-size: var(--text-h3); line-height: 1.25;
  color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; overflow-wrap: anywhere;
}
/* a block, not a flex row: a long role wraps as text and the dot stays at its start */
.rmp-meta { margin: 6px 0 0; font-size: var(--text-small); color: var(--text-secondary); line-height: 1.4; }
.rmp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -0.05em; }
.rmp-figs { margin: 10px 0 0; font-size: var(--text-small); color: var(--text-primary); line-height: 1.5; }
.rmp-since { margin: 4px 0 0; font-size: var(--text-micro); color: var(--text-secondary); }
.rmp-next {
  margin-top: 14px; min-height: 36px; padding: 6px 16px; border-radius: 6px;
  font: inherit; font-size: var(--text-small); font-weight: 600; cursor: pointer;
  color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--text-primary);
}
.rmp-next:hover { background: var(--bg-page); }
.rmp-next:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

@media (max-width: 700px) {
  .fb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fb-grid > .fb-card:nth-child(7):last-child { grid-column: auto; }
  .fb-grid > .fb-card:nth-child(odd):last-child { grid-column: 1 / -1; }
}
