/* StrategyNodes docs brand layer — matches the app + landing palette. */
:root {
  --sn-blue: #4F8CFF;
  --sn-violet: #8B5CF6;
  --sn-grad: linear-gradient(90deg, var(--sn-blue), var(--sn-violet));
  --md-primary-fg-color: #4F8CFF;
  --md-accent-fg-color: #8B5CF6;
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color: #0e1116;
  --md-default-fg-color: #cfd3dc;
  --md-typeset-a-color: #6ea8ff;
  --md-code-bg-color: #161a22;
}

/* Gradient brand mark in the header title */
.md-header__title { font-weight: 700; }

/* Category chip on block pages */
.doc-cat {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8b909c;
}

/* Make h1 pop with the brand gradient underline */
.md-typeset h1 {
  font-weight: 800;
  background: none;
}
.md-typeset h1::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin-top: 8px;
  border-radius: 3px;
  background: var(--sn-grad);
}

/* Reference tables: tighter, monospace types */
.md-typeset table:not([class]) {
  font-size: 0.78rem;
}
.md-typeset table:not([class]) th {
  background: rgba(79, 140, 255, 0.08);
}

/* Blockquote = the one-line block summary — give it brand emphasis */
.md-typeset blockquote {
  border-left: 3px solid var(--sn-violet);
  color: #aeb3bd;
}

/* Hero: node on the left, its explanation on the right */
.block-hero {
  display: grid;
  grid-template-columns: minmax(210px, 260px) 1fr;
  gap: 26px;
  align-items: start;
  margin: 1.1rem 0 1.6rem;
}
.block-hero .bh-node {
  margin: 0;
  background: #11141a;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.block-hero .bh-node img { display: block; width: 100%; max-width: 240px; margin: 0 auto; height: auto; }
.block-hero .bh-text { font-size: 0.92rem; line-height: 1.65; }
.block-hero .bh-text > :first-child { margin-top: 0; }
.block-hero figcaption {
  margin-top: 8px;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8b909c;
}

/* Full-width chart (in the Example / On-the-chart section).
   Override Material's figure shrink-wrap (it sizes to the image's intrinsic
   300px otherwise) so the chart fills the content column. */
.md-typeset figure.bh-chart {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 0 0.6rem;
  background: #11141a;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 12px;
}
.md-typeset figure.bh-chart img {
  display: block;
  width: 100%;
  max-width: none;   /* SVG has no intrinsic width — fill the figure */
  height: auto;
}
figure.bh-chart figcaption {
  margin-top: 8px;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8b909c;
  text-align: center;
}

@media (max-width: 760px) {
  .block-hero { grid-template-columns: 1fr; gap: 14px; }
  /* Centre + cap the node image so it doesn't span edge-to-edge on a phone */
  .block-hero .bh-node img { max-width: 220px; }
}

/* ===========================================================================
   Mobile: turn the wide reference tables (Inputs / Outputs / Parameters) into
   stacked, labelled cards. On a phone a 4-column table with a long prose
   column gets crushed to an unreadable sliver and forces horizontal scroll;
   cards keep every field readable. data-label is injected by tablecards.js.
   =========================================================================== */
@media (max-width: 680px) {
  .md-typeset table:not([class]) { font-size: 0.82rem; }

  .md-typeset table[data-cards] {
    display: block;
    border: 0;
    font-size: 0.86rem;
  }
  .md-typeset table[data-cards] thead { display: none; }            /* headers move into each cell */
  .md-typeset table[data-cards] tbody,
  .md-typeset table[data-cards] tr,
  .md-typeset table[data-cards] td { display: block; width: auto; }

  .md-typeset table[data-cards] tr {
    background: #11141a;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    margin: 0 0 12px;
    overflow: hidden;
  }

  .md-typeset table[data-cards] td {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 9px 14px;
    text-align: left;
    white-space: normal;       /* let long descriptions wrap */
  }
  .md-typeset table[data-cards] td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.66rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 700;
    color: #8b909c;
    margin-bottom: 3px;
  }

  /* First cell = the block/socket/param name → card title, no redundant label */
  .md-typeset table[data-cards] td:first-child {
    border-top: 0;
    background: rgba(79, 140, 255, 0.07);
    font-size: 0.98rem;
    font-weight: 700;
    padding-top: 11px;
    padding-bottom: 11px;
  }
  .md-typeset table[data-cards] td:first-child::before { display: none; }

  /* Keep the hero chart and node comfortably sized */
  .md-typeset figure.bh-chart { padding: 8px; }
}
