/* ==========================================================================================
   BarcoderX website: "Learn" pages layer. Author: BarcoderX.
   Pages: /how-it-works/, /status/, /glossary/, /security/ and their Spanish twins.
   Loaded after site.css, inner.css and zpl.css. The page frame (.p-hero, .z-hero, .crumbs, .doc, .zsec, .zstack,
   .prose, .note, .code, .rel-guides, .src, .zlegal, .zbridge) comes from those files; this file only adds what they do
   not have: a responsive table, status chips, a numbered walkthrough, the path diagram and the glossary list.
   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), 64rem (1024).
   ========================================================================================== */

/* ============================== HERO ============================== */
/* The titles are short sentences (longer in Spanish), so the 20ch cap of the reference-page H1 would stack them in
   four lines on a phone. A wider cap and a slightly lower ceiling keep them to two or three lines.
   The selector carries .p-hero because inner.css sets ".p-hero h1" (specificity 0,1,1), which beats a lone class. */
.p-hero .ln-h1 { max-width: 24ch; font-size: clamp(1.875rem, 1.4rem + 2.4vw, 3rem); }

/* "Last updated" line and similar one-line facts: mono, muted, never wider than the reading measure. */
.ln-meta { font: 500 var(--bx-text-sm)/1.5 var(--bx-font-mono); color: var(--bx-gray-600); max-width: none; }
.ln-meta b { color: var(--bx-gray-700); font-weight: 600; }

/* The pre-launch note sits above the first section, so it needs its own space below and a readable measure. */
.zstack > .note { max-width: 62ch; margin-bottom: var(--bx-space-8); }
.prose .link { margin-right: var(--bx-space-5); }
/* The closing link list and the bridge line sit apart from the last section, whatever it ends with. */
.zstack > .rel-guides { margin-top: var(--bx-space-12); }
.zstack > .zbridge { margin-top: var(--bx-space-6); }

/* Inline links inside running text in the glossary and security lists keep a 44px hit area only when they stand alone;
   inside a sentence they stay inline, as WCAG 2.2 target size allows for inline text. */

/* ============================== RESPONSIVE TABLE ============================== */
/* Wide screens: a real table. Phones: each row becomes a card and every cell repeats its column name through data-label,
   so no column is cut off or scrolled sideways. The labels live in the markup, so one rule serves both languages. */
.ln-tab { width: 100%; border-collapse: collapse; border-top: var(--rule); font-size: var(--bx-text-sm); }
.ln-tab th, .ln-tab 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; }
.ln-tab 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); }
.ln-tab tbody th { width: 12rem; font: 650 var(--bx-text-sm)/1.4 var(--bx-font-display); letter-spacing: -0.005em; color: var(--bx-ink); }
.ln-tab td { color: var(--bx-gray-700); line-height: 1.55; }
.ln-tab td p { max-width: 54ch; }
.ln-tab td p + p { margin-top: var(--bx-space-2); }
.ln-tab code { padding: 0.05em 0.3em; background: var(--bx-gray-100); border-radius: var(--bx-radius-sm); font-weight: 600; font-size: 0.9em; }
/* The status column holds one chip, so it can be narrow and must not wrap the chip. */
.ln-tab td.ln-col-st { width: 11.5rem; white-space: nowrap; }
/* A group row ("Software", "Printer languages") is a full-width sub-heading inside the table body. */
.ln-tab tr.ln-grp th { width: auto; padding: var(--bx-space-6) 0 var(--bx-space-2); border-bottom: 1px solid var(--bx-border-strong); font: 600 var(--bx-text-xs)/1.4 var(--bx-font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--bx-green-600); }

@media (max-width: 47.999rem) {
  .ln-tab, .ln-tab tbody, .ln-tab tr, .ln-tab th, .ln-tab td { display: block; }
  .ln-tab { border-top: 0; }
  /* The header row is hidden visually only; assistive technology keeps the column names through the same data-label text. */
  .ln-tab thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ln-tab tbody tr { padding: var(--bx-space-5) 0; border-top: var(--rule); }
  .ln-tab tbody tr.ln-grp { padding: var(--bx-space-6) 0 var(--bx-space-2); border-top: 0; }
  .ln-tab tbody tr:last-child { border-bottom: var(--hair); }
  .ln-tab tbody th, .ln-tab tbody td { width: auto; padding: 0; border: 0; }
  .ln-tab tbody th { margin-bottom: var(--bx-space-3); font-size: var(--bx-text-md); }
  .ln-tab tr.ln-grp th { margin: 0; padding: 0 0 var(--bx-space-2); border-bottom: 1px solid var(--bx-border-strong); font-size: var(--bx-text-xs); }
  .ln-tab td { padding-block: var(--bx-space-2); }
  .ln-tab td + td { margin-top: var(--bx-space-3); }
  .ln-tab 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); }
  .ln-tab td.ln-col-st { width: auto; white-space: normal; }
}

