/* templates/stencil.css — Industrial Stencil skin (rules whose every selector targets .dcc-tpl-stencil). Ported 2026-10-31 from yaab css/cards-mode.css. */

.dcc-card.dcc-tpl-stencil.dcc-card-back { background: var(--st-panel); }

/* Continuation / back cells inherit the cream surface. */
.dcc-card.dcc-tpl-stencil .dcc-cont-overlay { background: var(--st-paper); }
.dcc-tpl-stencil .dcc-head::before, .dcc-tpl-stencil .dcc-head::after { display: none; }

/* The design wraps long names onto a second line rather than truncating. */
.dcc-tpl-stencil .dcc-name { color: var(--st-panel); letter-spacing: 0.04em; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.04; }
.dcc-tpl-stencil .dcc-pts { background: var(--st-accent); color: #1c1813; border-radius: 0.5mm; font-weight: 700; }
.dcc-tpl-stencil .dcc-sub-line { color: color-mix(in srgb, var(--st-panel) 70%, transparent); }
.dcc-tpl-stencil .dcc-strat-phase, .dcc-tpl-stencil .dcc-role { color: color-mix(in srgb, var(--st-panel) 70%, transparent); }

/* In the stencil template the header bleeds to the card edge — its content
 * padding folds in the borderless safe margin (--dcc-safe). The CP pill is
 * positioned against the header's padding box (the card edge), so it must
 * inset by that same base+safe amount, otherwise it prints into the trim on a
 * borderless sheet. (The default template's header only bleeds a fixed 0.6mm,
 * so the base 1.2mm/1.6mm offsets already clear the safe area there.) */
.dcc-tpl-stencil .dcc-head-strat .dcc-cp {
  top: calc(1.6mm + var(--dcc-safe, 0mm));
  right: calc(2mm + var(--dcc-safe, 0mm));
  /* Stratagem CP — faction-accent hex badge. */
  background: var(--st-accent);
  color: #1b1712;
  border-radius: 0;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  padding: 1.5mm 1.4mm;
  align-self: center;
}
.dcc-tpl-stencil .dcc-cp-num { font-family: 'Cinzel', serif; color: #1b1712; }
.dcc-tpl-stencil .dcc-cp-lbl { color: rgba(27,23,18,0.8); }
.dcc-tpl-stencil .dcc-statline > .dcc-stats { flex: 1 1 auto; min-width: 0; margin-top: 0; }

/* Header — full-bleed dark bar with a faction-accent bottom rule. */
.dcc-tpl-stencil .dcc-head {
  /* Bleed the bar to the card edge by negating the full content padding
   * (base + safe margin); pad the text back in by the same amount so it
   * lines up with the body content and clears the borderless trim. */
  margin: calc(-1.6mm - var(--dcc-safe, 0mm)) calc(-2mm - var(--dcc-safe, 0mm)) 1.4mm;
  padding: calc(1.6mm + var(--dcc-safe, 0mm)) calc(2mm + var(--dcc-safe, 0mm));
  background: var(--st-ink);
  color: var(--st-panel);
  border-radius: 0;
  border-bottom: 0.7mm solid var(--st-accent);
  box-shadow: none;
}
.dcc-tpl-stencil .dcc-stat-key { color: var(--st-mut); font-family: 'Cinzel', serif; }
.dcc-tpl-stencil .dcc-stat-val { color: var(--st-ink); font-family: 'Cinzel', serif; }
.dcc-tpl-stencil .dcc-stat-rowlabel { color: var(--st-accent-dark); }

/* Section heads — accent diamond tick + ink-chip label. (Keep the head's
 * right padding so the weapon column letters stay aligned over the table.) */
.dcc-tpl-stencil .dcc-section-head {
  background: transparent;
  color: var(--st-ink);
  box-shadow: none;
  border-radius: 0;
  padding: 0 1.4mm 0 0;
  margin: 1.8mm 0 1.0mm;
  gap: 1.4mm;
  align-items: center;
}
.dcc-tpl-stencil .dcc-section-head::before { content: ''; width: 1.5mm; height: 1.5mm; background: var(--st-accent); transform: rotate(45deg); flex: 0 0 auto; }
.dcc-tpl-stencil .dcc-section-label {
  background: var(--st-ink);
  color: var(--st-panel);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 0.4mm 1.5mm;
}
.dcc-tpl-stencil .dcc-section-cols { color: var(--st-mut); }

/* Weapon tables — hairline rows, Cinzel numerals, accent keyword pills. */
.dcc-tpl-stencil .dcc-w-table tr { border-bottom-color: var(--st-hair); }
.dcc-tpl-stencil .dcc-w-name { color: var(--st-ink); font-family: var(--st-body); font-weight: 600; }

/* Keyword pills sit on their own line under the weapon name and wrap as a
 * group, rather than trailing inline off the name and breaking mid-row. */
.dcc-tpl-stencil .dcc-w-tags { display: flex; flex-wrap: wrap; gap: 0.8mm; margin-top: 0.5mm; }
.dcc-tpl-stencil .dcc-num { color: var(--st-ink); font-family: 'Cinzel', serif; font-weight: 600; }


/* templates/stencil.css — Industrial Stencil skin. Ported from yaab css/cards-mode.css 1011-1213. */
/* Industrial Stencil
 * Light, print-friendly skin recreated from the "Warhammer Datacard Design"
 * handoff (its locked `stencil` renderVals spec). Cream cardstock, near-black
 * ink, a full-bleed dark header bar with a faction-accent bottom rule, Cinzel
 * display + EB Garamond body, ink-chip section heads with an accent diamond
 * tick, faction-accent shield/hex badges, and accent pills. A single accent
 * colour — `--dcc-accent`, auto-derived per faction by cards-mode.js (default
 * Necron green #74c043) — recolours every accented element via color-mix.
 * Tokens: paper #ece5d6 · panel #f5f0e3 · ink #29251f · muted #7c7360 ·
 * dim #4a4337 · hairline = ink @ 24%. EB Garamond + Cinzel are vendored in
 * css/style.css, so the skin renders identically offline + in print.
 * Several elements only exist on this template (emitted by cards-mode.js when
 * templateId==='stencil'): .dcc-kicker, .dcc-statline(-rows), .dcc-invuln-
 * shield/-val/-lbl, .dcc-w-tag, .dcc-ab-block/-head/-name/-text. The other
 * templates never see them. */
.dcc-card.dcc-tpl-stencil {
  --st-paper: #ece5d6;
  --st-panel: #f5f0e3;
  --st-ink: #29251f;
  --st-mut: #7c7360;
  --st-dim: #4a4337;
  --st-hair: color-mix(in srgb, #29251f 24%, transparent);
  --st-accent: var(--dcc-accent, #74c043);
  --st-accent-dark: color-mix(in srgb, var(--st-accent) 58%, #29251f);
  --st-pill: color-mix(in srgb, var(--st-accent) 22%, transparent);
  --st-pill-bd: color-mix(in srgb, var(--st-accent) 50%, transparent);
  --st-body: 'EB Garamond', Georgia, 'Times New Roman', serif;
  color: var(--st-ink);
  background: var(--st-paper);
  border: 0;
  box-shadow: none;
  font-family: var(--st-body);
}
.dcc-tpl-stencil .dcc-stat-cell { background: var(--st-panel); color: var(--st-ink); border: 0.35mm solid var(--st-ink); border-radius: 0.5mm; box-shadow: none; }
.dcc-tpl-stencil .dcc-w-tag {
  display: inline-block;
  font-family: var(--st-body);
  font-size: calc(2.0mm * calc(var(--dcc-w-mul, 1) * var(--dcc-fit, 1)));
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.1mm 0.9mm;
  border-radius: 0.6mm;
  background: var(--st-pill);
  border: 0.2mm solid var(--st-pill-bd);
  color: var(--st-ink);
  white-space: nowrap;
  vertical-align: baseline;
}

/* Abilities — type-pill blocks. */
.dcc-tpl-stencil .dcc-abilities-body { color: var(--st-dim); padding: 0.4mm 0 0; }

/* Other body text (enhancement, wargear, transport, rule/strat). */
.dcc-tpl-stencil .dcc-ability-row, .dcc-tpl-stencil .dcc-wargear-body, .dcc-tpl-stencil .dcc-rule-text { color: var(--st-dim); }
.dcc-tpl-stencil .dcc-ability-row strong, .dcc-tpl-stencil .dcc-wargear-line strong { color: var(--st-ink); }
.dcc-tpl-stencil .dcc-core-row { color: var(--st-mut); }
.dcc-tpl-stencil .dcc-wargear-sub li::before { color: var(--st-accent-dark); }

/* Footer keywords. */
.dcc-tpl-stencil .dcc-foot { border-top-color: var(--st-hair); }
.dcc-tpl-stencil .dcc-foot::before { display: none; }
.dcc-tpl-stencil .dcc-keywords { color: var(--st-dim); font-family: var(--st-body); }
.dcc-tpl-stencil .dcc-keywords strong { color: var(--st-accent-dark); letter-spacing: 0.08em; }
.dcc-tpl-stencil .dcc-kicker {
  font-family: var(--st-body);
  font-size: calc(2.4mm * calc(var(--dcc-sub-mul, 1) * var(--dcc-fit, 1)));
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--st-accent) 90%, transparent);
  margin-bottom: 0.5mm;
  /* Faction name on the dark header bar — thicken its strokes so the small
   * accent-coloured letters print solid. See `.dcc-section-label`. */
  -webkit-text-stroke: 0.1mm currentColor;
  text-stroke: 0.1mm currentColor;
  paint-order: stroke fill;
}

/* Stat strip + per-line invuln shield. Each stat row is wrapped in its own
 * .dcc-statline so the shield sits flush at the end of THAT line (not
 * stretched across multiple profiles). Rows without an invuln carry a
 * spacer of the shield's width so the six stat columns stay aligned. */
.dcc-tpl-stencil .dcc-statline { display: flex; gap: 1.4mm; align-items: stretch; }
.dcc-tpl-stencil .dcc-statline + .dcc-statline, .dcc-tpl-stencil .dcc-stat-rowlabel + .dcc-statline { margin-top: 0.6mm; }
.dcc-tpl-stencil .dcc-invuln-spacer { flex: 0 0 auto; width: 11mm; }
.dcc-tpl-stencil .dcc-invuln-shield {
  flex: 0 0 auto;
  width: 11mm;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2mm;
  background: var(--st-accent);
  color: #1b1712;
  clip-path: polygon(50% 0, 100% 15%, 100% 58%, 50% 100%, 0 58%, 0 15%);
}
.dcc-tpl-stencil .dcc-invuln-val { font-family: 'Cinzel', serif; font-weight: 700; line-height: 1; color: #1b1712; font-size: calc(4mm * calc(var(--dcc-stat-mul, 1) * var(--dcc-fit, 1))); }
.dcc-tpl-stencil .dcc-invuln-lbl {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.7mm;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(27,23,18,0.72);
}
.dcc-tpl-stencil .dcc-ab-block { margin-top: 1.3mm; }
.dcc-tpl-stencil .dcc-ab-block:first-child { margin-top: 0.4mm; }
.dcc-tpl-stencil .dcc-ab-head { display: flex; align-items: baseline; gap: 1.2mm; flex-wrap: wrap; margin-bottom: 0.4mm; }
.dcc-tpl-stencil .dcc-ab-name { font-family: var(--st-body); font-weight: 700; color: var(--st-ink); font-size: calc(2.7mm * calc(var(--dcc-body-mul, 1) * var(--dcc-fit, 1))); }
.dcc-tpl-stencil .dcc-ab-text {
  font-family: var(--st-body);
  color: var(--st-dim);
  line-height: 1.36;
  white-space: pre-line;
  font-size: calc(2.5mm * calc(var(--dcc-body-mul, 1) * var(--dcc-fit, 1)));
}
.dcc-tpl-stencil .dcc-type-pill {
  font-family: var(--st-body);
  font-size: 1.9mm;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2mm 1.1mm;
  border-radius: 0.6mm;
  background: var(--st-pill);
  border: 0.2mm solid var(--st-pill-bd);
  color: var(--st-ink);
}