/* Resources: article prose: headings, lists, callouts, formulas, tables, inline links. Scoped to .resources-page. */

.resources-page .res-body {
  --res-text: color-mix(in srgb, var(--ink) 82%, var(--muted));
  --res-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --res-tint: color-mix(in srgb, var(--blue) 7%, var(--surface, #fff));
  --res-tint-line: color-mix(in srgb, var(--blue) 26%, transparent);
  counter-reset: res-section;
  font-size: 17px;
  line-height: 1.74;
  font-feature-settings: "calt", "kern", "liga";
  overflow-wrap: break-word;
}

/* ---- Paragraphs: measure, rhythm, intro -------------------------------- */
.resources-page .res-body p,
.resources-page .res-body li {
  color: var(--res-text);
  text-wrap: pretty;
  hanging-punctuation: first;
}
.resources-page .res-body p { margin: 0 0 20px; }
.resources-page .res-body > p:first-child {
  margin-bottom: 8px;
  font-size: 19.5px;
  line-height: 1.66;
  letter-spacing: -.008em;
  color: var(--ink);
}
.resources-page .res-body > p:first-child strong { background: none; padding: 0; }

/* ---- Headings ---------------------------------------------------------- */
.resources-page .res-body h2 {
  position: relative;
  margin: 60px 0 18px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  font-size: clamp(25px, 2.7vw, 31px);
  line-height: 1.18;
  letter-spacing: -.032em;
  text-wrap: balance;
  counter-increment: res-section;
}
.resources-page .res-body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.resources-page .res-body h2::before {
  content: counter(res-section, decimal-leading-zero);
  content: counter(res-section, decimal-leading-zero) / "";
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-family: var(--res-mono);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .14em;
  color: var(--blue-ink);
}
.resources-page .res-body h2::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 44px;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
}
.resources-page .res-body h2:first-child::after { display: none; }
.resources-page .res-body h3 {
  margin: 38px 0 10px;
  font-size: clamp(18.5px, 2vw, 21px);
  line-height: 1.3;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.resources-page .res-body :is(h2, h3) + :is(ul, ol, .res-callout, .res-table-wrap, .res-formula) { margin-top: 4px; }

/* Heading permalink: appears on hover or focus, quiet otherwise. */
.resources-page .res-body .res-anchor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: 6px;
  vertical-align: .12em;
  border-radius: 8px;
  color: var(--quiet, var(--muted));
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
  transition: opacity .16s ease, color .16s ease, background-color .16s ease;
}
.resources-page .res-body .res-anchor svg { width: 16px; height: 16px; flex: none; }
.resources-page .res-body h2:hover .res-anchor,
.resources-page .res-body .res-anchor:focus-visible { opacity: 1; }
.resources-page .res-body .res-anchor:hover {
  color: var(--blue-ink);
  background: color-mix(in srgb, var(--blue) 10%, transparent);
}
.resources-page .res-body .res-anchor:focus-visible {
  outline: 2px solid var(--focus-ring, #00437c);
  outline-offset: 2px;
}
.resources-page .res-body h2:target::before { color: var(--ink); }
@media (hover: none) {
  .resources-page .res-body .res-anchor { opacity: .5; }
}

/* ---- Links ------------------------------------------------------------- */
.resources-page .res-body a:not(.res-anchor) {
  color: var(--blue-ink);
  font-weight: 620;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-decoration-color: color-mix(in srgb, var(--blue-ink) 38%, transparent);
  text-underline-offset: .22em;
  text-decoration-skip-ink: auto;
  transition: color .16s ease, text-decoration-color .16s ease;
}
.resources-page .res-body a:not(.res-anchor):hover {
  color: var(--ink);
  text-decoration-color: var(--blue);
}
.resources-page .res-body a[target="_blank"]::after {
  content: "";
  display: inline-block;
  width: .7em;
  height: .7em;
  margin-left: .24em;
  background: currentColor;
  opacity: .72;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---- Bold: control names read as quiet labels --------------------------- */
.resources-page .res-body strong { color: var(--ink); font-weight: 650; }
.resources-page .res-body :is(p, li) strong {
  padding: .04em .24em .06em;
  border-radius: 5px;
  background: color-mix(in srgb, var(--blue) 7%, transparent);
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--blue) 18%, transparent);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.resources-page .res-body :is(.res-callout, .res-table) strong {
  padding: 0;
  background: none;
  box-shadow: none;
  font-weight: 700;
}

/* ---- Lists ------------------------------------------------------------- */
.resources-page .res-body :is(ul, ol) {
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}
.resources-page .res-body li {
  position: relative;
  margin: 0;
  padding: 0 0 0 4px;
}
.resources-page .res-body ul > li {
  padding: 0 0 0 26px;
  margin-bottom: 12px;
}
.resources-page .res-body ul > li:last-child { margin-bottom: 0; }
.resources-page .res-body ul > li::before {
  content: "";
  position: absolute;
  left: 7px;
  top: .72em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--blue);
  transform: rotate(45deg) translateY(-50%);
  transform-origin: center;
}

/* Numbered steps: a badge per step, joined by a quiet rail. */
.resources-page .res-body ol { counter-reset: res-step; }
.resources-page .res-body ol > li {
  counter-increment: res-step;
  min-height: 62px;
  padding: 3px 0 26px 54px;
}
.resources-page .res-body ol > li:last-child { min-height: 34px; padding-bottom: 2px; }
.resources-page .res-body ol > li::before {
  content: counter(res-step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--res-tint-line);
  background: var(--res-tint);
  color: var(--blue-ink);
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.resources-page .res-body ol > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 40px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(to bottom, var(--res-tint-line), color-mix(in srgb, var(--line-strong, var(--line)) 80%, transparent));
}

/* ---- Callout ----------------------------------------------------------- */
.resources-page .res-body .res-callout {
  margin: 12px 0 30px;
  padding: 16px 22px 18px 24px;
  border: 1px solid var(--res-tint-line);
  border-radius: 14px;
  background: var(--res-tint);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--surface, #fff) 70%, transparent) inset;
}
.resources-page .res-body .res-callout::before {
  top: 14px;
  bottom: 14px;
  width: 3px;
  background: var(--blue);
}
.resources-page .res-body .res-callout-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--blue-ink);
}
.resources-page .res-body .res-callout-label svg { width: 16px; height: 16px; flex: none; }
.resources-page .res-body .res-callout p {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--ink);
}
.resources-page .res-body .res-callout-lead { font-weight: 700; }