/* ============================== STATUS CHIPS ============================== */
/* One chip per status word. The word is always in the text, so colour is never the only signal. */
.ln-st { display: inline-flex; align-items: center; min-height: 1.75rem; padding: 0 var(--bx-space-3); border: 1px solid var(--bx-border-strong); border-radius: var(--bx-radius-pill); background: var(--bx-gray-100); font: 600 var(--bx-text-xs)/1.2 var(--bx-font-mono); letter-spacing: 0.02em; color: var(--bx-gray-700); white-space: nowrap; }
.ln-st-dev { background: var(--bx-green-50); border-color: var(--bx-green-200); color: var(--bx-green-600); }
.ln-st-plan { background: transparent; border-style: dashed; border-color: var(--bx-gray-400); color: var(--bx-gray-600); }
.ln-st-now { background: var(--bx-ink); border-color: var(--bx-ink); color: var(--bx-white); }
.ln-st-launch { background: var(--bx-lime-100); border-color: var(--bx-lime-200); color: var(--bx-lime-ink); }
.ln-st-tba { background: var(--bx-gray-100); border-color: var(--bx-border-strong); color: var(--bx-gray-700); }

/* ============================== DEFINITION ROWS ============================== */
/* A term and its explanation, ruled like the reference sections. Used for the status words and the security controls. */
.ln-defs { display: grid; border-top: var(--rule); }
.ln-defs > 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; }
.ln-defs dt { font: 650 var(--bx-text-md)/1.35 var(--bx-font-display); letter-spacing: -0.005em; color: var(--bx-ink); }
.ln-defs dd { margin: 0; max-width: 54ch; color: var(--bx-gray-700); }
.ln-defs 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) { .ln-defs > div { grid-template-columns: 13rem minmax(0, 1fr); } }

/* Bullet list with a bold lead, 54ch measure. */
.ln-list { display: grid; gap: var(--bx-space-3); max-width: 54ch; }
.ln-list li { position: relative; padding-left: var(--bx-space-5); }
.ln-list li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 0.5rem; height: 2px; background: var(--bx-ink); }
.ln-list b { color: var(--bx-ink); font-weight: 600; }

/* ============================== PATH DIAGRAM AND LEGEND ============================== */
/* Phones: the diagram first, then the one-line legend. From 64rem the legend sits beside the diagram, so the whole path
   is visible in one screen. */
.ln-flow { display: grid; gap: var(--bx-space-8); align-items: start; }
.ln-flow > * { min-width: 0; }
@media (min-width: 64rem) { .ln-flow { grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); gap: var(--bx-space-12); } }
.ln-fig { display: grid; gap: var(--bx-space-3); margin: 0; }
.ln-fig figcaption { max-width: 54ch; font-size: var(--bx-text-sm); color: var(--bx-text-muted); }

/* 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 no second,
   mobile-only drawing is needed. All colours are tokens; the markup carries geometry only. */
.ln-dg { display: block; width: 100%; max-width: 26rem; height: auto; overflow: visible; }
/* The one boundary of the diagram: everything inside runs on infrastructure the reader operates. */
.ln-dg-bound { fill: none; stroke: var(--bx-green-600); stroke-width: 1.5; stroke-dasharray: 3 5; }
.ln-dg-box { fill: var(--bx-surface); stroke: var(--bx-ink); stroke-width: 1.5; }
.ln-dg-eng { fill: var(--bx-green-50); stroke: var(--bx-green-600); stroke-width: 1.5; }
.ln-dg-end { fill: var(--bx-ink); stroke: var(--bx-ink); }
.ln-dg-line { fill: none; stroke: var(--bx-ink); stroke-width: 1.5; }
.ln-dg-dash { fill: none; stroke: var(--bx-gray-600); stroke-width: 1.5; stroke-dasharray: 5 4; }
.ln-dg-head { fill: var(--bx-ink); }
.ln-dg-head-dash { fill: var(--bx-gray-600); }
.ln-dg-badge { fill: var(--bx-ink); }
.ln-dg-num { font: 700 12px var(--bx-font-mono); fill: var(--bx-white); text-anchor: middle; }
.ln-dg-t { font: 650 14px var(--bx-font-display); fill: var(--bx-ink); text-anchor: middle; }
.ln-dg-s { font: 500 12.5px var(--bx-font-sans); fill: var(--bx-gray-700); text-anchor: middle; }
.ln-dg-end-t { font: 650 14px var(--bx-font-display); fill: var(--bx-white); text-anchor: middle; }
.ln-dg-end-s { font: 500 12.5px var(--bx-font-sans); fill: var(--bx-gray-200); text-anchor: middle; }
.ln-dg-lbl { font: 600 12px var(--bx-font-mono); fill: var(--bx-green-600); letter-spacing: 0.04em; }
.ln-dg-note { font: 500 12px var(--bx-font-sans); fill: var(--bx-gray-600); }

