/* ==========================================================================================
   BarcoderX website: "Use cases, fonts and templates" layer. Author: BarcoderX.
   Pages: /use-cases/ and its three pages, /fonts-and-accents/, /templates-and-data/ and their Spanish twins.
   Loaded after site.css, inner.css, zpl.css and learn.css. The page frame, the responsive table (.ln-tab), the numbered
   legend (.ln-flow, .ln-legend), the definition rows (.ln-defs), the job-state chips (.ln-states) and the diagram
   primitives (.ln-dg-*) come from those files. This file only adds what they do not have: the label drawings
   (shipping, pallet, product), the font-coverage drawing and the byte-reading strip on the fonts page.
   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).
   ========================================================================================== */

/* ============================== LABEL DRAWINGS ============================== */
/* Every drawing is one SVG in a 400-wide box (the same box as the how-it-works path diagram), so its text stays near
   11 to 13 px on a 360px phone and no second, mobile-only drawing is needed. Drawn text is real SVG text, so it
   is selectable and translated in the markup; each SVG also carries a <desc> and the numbered legend beside it repeats
   every element in words. */
.uc-dg { display: block; width: 100%; max-width: 26rem; height: auto; overflow: visible; }

/* The label itself: a white sheet with the ink outline of the other diagrams. */
.uc-sheet { fill: var(--bx-surface); stroke: var(--bx-ink); stroke-width: 1.5; }
/* One content block of the label. Dashed green marks "a region", the same way the path diagram marks the boundary. */
.uc-blk { fill: none; stroke: var(--bx-green-600); stroke-width: 1.25; stroke-dasharray: 3 4; }
/* An element a label may or may not have (a 2D symbol): a lighter dash, so "optional" is visible without colour alone,
   and the legend says "optional" in words. */
.uc-opt { stroke: var(--bx-gray-500); stroke-dasharray: 2 5; }
/* A grey stand-in for a line of text or a logo whose content does not matter. */
.uc-ph { fill: var(--bx-gray-200); }
.uc-logo { fill: var(--bx-gray-100); stroke: var(--bx-gray-300); stroke-width: 1; }
/* Decorative bars and 2D modules. Never a real symbology; every caption says "not scannable". */
.uc-bar { fill: var(--bx-ink); }

/* Drawn text. Sizes are in SVG user units and scale with the drawing. */
.uc-tag { font: 600 12px var(--bx-font-mono); letter-spacing: 0.04em; fill: var(--bx-green-600); }
.uc-t { font: 650 15px var(--bx-font-display); fill: var(--bx-ink); }
.uc-s { font: 500 13px var(--bx-font-sans); fill: var(--bx-gray-700); }
.uc-big { font: 700 26px var(--bx-font-mono); fill: var(--bx-ink); }
.uc-mono { font: 600 13px var(--bx-font-mono); fill: var(--bx-ink); text-anchor: middle; }
.uc-mono-l { font: 600 13px var(--bx-font-mono); fill: var(--bx-ink); }
.uc-m { font: 500 12px var(--bx-font-mono); fill: var(--bx-ink); }

/* ============================== FONT COVERAGE DRAWING ============================== */
.uc-cov-n { font: 650 15px var(--bx-font-display); fill: var(--bx-ink); }
.uc-cov-r { font: 500 12px var(--bx-font-mono); fill: var(--bx-gray-700); }
/* The glyph samples are the point of the drawing, so they are large; the display face falls back per glyph where a
   character is outside its Latin subset, which is exactly the situation the page describes. */
.uc-cov-g { font: 600 20px var(--bx-font-display); fill: var(--bx-green-600); }
.uc-cov-out { fill: none; stroke: var(--bx-gray-500); stroke-width: 1.5; stroke-dasharray: 5 4; }

/* ============================== BYTE-READING STRIP ============================== */
/* Three cells joined by arrows: the character, the bytes a UTF-8 file holds for it, and what a reader that expects one
   byte per character shows. Plain HTML, so it needs no drawing and wraps on a phone. */
.uc-bytes { display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--bx-space-2); max-width: 40rem; margin: 0; padding: 0; list-style: none; }
.uc-bytes li { display: grid; gap: var(--bx-space-1); align-content: start; min-width: 8rem; flex: 1 1 8rem; padding: var(--bx-space-3) var(--bx-space-4); background: var(--bx-surface); border: 1px solid var(--bx-border-strong); }
.uc-bytes li.bad { border-style: dashed; background: var(--bx-warning-100); border-color: var(--bx-warning-ink); }
.uc-bytes b { display: block; font: 700 var(--bx-text-2xl)/1.1 var(--bx-font-mono); color: var(--bx-ink); letter-spacing: 0; }
.uc-bytes span { font: 500 var(--bx-text-xs)/1.4 var(--bx-font-mono); letter-spacing: 0.04em; color: var(--bx-gray-700); }
/* The sentence under each cell is real text, so the strip reads in order for a screen reader. */
.uc-bytes small { font-size: var(--bx-text-sm); line-height: 1.4; color: var(--bx-gray-700); }

/* ============================== CHARACTER TABLE ============================== */
/* The Spanish characters table keeps code points in mono and never wraps them in the middle of a value. */
.uc-code { font: 600 var(--bx-text-sm)/1.4 var(--bx-font-mono); white-space: nowrap; letter-spacing: 0; }
.uc-char { font: 700 var(--bx-text-xl)/1.1 var(--bx-font-display); color: var(--bx-ink); }

/* ============================== HUB CARDS ============================== */
/* A use-case card is a whole-card link: the heading link stretches over the card with a pseudo-element, so the click
   target is the full card and the accessible name is the heading alone. */
.uc-card { position: relative; }
.uc-card h3 a { color: var(--bx-ink); text-decoration: none; }
.uc-card h3 a::after { content: ""; position: absolute; inset: 0; }
.uc-card h3 a:hover { color: var(--bx-green-600); text-decoration: underline; text-underline-offset: 0.2em; }
.uc-card .ln-facts div { grid-template-columns: 6.5rem minmax(0, 1fr); }
/* Three cards in a row from 64rem; the shared two-column grid applies below that. */
@media (min-width: 64rem) { .uc-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* The ZPL command list on a use-case page: command name in mono beside its one-line description. */
.ln-defs dt .uc-cmd { white-space: nowrap; }

/* ============================== PRINT ============================== */
@media print {
  .uc-dg, .uc-bytes li, .uc-card { break-inside: avoid; }
  .uc-sheet { fill: none; }
}

/* The Spanish characters table stays a real four-column table on phones: every cell is a short code, so it needs no
   card layout (the shared .ln-tab turns rows into cards, which would make ten characters a very long scroll). */
.uc-ctab { width: 100%; max-width: 40rem; border-collapse: collapse; border-top: var(--rule); }
.uc-ctab th, .uc-ctab td { padding: var(--bx-space-2) var(--bx-space-3) var(--bx-space-2) 0; text-align: left; vertical-align: middle; border-bottom: var(--hair); }
.uc-ctab thead th { font: 600 var(--bx-text-xs)/1.4 var(--bx-font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--bx-gray-600); border-bottom: 1px solid var(--bx-border-strong); }
.uc-ctab tbody th { width: 4rem; }
/* GS1 section references (.pg) are nowrap in the ZPL layer, which is right for one or two numbers. Several references
   in a row ("GS 6.6.4.1.1; LLG 6-13, 6-22") are wider than a phone, so inside running text, table cells and the legend they wrap. */
.prose .pg, .ln-tab .pg, .ln-legend .pg { white-space: normal; }