/* Chrome for the email-signature generator on office/email-signature.md.
   The generator itself is docs/javascripts/email-signature.js.

   Its own file rather than a block in extra.css for two reasons: this is one
   page's furniture, not a brand token, and a new URL cannot be answered from a
   cache of the old extra.css — which is how the first version of this page came
   up unstyled for a reader who had visited the site before. */

/* ------------------------------------------------------------------ the form */

.md-typeset .sig-builder {
  margin: 1.2rem 0 1.6rem;
}
.md-typeset .sig-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.8rem 1rem;
  margin-bottom: 1.2rem;
}
.md-typeset .sig-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.md-typeset .sig-field__label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
}
.md-typeset .sig-field__label span {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--md-default-fg-color--lighter);
}
.md-typeset .sig-field input {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  background-color: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font-family: inherit;
  font-size: 0.75rem;
  line-height: 1.5;
}
.md-typeset .sig-field input::placeholder {
  color: var(--md-default-fg-color--lightest);
}
.md-typeset .sig-field input:focus {
  outline: none;
  border-color: var(--bnbk-red);
  box-shadow: 0 0 0 3px rgba(219, 36, 36, 0.15);
}

/* --------------------------------------------------------- the preview cards */

/* Two cards side by side, stacking when there is no room for both. The minimum is
   14rem and not more: Material's root font-size is 125%, so a rem is 20px and the
   content column is only ~34rem wide — at 17rem the pair never fit and silently
   stacked for the whole width. */
.md-typeset .sig-previews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.8rem;
  margin: 0 0 1.1rem;
}

/* Each card simulates a mail client, so its colours are FIXED rather than
   following the docs theme: a "light client" card that goes dark in dark mode is
   showing the wrong thing. Hence the literal hexes here and nowhere else. */
.md-typeset .sig-card {
  margin: 0;
  padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background-color: #ffffff;
  box-shadow: 0 4px 20px -4px rgba(16, 24, 32, 0.06);
}
.md-typeset .sig-card--dark {
  border-color: #24313f;
  background-color: #101820;
}
/* In the docs' own dark mode the card fill equals the page fill, so the card
   disappears and the preview reads as loose text. The *fill* is the simulation and
   must not move; the border is chrome, so that is what gets raised. */
[data-md-color-scheme="slate"] .md-typeset .sig-card--dark {
  border-color: #3d4f61;
}
.md-typeset .sig-cap {
  margin: 0 0 0.85rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.55rem;
  font-style: normal;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
  color: #64748b;                     /* 4.76:1 on the white card */
}
.md-typeset .sig-card--dark .sig-cap {
  color: #94a3b8;                     /* 6.44:1 on the #101820 card */
}

/* A dark client inverts the signature's own inline colours; it does that through
   the hooks the markup carries (.sig-name / .sig-text / .sig-muted), so the dark
   card reproduces exactly that. !important because inline styles outrank a
   stylesheet — the signature has to keep its colours in clients with no dark
   mode at all. */
.md-typeset .sig-card--dark .sig-name,
.md-typeset .sig-card--dark .sig-text,
.md-typeset .sig-card--dark .sig-text a {
  color: #f8fafc !important;
}
.md-typeset .sig-card--dark .sig-muted {
  color: #94a3b8 !important;
}

/* The preview is real signature markup, so the theme's typeset rules have to stay
   off it — Material paints a table with the *page* background, borders it, shrinks
   its font and pads every cell, none of which a recipient will ever see. The
   markup's own `class="sig-table"` already makes Material's `table:not([class])`
   family miss; this is the belt to that braces, and it also covers the row-hover
   tint and any bare table a future theme version styles. */
.md-typeset .sig-stage {
  line-height: normal;
  overflow-x: auto;
}
.md-typeset .sig-stage table,
.md-typeset .sig-stage table:not([class]) {
  display: table;
  width: auto;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  box-shadow: none;
  overflow: visible;
  font-size: 16px;
}
.md-typeset .sig-stage table tr,
.md-typeset .sig-stage table tr:hover,
.md-typeset .sig-stage table:not([class]) tbody tr:hover {
  background-color: transparent;
  box-shadow: none;
}
.md-typeset .sig-stage table td,
.md-typeset .sig-stage table:not([class]) td {
  border: 0;
  padding: 0;
  background: none;
  font-size: inherit;
  vertical-align: top;
}
.md-typeset .sig-stage a,
.md-typeset .sig-stage a:hover {
  text-decoration: none;
}

/* ----------------------------------------------------------------- the actions */

.md-typeset .sig-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.7rem;
}
/* The fill is the literal brand red in BOTH schemes, not var(--bnbk-red): that token
   lightens to #f26d6d in dark mode, where white label text lands at 2.60:1 — under
   AA on the page's primary action. #DB2424 carries white at 4.90:1 on either
   background, so the button is legible in both and the ink never has to change. */
.md-typeset .sig-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #db2424;
  border-radius: 8px;
  background-color: #db2424;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 125ms, border-color 125ms, color 125ms;
}
.md-typeset .sig-btn:hover:not([disabled]) {
  background-color: #b01d1d;
  border-color: #b01d1d;
}
.md-typeset .sig-btn--ghost {
  border-color: var(--md-default-fg-color--lightest);
  background-color: transparent;
  color: var(--md-default-fg-color--light);
  font-weight: 500;
}
.md-typeset .sig-btn--ghost:hover:not([disabled]) {
  border-color: var(--md-default-fg-color--lighter);
  background-color: var(--md-code-bg-color);
  color: var(--md-default-fg-color);
}
.md-typeset .sig-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}
.md-typeset .sig-status {
  font-size: 0.68rem;
  color: var(--md-default-fg-color--light);
}
