/* Badge label for the "In The Loop 2026" card, as a reusable template.
 *
 * The label is a 76 × 75 mm box (a hair inside both the physical 3 × 3 in
 * label and a "76 × 76 mm" custom paper, so it never spills onto a second
 * page), stuck on an 88 × 140 mm preprinted card. Every position below is in
 * the card's coordinate system (mm from the card's top-left corner) shifted
 * by the label offset, so the text registers with the preprinted artwork.
 *
 * Markup (live text):
 *
 *   <div class="label" style="--label-h: 75mm; --ox: 5.9mm; --oy: 55mm; --name-pt: 38; --creds-pt: 11">
 *     <div class="names">
 *       <div></div>
 *       <div>First name</div>
 *       <div>Last name</div>
 *     </div>
 *     <div class="creds">Title, role and
 *   other pertinent
 *   credentials</div>
 *   </div>
 *
 * The .label may instead hold one <svg> (the outline rendering).
 *
 * Several labels in one document (a batch) are .label siblings in plain
 * flow; each one after the first starts a new page.
 *
 * The three name lines are category, first name, last name. The 3 × 3 in
 * label is too short to hold all three and the credentials: it sits 55 mm
 * from the card's top edge, just above the first name (55.6 mm under an Å,
 * 58.6 mm under a plain capital) and runs to 130 mm, past the preprinted
 * credentials box. The category line (baseline 54.58 mm) is above it: keep
 * its <div> empty, it still takes its pitch.
 *
 * 3 × 4 in label (76.2 × 101.6 mm) on the same card: set --label-h: 100mm
 * and --oy: 32mm, and print on a 76.2 × 101.6 mm page. It holds the
 * category line too.
 *
 * Roll stock with the label's short side along the roll (the roll is 4 in
 * wide, the label 3 in long): the printer sees a 101.6 × 76.2 mm page, so
 * print each label turned a quarter turn clockwise. Wrap it:
 *
 *   <div class="rotated" style="--label-h: 100mm">
 *     <div class="label" style="--label-h: 100mm; --oy: 32mm; ...">...</div>
 *   </div>
 *
 * and print on a 101.6 × 76.2 mm page. The wrapper takes the turned box's
 * room in flow (--label-h wide, 76 mm tall, so it needs --label-h too), and
 * in a batch the page break sits between the wrappers.
 *
 * Variables, set on .label (or inherited):
 *   --label-h     height of the printed box. Default 75mm (3 × 3 in label);
 *                 100mm for the 3 × 4 in label.
 *   --ox, --oy    where the label sits on the card: distance from the card's
 *                 left and top edges. Defaults 5.9 mm and 55 mm (32 mm for the
 *                 3 × 4 in label).
 *   --name-pt     size of the three name lines in points, unitless. Default
 *                 38. Shrink all three together so the widest line stays
 *                 inside the label (and 6 mm clear of the card's right edge).
 *   --creds-pt    size of the credentials in points, unitless. Default 11,
 *                 floor 7: step down by 0.5 until the block stays inside the
 *                 preprinted box (above 127 mm) and on the label (1 mm above
 *                 its bottom edge, --oy + --label-h) and no line is wider
 *                 than 34 mm.
 *
 * Font: EK Baumer Plus (variable), Medium (weight 500) throughout, per the
 * designer's character settings: ligatures and contextual alternates on,
 * kerning on, stylistic set "Alternate a" (ss06) on, tracking 35 (InDesign
 * units, 0.035 em) on the names. Names use the display optical
 * size (opsz 144), credentials the text optical size (opsz 10). Vertical
 * metrics are ascender 928 / descender -228 per 1000 with no line gap, so in
 * a line box of pitch P at size S the baseline sits P/2 + 0.35 S below the
 * top of the line; the `top` values below place the first baselines at
 * 54.58 mm (names) and 104.24 mm (credentials).
 */

@font-face {
  font-family: 'EK Baumer Plus';
  src: url('EKBaumerPlus-Variable.ttf') format('truetype');
  font-weight: 400 800;
  font-display: block;
}

.label {
  position: relative;
  width: 76mm;
  height: var(--label-h, 75mm);
  overflow: hidden;
  margin: 0;
  padding: 0;
  background: transparent;
  color: #000;
  font-family: 'EK Baumer Plus', sans-serif;
  font-kerning: normal;
  font-optical-sizing: none;
  text-rendering: geometricPrecision;
}

.label + .label,
.rotated + .rotated {
  break-before: page;
  page-break-before: always;
}

/* The label turned a quarter turn clockwise, for roll stock fed short side
   first: the card's top edge ends up on the right. The wrapper is the turned
   box's size; the label pivots about its top-left corner and is pushed back
   onto the page. */
.rotated {
  width: var(--label-h, 75mm);
  height: 76mm;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.rotated > .label {
  transform: translate(var(--label-h, 75mm), 0) rotate(90deg);
  transform-origin: 0 0;
}

/* Outline rendering: one SVG whose user unit is 1 mm. */
.label svg {
  display: block;
  width: 76mm;
  height: var(--label-h, 75mm);
}

/* Category, first name, last name: 38 pt Medium set solid (38 pt pitch),
   tracking 0.035 em, "Alternate a", left edge 9.82 mm from the card edge,
   first baseline 54.58 mm. */
.label .names {
  position: absolute;
  left: calc(9.82mm - var(--ox, 5.9mm));
  top: calc(54.58mm - var(--oy, 55mm) - var(--name-pt, 38) * 0.85pt);
  margin: 0;
  font-size: calc(var(--name-pt, 38) * 1pt);
  line-height: 1;
  font-weight: 500;
  font-variation-settings: 'opsz' 144, 'wght' 500, 'slnt' 0;
  letter-spacing: 0.035em;
  font-feature-settings: 'liga', 'calt', 'kern', 'ss06';
  white-space: nowrap;
}
.label .names > div {
  margin: 0;
  padding: 0;
}
/* An empty line still takes its pitch. */
.label .names > div:empty::before {
  content: '\00a0';
}

/* Title, role and credentials: 11 pt Medium on a 13 pt pitch, wrapped at
   34 mm inside the preprinted box, left edge 14.67 mm, first baseline
   104.24 mm. Line breaks in the text are kept. */
.label .creds {
  position: absolute;
  left: calc(14.67mm - var(--ox, 5.9mm));
  top: calc(104.24mm - var(--oy, 55mm) - var(--creds-pt, 11) * 0.94091pt);
  width: 34mm;
  margin: 0;
  font-size: calc(var(--creds-pt, 11) * 1pt);
  line-height: calc(var(--creds-pt, 11) * 1pt * 13 / 11);
  font-weight: 500;
  font-variation-settings: 'opsz' 10, 'wght' 500, 'slnt' 0;
  font-feature-settings: 'liga', 'calt', 'kern', 'ss06';
  white-space: pre-wrap;
  overflow-wrap: normal;
}