/* Legend: the six steps in one line each, numbered to match the badges in the diagram. */
.ln-legend { display: grid; gap: 0; counter-reset: ln; border-top: var(--rule); }
.ln-legend li { counter-increment: ln; display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: var(--bx-space-3); padding-block: var(--bx-space-4); border-bottom: var(--hair); }
.ln-legend li::before { content: counter(ln); display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: var(--bx-radius-pill); background: var(--bx-ink); color: var(--bx-white); font: 700 var(--bx-text-xs)/1 var(--bx-font-mono); }
.ln-legend b { display: block; font: 650 var(--bx-text-md)/1.35 var(--bx-font-display); color: var(--bx-ink); }
.ln-legend span { display: block; max-width: 54ch; color: var(--bx-gray-700); font-size: var(--bx-text-sm); }
.ln-legend a { font-weight: 600; }

/* ============================== NUMBERED WALKTHROUGH ============================== */
/* Each step is an article with a round number, a heading and prose. The number is drawn with a counter so the text of
   the heading stays clean for screen readers and for the table of contents. */
.ln-steps { display: grid; gap: var(--bx-space-12); counter-reset: lns; }
.ln-step { display: grid; gap: var(--bx-space-4); min-width: 0; counter-increment: lns; scroll-margin-top: calc(var(--header-h) + var(--bx-space-4)); }
.ln-step > h3 { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: var(--bx-space-3); align-items: start; }
.ln-step > h3::before { content: counter(lns); display: grid; place-items: center; width: 2rem; height: 2rem; margin-top: 0.1rem; border-radius: var(--bx-radius-pill); background: var(--bx-ink); color: var(--bx-white); font: 700 var(--bx-text-sm)/1 var(--bx-font-mono); letter-spacing: 0; }
/* From 40rem the body of a step is indented under the heading text. The indent is padding on the step, and the heading pulls itself back out with a negative margin, so tables and code blocks keep an honest 100% width and never run past the page edge. */
@media (min-width: 40rem) {
  .ln-step { padding-left: calc(2.25rem + var(--bx-space-3)); }
  .ln-step > h3 { margin-left: calc(-1 * (2.25rem + var(--bx-space-3))); }
}
.ln-step .code, .ln-step .ln-tab, .ln-step .gex { max-width: 52rem; }
.ln-step .ln-tab { max-width: none; }

/* Where a step runs: one mono line under each step heading, so the reader always knows whose machine it is. */
.ln-where { font: 500 var(--bx-text-sm)/1.5 var(--bx-font-mono); color: var(--bx-gray-600); max-width: none; }
.ln-where b { color: var(--bx-green-600); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: var(--bx-text-xs); margin-right: var(--bx-space-2); }

/* A short fact strip inside a step: label and value on one line, wrapping on phones. */
.ln-facts { display: grid; gap: var(--bx-space-2); max-width: 54ch; }
.ln-facts div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: var(--bx-space-3); }
.ln-facts dt { font: 600 var(--bx-text-xs)/1.7 var(--bx-font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--bx-gray-600); }
.ln-facts dd { color: var(--bx-gray-700); }

/* Job state flow: the lifecycle names 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. */
.ln-states { display: flex; flex-wrap: wrap; gap: var(--bx-space-2); }
.ln-states 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); }
.ln-states 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 */
.ln-states li.end { background: var(--bx-green-50); border-color: var(--bx-green-200); color: var(--bx-green-600); }
.ln-states.alt li { border-style: dashed; color: var(--bx-gray-700); }
.ln-states.alt li::after { content: none; }

