/* ==========================================================================
   BAKKAR PRINTING — THEME "INDUSTRIAL PRECISION"
   pages/agents.css — agents.html ONLY.
   --------------------------------------------------------------------------
   Everything reusable (buttons, sec-head, acard, chip, spec, specstrip,
   cta-band, brackets, micro, empty) lives in components.css / base.css and is
   used AS-IS. The agent plates themselves are Bakkar.render.agentCard() —
   this file only DECORATES them into personnel records:

     · .agents-specs   the network spec strip under the SLIM page header
                       (.page-head--slim is the shared kit's — components.css)
     · .agents-filter  the territory chip rail + the mono record readout
     · .agents-grid    the register, and the .arec decoration of .acard
                       (index number, REF / BASE / LINE hairline meta table)
     · .agents-ledger  the territory coverage register (paper zone)
     · .agents-cta     the "become an agent" closing band

   No photographs of people anywhere: the avatar is a CSS monogram plate.
   Every box-model property is logical. Every corner is square.
   ========================================================================== */


/* ==========================================================================
   01. THE TITLE BLOCK
   --------------------------------------------------------------------------
   The page opens with the SHARED slim header (.page-head--slim, components.css
   §18d) — breadcrumb, modest H1, one line. Nothing is restyled here.
   Directly beneath it sits the network spec strip: a single hairline band of
   technical facts read off BAKKAR_DATA. It is part of the title block, not a
   hero — it must stay one row deep so the register starts immediately.
   Every colour resolves through a token, so it is correct on paper AND on
   graphite.
   ========================================================================== */
.agents-specs {
  position: relative;
  background-color: var(--bg);
  color: var(--fg);
  border-block-end: var(--bw-hair) solid var(--line);
}
/* .specstrip already draws its own start rule + surface; it needs no bed. */
.agents-specs .specstrip { border-block-start: 0; }

/* The two text cells must not shout at display size next to the counts. */
.agents-specs .specstrip__cell--text .specstrip__v {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  line-height: 1.45;
  letter-spacing: var(--track-none);
  color: var(--fg);
}

/* The register must begin right under the strip — no hero-sized gap. */
#register { padding-block-start: clamp(var(--s-7), 3.2vw, var(--s-9)); }


/* ==========================================================================
   02. FILTER RAIL — territory chips + the record readout
   ========================================================================== */
.agents-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-4) var(--s-6);
  padding-block: var(--s-5);
  margin-block-end: var(--s-8);
  border-block: var(--bw-hair) solid var(--line);
}

.agents-filter__chips { gap: var(--s-2); }

/* 34px is the kit default; a filter rail is a primary control — give it 44. */
.agents-filter .chip {
  min-block-size: 44px;
  gap: var(--s-3);
}
.agents-filter .chip__n { font-size: var(--fs-2xs); }

.agents-filter__readout {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s-3);
  flex: none;
}
.agents-filter__count {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s-1);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--fg-strong);
}
.agents-filter__count .agents-filter__sep { color: var(--line-contrast); }
.agents-filter__count [data-agents-total] { color: var(--fg-subtle); }

@media (max-width: 639px) {
  .agents-filter { justify-content: flex-start; }
  .agents-filter__chips { inline-size: 100%; }
}


/* ==========================================================================
   03. THE REGISTER — personnel plates.
   The card itself is Bakkar.render.agentCard() (.acard). Everything below is
   the page's decoration of it: an index number, corner brackets and a
   REF / BASE / LINE hairline meta table welded above the action bar.
   ========================================================================== */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
  gap: var(--s-6);
}

.arec--off { display: none !important; }

/* The record index, top-inline-end of the plate. */
.arec .acard__head { position: relative; padding-inline-end: var(--s-8); }
.arec__idx {
  position: absolute;
  inset-block-start: -2px;
  inset-inline-end: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  line-height: 1;
  letter-spacing: var(--track-none);
  color: var(--fg-subtle);
  font-variant-numeric: tabular-nums;
}
.arec__idx::before { content: "/ "; color: var(--line-contrast); }
.arec:hover .arec__idx { color: var(--accent); }

