/* ==========================================================================================
   BarcoderX website: long-form printing articles layer. Author: BarcoderX.
   Pages: /printing/server-side-label-printing/, /printing/print-from-a-web-app/ and their Spanish twins.
   Loaded after site.css, inner.css and zpl.css. The page frame (.doc, .zsec, .prose, .crumbs, .note, .code, .rel-guides, .src,
   .zlegal) comes from zpl.css; this file only adds what those guides do not have: comparison tables that reflow on phones,
   a definition list, a numbered decision list, a state flow and the inline route diagram.
   Tokens only: every colour, space, radius and type size comes from /brand/tokens.css through site.css.
   Light theme only. Mobile first. Breakpoints: 40rem (640), 48rem (768).
   ========================================================================================== */

/* The titles of these pages are whole sentences (longer still in Spanish), so the 20ch cap and the largest size of the
   reference-page H1 would stack five lines on a phone. A wider cap and a slightly smaller ceiling keep it to two or three. */
/* The selector carries .p-hero because inner.css sets .p-hero h1 (specificity 0,1,1), which would beat a lone class. */
.p-hero .a-h1 { max-width: 26ch; font-size: clamp(1.875rem, 1.4rem + 2.4vw, 3rem); }

/* The pre-launch status note sits above the first section, so it needs its own bottom space and a readable measure. */
.zstack > .note { max-width: 62ch; margin-bottom: var(--bx-space-8); }
/* Inline text links in a row (the closing links of a section) keep a gap between them and stay 44px tall via .link. */
.prose .link { margin-right: var(--bx-space-5); }

/* ============================== COMPARISON TABLES ============================== */
/* Wide screens: a real table. Phones: each row becomes a card and every cell carries its own column name through
   data-label, so no column is ever cut off or scrolled sideways. Unlike .cmp in printing.css, nothing is hard-coded to
   a pair of languages: the labels are in the markup, so the same rule serves English and Spanish. */
.atab { width: 100%; border-collapse: collapse; border-top: var(--rule); font-size: var(--bx-text-sm); }
.atab th, .atab td { padding: var(--bx-space-4) var(--bx-space-4) var(--bx-space-4) 0; text-align: left; vertical-align: top; border-bottom: var(--hair); min-width: 0; }
.atab thead th { padding-block: var(--bx-space-3); font: 600 var(--bx-text-xs)/1.4 var(--bx-font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--bx-gray-600); border-bottom: 1px solid var(--bx-border-strong); }
.atab tbody th { width: 11rem; font: 650 var(--bx-text-sm)/1.4 var(--bx-font-display); letter-spacing: -0.005em; color: var(--bx-ink); }
.atab td { color: var(--bx-gray-700); line-height: 1.55; }
.atab td code, .atab th code { white-space: nowrap; }
/* The transport table has short cells, so its first column can be narrower. */
.atab-compact tbody th { width: 13rem; }

@media (max-width: 47.999rem) {
  .atab, .atab tbody, .atab tr, .atab th, .atab td { display: block; }
  .atab { border-top: 0; font-size: var(--bx-text-sm); }
  /* The header row is hidden visually only; assistive technology keeps the column names through the same data-label text. */
  .atab thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .atab tbody tr { padding: var(--bx-space-5) 0; border-top: var(--rule); }
  .atab tbody tr:last-child { border-bottom: var(--hair); }
  .atab tbody th, .atab tbody td { width: auto; padding: 0; border: 0; }
  .atab tbody th { margin-bottom: var(--bx-space-3); font-size: var(--bx-text-md); }
  .atab td { padding-block: var(--bx-space-2); }
  .atab td + td { margin-top: var(--bx-space-3); }
  .atab td::before { content: attr(data-label); display: block; margin-bottom: var(--bx-space-1); font: 600 var(--bx-text-xs)/1.5 var(--bx-font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--bx-green-600); }
  /* The compact table is a grid of short facts: label and value on one line is easier to scan than a stack. */
  .atab-compact td { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: var(--bx-space-3); padding-block: var(--bx-space-1); }
  .atab-compact td::before { margin-bottom: 0; }
}

/* ============================== DEFINITION LIST ============================== */
/* A term and its explanation, ruled like the reference sections. Used for failure modes and security controls. */
.deflist { display: grid; border-top: var(--rule); }
.deflist > div { display: grid; gap: var(--bx-space-1) var(--bx-space-6); padding-block: var(--bx-space-4); border-bottom: var(--hair); min-width: 0; }
.deflist dt { font: 650 var(--bx-text-md)/1.35 var(--bx-font-display); letter-spacing: -0.005em; color: var(--bx-ink); }
/* The browser's default 40px left margin on dd would push every explanation off the term's left edge on phones. */
.deflist dd { max-width: 54ch; margin: 0; color: var(--bx-gray-700); }
.deflist code { padding: 0.05em 0.3em; background: var(--bx-gray-100); border-radius: var(--bx-radius-sm); font-weight: 600; font-size: 0.9em; white-space: nowrap; }
@media (min-width: 48rem) { .deflist > div { grid-template-columns: 12rem minmax(0, 1fr); } }