/* ---- Formula ----------------------------------------------------------- */
.resources-page .res-body .res-formula {
  margin: 8px 0 28px;
  padding: 16px 22px;
  border: 1px solid var(--atm-card-line, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--blue) 5%, var(--surface, #fff));
  box-shadow: inset 3px 0 0 var(--blue);
  overflow-x: auto;
  scrollbar-width: thin;
  line-height: 1.5;
}
.resources-page .res-body .res-formula code {
  display: inline-block;
  font-family: var(--res-mono);
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: -.005em;
  color: var(--ink);
  white-space: pre;
}
.resources-page .res-body :is(.res-formula, .res-table-wrap):focus-visible {
  outline: 2px solid var(--focus-ring, #00437c);
  outline-offset: 3px;
}

/* ---- Table ------------------------------------------------------------- */
.resources-page .res-body .res-table-wrap {
  margin: 8px 0 30px;
  border-radius: 14px;
  border: 1px solid var(--atm-card-line, var(--line));
  background: var(--surface, var(--paper));
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 5%, transparent);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.resources-page .res-body .res-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
}
.resources-page .res-body .res-table caption {
  caption-side: top;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.45;
  text-align: left;
}
.resources-page .res-body .res-table th,
.resources-page .res-body .res-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  color: var(--res-text);
}
.resources-page .res-body .res-table thead th {
  background: color-mix(in srgb, var(--blue) 7%, var(--surface, #fff));
  border-bottom: 1px solid var(--line-strong, var(--line));
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.resources-page .res-body .res-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--blue) 3.5%, transparent);
}
.resources-page .res-body .res-table tbody tr:last-child td { border-bottom: 0; }
.resources-page .res-body .res-table tbody td:first-child { color: var(--ink); font-weight: 600; }

/* ---- Small screens ----------------------------------------------------- */
@media (max-width: 560px) {
  .resources-page .res-body { font-size: 16.5px; line-height: 1.7; }
  .resources-page .res-body > p:first-child { font-size: 18px; }
  .resources-page .res-body h2 { margin-top: 48px; padding-top: 24px; }
  .resources-page .res-body ol > li { padding-left: 48px; }
  .resources-page .res-body ol > li::before { width: 32px; height: 32px; font-size: 13.5px; }
  .resources-page .res-body ol > li:not(:last-child)::after { left: 15px; top: 38px; }
  .resources-page .res-body .res-callout { padding: 14px 16px 16px 20px; }
  .resources-page .res-body .res-formula { padding: 14px 16px; }
  .resources-page .res-body .res-formula code { font-size: 14.5px; }
}

/* ---- Figures: framed captures of the product --------------------------- */
.resources-page .res-body .res-shot {
  margin: 14px 0 34px;
}
.resources-page .res-body .res-shot.is-wide {
  margin-inline: calc(14px - clamp(22px, 3vw, 36px));
}
.resources-page .res-body .res-frame {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--atm-card-line, var(--line));
  border-radius: 14px;
  background: var(--paper, #fff);
  box-shadow:
    0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent),
    0 18px 40px -22px color-mix(in srgb, var(--ink) 38%, transparent);
}
.resources-page .res-body .res-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}
.resources-page .res-body .res-frame .res-img-dark,
html[data-site-theme="dark"] .resources-page .res-body .res-frame .res-img-light { display: none; }
html[data-site-theme="dark"] .resources-page .res-body .res-frame .res-img-dark { display: block; }
html[data-site-theme="dark"] .resources-page .res-body .res-frame img:not(.res-img-dark) { filter: brightness(.94); }
html[data-site-theme="dark"] .resources-page .res-body .res-frame {
  border-color: rgba(124, 192, 255, .3);
  box-shadow: 0 1px 0 rgba(230, 237, 245, .07) inset, 0 22px 48px -24px rgba(0, 0, 0, .8);
}
.resources-page .res-body .res-shot figcaption {
  margin: 12px 4px 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  text-wrap: pretty;
}
.resources-page .res-body .res-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
/* Three captures sit as a pair with the third centred beneath, so each stays large enough to read. */
.resources-page .res-body .res-gallery.has-3 .res-frame:nth-child(3) {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc(50% - 6px);
}
.resources-page .res-body .res-gallery .res-frame { border-radius: 12px; }

@media (max-width: 640px) {
  .resources-page .res-body .res-gallery-grid { grid-template-columns: minmax(0, 1fr); }
  .resources-page .res-body .res-gallery.has-3 .res-frame:nth-child(3) { width: 100%; }
  .resources-page .res-body .res-shot.is-wide { margin-inline: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .resources-page .res-body .res-anchor,
  .resources-page .res-body a:not(.res-anchor) { transition: none; }
}