/* ============================== GLOSSARY ============================== */
/* A-Z jump list: reuses .jump from inner.css; letters with no term are simply not rendered. */
.ln-az { margin-bottom: var(--bx-space-8); }
.ln-az .jump a { min-width: var(--bx-touch-target); justify-content: center; padding-inline: var(--bx-space-3); }

.ln-gl-group { display: grid; gap: var(--bx-space-2); scroll-margin-top: calc(var(--header-h) + var(--bx-space-4)); }
.zstack > .ln-gl-group { margin-top: var(--bx-space-12); }
.zstack > .ln-az + .ln-gl-group, .zstack > .zsec + .ln-gl-group { margin-top: var(--bx-space-12); }
.ln-gl-group > h2 { padding-top: var(--bx-space-3); border-top: var(--rule); font: 700 var(--bx-text-2xl)/1.1 var(--bx-font-mono); letter-spacing: 0; color: var(--bx-green-600); }
.ln-gl-list { display: grid; }
.ln-gl-term { display: grid; gap: var(--bx-space-2); padding: var(--bx-space-5) var(--bx-space-3) var(--bx-space-5) 0; border-bottom: var(--hair); min-width: 0; scroll-margin-top: calc(var(--header-h) + var(--bx-space-4)); }
/* The target highlight shows where a deep link (#quiet-zone) landed. It is a static tint, so it needs no motion rule. */
.ln-gl-term:target { padding-left: var(--bx-space-4); background: var(--bx-green-50); box-shadow: inset 4px 0 0 var(--bx-green-500); }
.ln-gl-term dt { font: 650 var(--bx-text-lg)/1.3 var(--bx-font-display); letter-spacing: -0.01em; color: var(--bx-ink); }
.ln-gl-term dt a { color: inherit; text-decoration: none; }
.ln-gl-term dt a:hover { color: var(--bx-green-600); text-decoration: underline; text-underline-offset: 0.2em; }
.ln-gl-term dt small { margin-left: var(--bx-space-2); font: 500 var(--bx-text-xs)/1.4 var(--bx-font-mono); letter-spacing: 0.04em; color: var(--bx-gray-600); white-space: normal; }
.ln-gl-term dd { margin: 0; display: grid; gap: var(--bx-space-2); min-width: 0; }
.ln-gl-term dd p { max-width: 54ch; color: var(--bx-gray-700); }
.ln-gl-term dd p.ln-see { font: 500 var(--bx-text-sm)/1.6 var(--bx-font-mono); color: var(--bx-gray-600); }
.ln-gl-term dd p.ln-see a { font-weight: 600; }
.ln-gl-term 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; }
.ln-gl-term .src-note { font-size: var(--bx-text-xs); color: var(--bx-gray-600); }

/* Dot-grid schematic in the glossary: same rules as the path diagram, drawn in a 400-wide box. */
.ln-grid-dg { display: block; width: 100%; max-width: 30rem; height: auto; }
.ln-grid-dg .gd-line { stroke: var(--bx-gray-200); stroke-width: 0.5; }
.ln-grid-dg .gd-bar { fill: var(--bx-ink); }
.ln-grid-dg .gd-qz { fill: var(--bx-green-50); }
.ln-grid-dg .gd-br { fill: none; stroke: var(--bx-green-600); stroke-width: 1.5; }
.ln-grid-dg .gd-txt { font: 600 12px var(--bx-font-mono); fill: var(--bx-green-600); }

/* ============================== SECURITY CARDS ============================== */
/* One block per control family: a short heading, one paragraph and the page it comes from. Two columns on wide screens. */
.ln-cards { display: grid; gap: var(--bx-space-6); }
@media (min-width: 48rem) { .ln-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ln-card { display: grid; gap: var(--bx-space-3); align-content: start; padding: var(--bx-space-5); background: var(--bx-surface); border: 1px solid var(--bx-border-strong); border-top: var(--rule); min-width: 0; }
.ln-card h3 { font-size: var(--bx-text-lg); }
.ln-card p { max-width: 54ch; color: var(--bx-gray-700); font-size: var(--bx-text-sm); }
.ln-card .ln-more { font: 600 var(--bx-text-xs)/1.5 var(--bx-font-mono); letter-spacing: 0.04em; }

/* ============================== PRINT ============================== */
/* Tables, diagrams and cards stay whole across pages. Shared print rules are in site.css and zpl.css. */
@media print {
  .ln-tab tr, .ln-defs > div, .ln-gl-term, .ln-fig, .ln-card, .ln-step { break-inside: avoid; }
  .ln-dg-box, .ln-dg-eng { fill: none; }
  .ln-az { display: none !important; }
}
