/*
 * .seq-mail — the transactional email (docs/design-system/component-inventory.md, "Mail layout").
 *
 * Text-first, max width --measure-mail (600px, _layout.css), a light ground, and the same type
 * roles as every other module (01-settings/_typography.css). No literal font fallback is
 * carried here: each face token already ends in the gem's system stack ("DM Sans", system-ui,
 * sans-serif and so on), which is what a mail client that will not load self-hosted fonts
 * falls back to, and a client that ignores custom properties drops a var() declaration whole,
 * so a fallback inside var() never reached one. Checked 2026-09-22: no mailer renders
 * .seq-mail yet (app/views/layouts/mailer.html.erb has no inliner), so /showcase is its only
 * surface; whoever wires it into a mailer resolves the custom properties when inlining. The
 * light-ground role values live in _color-semantic.css under `.seq-mail`, so the email never
 * leaks light styles outside its root. Rendered by layouts/mailer.html.erb around the two
 * issue_mailer views (docs/plans/seq-redesign.md § 5).
 *
 * Carries: the subject, the run's facts as a definition list, the steps as a plain list in
 * .seq-mail__strip (one step per line, the state as a word, never an image), one link into
 * Seq, and the operator instruction as .seq-mail__means.
 *
 * Markup:
 *   <div class="seq-mail theme-light" data-tenant="geneops-production">
 *     <header class="seq-mail__head"><span class="seq-mail__brand">Seq</span> <span class="seq-mail__tenant">geneops-production</span></header>
 *     <h1 class="seq-mail__subject">…</h1>
 *     <dl class="seq-mail__facts"><div class="seq-mail__fact"><dt>sample</dt><dd>NA12878</dd></div>…</dl>
 *     <div class="seq-mail__strip"><ol>…one step per line…</ol></div>
 *     <p class="seq-mail__means">…</p>
 *     <p><a class="seq-mail__link" href="…">Open issues #31 in Seq</a></p>
 *     <footer class="seq-mail__foot">…</footer>
 *   </div>
 *
 * The showcase frames a specimen in .sg-mail-preview, showcase chrome in 08-pages/_sg.css.
 */

.seq-mail {
  --_ground:   var(--background-base);
  --_ink:      var(--text-primary);
  --_ink-2:    var(--text-secondary);
  --_rule:     var(--border-default);
  --_ornament: var(--border-strong);              /* the mail's rules are grey: gold marks the production configuration only */
  box-sizing: border-box;
  max-width: var(--measure-mail);
  width: 100%;
  margin-inline: auto;
  padding: var(--spacing-24);
  background: var(--_ground);
  color: var(--_ink);
  font-family: var(--font-family-body);
  font-size: var(--font-size-16);
  font-weight: var(--font-weight-400);
  line-height: 1.5;
  border-block-start: var(--stroke-weight-1) solid var(--_ornament);   /* ornament is a hairline, never heavier (concept.md § Discipline rules) */
}
.seq-mail code {
  font-family: var(--font-family-mono);
  font-variant-numeric: var(--numerals);
  font-size: inherit;
  font-weight: var(--font-weight-400);
}

/* ---------- Head: product word and tenant ---------- */
.seq-mail__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--spacing-8);
  padding-block-end: var(--spacing-8);
  border-block-end: var(--stroke-weight-1) solid var(--_rule);
}
.seq-mail__brand {
  font-family: var(--font-family-body);
  font-size: var(--font-size-14);
  font-weight: var(--font-weight-400);
  color: var(--_ink);
}
.seq-mail__tenant {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-12);
  font-weight: var(--font-weight-400);
  color: var(--_ink-2);
  padding-block-end: var(--spacing-2);
  border-block-end: var(--stroke-weight-1) solid var(--_ornament);
}
.seq-mail[data-tenant="geneops-laboratory"] .seq-mail__tenant {
  border-block-end-style: dashed;
}

/* ---------- Subject line ---------- */
.seq-mail__subject {
  font-family: var(--font-family-display);
  font-size: var(--font-size-24);
  font-weight: var(--font-weight-700);
  line-height: 1.3;
  margin-block: var(--spacing-16) var(--spacing-12);
}
.seq-mail__subject code {
  font-weight: var(--font-weight-400);
}

/* ---------- Facts: key in the label face, value in mono ---------- */
.seq-mail__facts {
  margin: 0 0 var(--spacing-16);
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--spacing-4) var(--spacing-16);
  font-size: var(--font-size-14);
}
.seq-mail__fact {
  display: contents;
}
.seq-mail__facts dt {
  font-family: var(--font-family-body);
  font-size: var(--font-size-14);
  font-weight: var(--font-weight-400);
  color: var(--_ink-2);
}
.seq-mail__facts dd {
  margin: 0;
  font-family: var(--font-family-mono);
  font-size: var(--font-size-14);
  font-weight: var(--font-weight-400);
  font-variant-numeric: var(--numerals);
  overflow-wrap: anywhere;
}

/* ---------- The steps as a plain list in a hairline frame ---------- */
.seq-mail__strip {
  margin: 0 0 var(--spacing-16);
  padding: var(--spacing-12) var(--spacing-16);
  border: var(--stroke-weight-1) solid var(--_rule);
  border-radius: var(--corner-radius-xs);
  font-family: var(--font-family-mono);
  font-size: var(--font-size-14);
  font-weight: var(--font-weight-400);
  font-variant-numeric: var(--numerals);
}
/* One step per line. */
.seq-mail__strip ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.seq-mail__strip li {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-8);
}

/* ---------- The operator instruction ---------- */
.seq-mail__means {
  margin: 0 0 var(--spacing-16);
  padding-inline-start: var(--spacing-12);
  border-inline-start: var(--stroke-weight-1) solid var(--_rule);
  color: var(--_ink-2);
  font-size: var(--font-size-14);
}

/* ---------- The one link: underlined text, never a gradient button ---------- */
.seq-mail__foot {
  margin-block-start: var(--spacing-24);
  padding-block-start: var(--spacing-8);
  border-block-start: var(--stroke-weight-1) solid var(--_rule);
  font-family: var(--font-family-mono);
  font-size: var(--font-size-12);
  font-weight: var(--font-weight-400);
  font-variant-numeric: var(--numerals);
  color: var(--_ink-2);
  overflow-wrap: anywhere;
}