/* The monogram plate: hatched, never a photograph.
   The hatch is drawn in the OPPOSITE ink to the sheet, so it survives both
   modes — a white hatch on graphite, a graphite hatch on paper. Hard-coding
   the white alpha here would erase it on the printed sheet. */
.arec { --arec-hatch: var(--alpha-k-04); }
:root[data-theme="dark"] .arec { --arec-hatch: var(--alpha-w-04); }

.arec .acard__mono {
  letter-spacing: 0.04em;
  background-image: repeating-linear-gradient(
    45deg, var(--arec-hatch) 0 1px, transparent 1px 6px);
}

/* REF / BASE / LINE — the record's own spec table. */
.arec__meta {
  display: grid;
  border-block-start: var(--bw-hair) solid var(--line);
  margin-block-start: auto;
}
.arec__row {
  display: grid;
  /* Wide enough to hold "DIRECT LINE" / "الخط المباشر" on one line. */
  grid-template-columns: 7rem minmax(0, 1fr);
  align-items: baseline;
  gap: var(--s-3);
  padding-block: var(--s-3);
  border-block-end: var(--bw-hair) solid var(--line);
}
@media (max-width: 359px) {
  .arec__row { grid-template-columns: 1fr; gap: var(--s-1); }
}
.arec__row:last-child { border-block-end: 0; }
.arec__k {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  color: var(--fg-subtle);
}
.arec__v {
  min-inline-size: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
a.arec__v { transition: var(--t-color); }
a.arec__v:hover { color: var(--accent); }

/* The action bar sits flush at the block-end of the plate. */
.arec .acard__foot { margin-block-start: 0; }

.agents-empty { padding-block: var(--s-6); }


/* ==========================================================================
   04. COVERAGE LEDGER — the territory register (paper zone)
   ========================================================================== */
.agents-ledger__table {
  inline-size: 100%;
  min-inline-size: 34rem;   /* below this it scrolls inside .table-scroll */
  border-collapse: collapse;
}
.agents-ledger__table thead th {
  padding: var(--s-4) var(--s-5);
  text-align: start;
  vertical-align: bottom;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  color: var(--fg-subtle);
  border-block-end: var(--bw-hair) solid var(--line-strong);
  background-color: var(--surface-2);
}
.agents-ledger__table tbody tr {
  border-block-end: var(--bw-hair) solid var(--line);
  transition: background-color var(--dur-1) var(--ease);
}
.agents-ledger__table tbody tr:last-child { border-block-end: 0; }
.agents-ledger__table tbody tr:hover { background-color: var(--surface-3); }

.agents-ledger__table th[scope="row"] {
  padding: var(--s-4) var(--s-5);
  text-align: start;
  vertical-align: top;
  inline-size: 26%;
}
.agents-ledger__table td {
  padding: var(--s-4) var(--s-5);
  vertical-align: top;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--fg-muted);
}

.agents-ledger__t {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  line-height: 1.45;            /* baseline-aligns with the mono cells beside it */
  text-transform: uppercase;
  letter-spacing: var(--track-none);
  color: var(--fg-strong);
}
[dir="rtl"] .agents-ledger__t { text-transform: none; }
.agents-ledger__t::before {
  content: "";
  flex: none;
  inline-size: 8px;
  block-size: 8px;
  background-color: var(--accent);
  transform: translateY(-1px);
}
.agents-ledger__cities {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.7;
  color: var(--fg-muted);
}
.agents-ledger__cities .agents-ledger__sep {
  color: var(--line-strong);
  padding-inline: var(--s-2);
}
.agents-ledger__n {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--fg-strong);
  font-variant-numeric: tabular-nums;
  text-align: end;
}
.agents-ledger__table td:last-child,
.agents-ledger__table th:last-child { text-align: end; }


/* ==========================================================================
   05. CLOSING BAND — become an agent
   ========================================================================== */
.agents-cta { padding-block: var(--section-y); }
.agents-cta__meta { margin-block-end: var(--s-5); }
.agents-cta__mail {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  transition: var(--t-color);
}
.agents-cta__mail:hover { color: var(--accent); }
.agents-cta__mail svg {
  inline-size: 15px;
  block-size: 15px;
  flex: none;
  color: var(--accent);
}