/* ============================== BULLET LIST WITH A BOLD LEAD ============================== */
.alist { display: grid; gap: var(--bx-space-3); max-width: 54ch; }
.alist li { position: relative; padding-left: var(--bx-space-5); }
.alist li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 0.5rem; height: 2px; background: var(--bx-ink); }
.alist b { color: var(--bx-ink); font-weight: 600; }

/* ============================== JOB STATE FLOW ============================== */
/* The five steps of a print job as chips joined by arrows. They wrap on a phone, and the Spanish names ("En spooler") fit
   because each chip is only as wide as its text. The arrow is drawn, not typed, so a screen reader reads the list items. */
.flow { display: flex; flex-wrap: wrap; gap: var(--bx-space-2); }
.flow li { display: inline-flex; align-items: center; gap: var(--bx-space-2); min-height: 2.25rem; padding: 0 var(--bx-space-3); background: var(--bx-surface); border: 1px solid var(--bx-border-strong); font: 600 var(--bx-text-sm)/1.3 var(--bx-font-mono); color: var(--bx-ink); }
.flow li:not(:last-child)::after { content: "\2192"; content: "\2192" / ""; color: var(--bx-gray-500); }   /* second line: empty alt text, so screen readers skip the arrow */
.flow li.done { background: var(--bx-green-50); border-color: var(--bx-green-200); color: var(--bx-green-600); }

/* ============================== DECISION LIST ============================== */
/* One question per row with the way it points to; the tag sits left on wide screens and above the text on phones. */
.choose { border-top: var(--rule); }
.choose li { display: grid; gap: var(--bx-space-1) var(--bx-space-5); padding-block: var(--bx-space-4); border-bottom: var(--hair); min-width: 0; }
.choose .tag { align-self: start; font: 600 var(--bx-text-xs)/1.6 var(--bx-font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--bx-green-600); }
.choose p { max-width: 54ch; }
.choose b { color: var(--bx-ink); font-weight: 600; }
@media (min-width: 40rem) { .choose li { grid-template-columns: 7rem minmax(0, 1fr); } }

/* ============================== ROUTE DIAGRAM (inline SVG) ============================== */
/* The figure is one SVG drawn in a 400-wide box, so its text stays near 11 to 13 px on a 360px phone and never needs a
   second, mobile-only drawing. All colours are tokens; nothing is set in the markup except geometry. */
.fig { display: grid; gap: var(--bx-space-3); margin: 0; }
.dg { display: block; width: 100%; max-width: 32rem; height: auto; aspect-ratio: 400 / 442; overflow: visible; }
/* Everything in the drawing belongs to the reader: the dashed frame says so, and its label names it. */
.dg-frame { fill: none; stroke: var(--bx-gray-400); stroke-width: 1.25; stroke-dasharray: 6 4; }
.dg-frame-label { font: 600 12px var(--bx-font-mono); letter-spacing: 0.08em; text-transform: uppercase; fill: var(--bx-gray-600); }
.dg-box { fill: var(--bx-surface); stroke: var(--bx-ink); stroke-width: 1.5; }
.dg-box.dg-end { fill: var(--bx-green-50); stroke: var(--bx-green-600); }
.dg-line { fill: none; stroke: var(--bx-ink); stroke-width: 1.5; }
.dg-warn { stroke: var(--bx-warning-ink); stroke-dasharray: 5 4; }
.dg-head { fill: var(--bx-ink); }
.dg-head-warn { fill: var(--bx-warning-ink); }
.dg-sep { stroke: var(--bx-border); stroke-width: 1; }
.dg-badge { fill: var(--bx-ink); }
.dg-num { font: 700 13px var(--bx-font-mono); fill: var(--bx-white); text-anchor: middle; }
.dg-title { font: 650 14px var(--bx-font-display); fill: var(--bx-ink); }
.dg-txt { font: 600 13px var(--bx-font-sans); fill: var(--bx-ink); text-anchor: middle; }
.dg-txt-sm { font-size: 12px; }
.dg-note { font: 500 12px var(--bx-font-sans); fill: var(--bx-gray-600); text-anchor: middle; }

/* The closing blocks (related links, the ZPL pointer) follow a ruled list, so they need the same breathing room as a section. */
.zstack > .rel-guides { margin-top: var(--bx-space-12); }
.zstack > .zbridge { margin-top: var(--bx-space-4); }

/* Source line links: the guide's .src is mono and muted, so its links take the brand green to stay recognisable. */
.src a { color: var(--bx-green-600); text-underline-offset: 0.2em; }

/* ============================== PRINT ============================== */
/* Tables, diagrams and flow chips stay whole across pages. Shared print rules are in site.css and zpl.css. */
@media print {
  .atab tr, .deflist > div, .choose li, .fig { break-inside: avoid; }
  .dg-box { fill: none; }
}
