/* Cards docs — design language.
 *
 * 1. Semantic color + icons. Each entity keeps ONE icon and ONE hue everywhere
 *    it appears, so color carries meaning instead of decoration:
 *      board / web UI   blue    (material: view-column / palette)
 *      schema / types   violet  (material: shape)
 *      agents / MCP     green   (material: robot)
 *      CLI              orange  (material: console)
 *      API / events     rose    (material: broadcast / code-json)
 *    Indigo (Material accent) is reserved for actions and navigation.
 *    Apply with `.ic-board`, `.ic-schema`, `.ic-agent`, `.ic-cli`, `.ic-api`
 *    on an inline icon: `:material-robot-outline:{ .ic-agent }`.
 *
 * 2. Dual-weight type. Headings, card titles, and callout titles are heavy
 *    (700/600); body copy stays 400. No mid-weights on body text.
 */

:root {
  --md-primary-fg-color: #111418;
  --md-accent-fg-color: #4a5df9;
  --cards-board: #1971c2;
  --cards-schema: #6741d9;
  --cards-agent: #099268;
  --cards-cli: #e8590c;
  --cards-api: #c2255c;
}

[data-md-color-scheme="slate"] {
  --cards-board: #4dabf7;
  --cards-schema: #9775fa;
  --cards-agent: #38d9a9;
  --cards-cli: #ffa94d;
  --cards-api: #f783ac;
  /* Lighten the dark scheme slightly (Material default is 14% lightness). */
  --md-default-bg-color: hsla(232, 15%, 17%, 1);
  --md-code-bg-color: hsla(232, 15%, 22%, 1);
}

/* --- dual-weight typography ------------------------------------------------ */

.md-typeset h1 {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--md-default-fg-color);
}
.md-typeset h2 {
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--md-default-fg-color);
}
.md-typeset h3,
.md-typeset h4 {
  font-weight: 600;
  color: var(--md-default-fg-color);
}
/* Stronger white headings in the dark scheme (Material dims them by default). */
[data-md-color-scheme="slate"] .md-typeset h1,
[data-md-color-scheme="slate"] .md-typeset h2,
[data-md-color-scheme="slate"] .md-typeset h3,
[data-md-color-scheme="slate"] .md-typeset h4 {
  color: hsla(0, 0%, 100%, 0.94);
}
.md-typeset .admonition-title,
.md-typeset summary {
  font-weight: 600;
}
.md-header__topic,
.md-header__title {
  font-weight: 600;
}
/* Card titles inside grids (first <strong> line) */
.md-typeset .grid.cards strong {
  font-weight: 600;
}

/* --- semantic icon colors --------------------------------------------------- */

.md-typeset .ic-board  { color: var(--cards-board); }
.md-typeset .ic-schema { color: var(--cards-schema); }
.md-typeset .ic-agent  { color: var(--cards-agent); }
.md-typeset .ic-cli    { color: var(--cards-cli); }
.md-typeset .ic-api    { color: var(--cards-api); }
.md-typeset .ic-nav    { color: var(--md-accent-fg-color); }

/* Icons in section headings: slightly larger, aligned to the cap height. */
.md-typeset h2 .twemoji {
  vertical-align: -0.15em;
  margin-right: 0.15em;
}

/* Icons leading a grid-card title. */
.md-typeset .grid.cards .twemoji {
  vertical-align: -0.15em;
  margin-right: 0.2em;
}

/* --- header ------------------------------------------------------------------ */

/* Tighten the gap between the logo and the site name. Material defaults leave
   a full button padding + title margin; collapse both. */
.md-header__button.md-logo {
  margin-right: 0;
  padding-inline: 0.2rem;
}
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  margin-right: 0;
}

/* Show the page title as a smaller subtitle beside the site name instead of
   replacing it on scroll. */
.md-header__title {
  margin-left: 0.15rem;
  padding-left: 0;
}
.md-header__title .md-header__ellipsis {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}
.md-header__topic {
  position: static;
  transform: none !important;
  transition: opacity 0.25s;
  white-space: nowrap;
}
.md-header__topic:first-child {
  opacity: 1 !important;
}
.md-header__topic:not(:first-child) {
  font-size: 0.6rem;
  font-weight: 400;
  opacity: 0;
  color: var(--md-primary-bg-color--light);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.md-header__title--active .md-header__topic:not(:first-child) {
  opacity: 0.85;
}
@media screen and (max-width: 59.9375em) {
  .md-header__topic:not(:first-child) {
    display: none;
  }
}

/* --- components ------------------------------------------------------------- */

/* Two-column definition → rendered-page pairs on the landing page. */
.cards-duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.4rem 1rem;
  align-items: center;
  margin: 1.2rem 0;
}
.cards-duo .highlight {
  margin: 0;
}
.cards-duo pre {
  font-size: 0.58rem;
  line-height: 1.45;
}
.cards-duo figure {
  margin: 0;
}
@media screen and (max-width: 44.9375em) {
  .cards-duo {
    grid-template-columns: 1fr;
  }
}

/* Terminal block. Deliberately dark in both color schemes. */
.cards-term {
  max-width: 44rem;
  margin: 1rem 0;
  border-radius: 10px;
  border: 1px solid var(--md-default-fg-color--lightest);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
  background: #14171c;
  overflow: hidden;
}
.cards-term__bar {
  display: flex;
  gap: 0.35rem;
  padding: 0.5rem 0.8rem;
  background: #1d2127;
}
.cards-term__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
}
.cards-term__dot--r { background: #ff5f57; }
.cards-term__dot--y { background: #febc2e; }
.cards-term__dot--g { background: #28c840; }
.cards-term pre {
  margin: 0;
  padding: 0.9rem 1.1rem;
  background: transparent;
  font-family: var(--md-code-font-family);
  font-size: 0.62rem;
  line-height: 1.7;
  color: #d6dde6;
  overflow-x: auto;
}
.cards-term .tp { color: #7d8590; }   /* prompt */
.cards-term .tc { color: #e6edf3; font-weight: 600; }   /* command */
.cards-term .to { color: #7ee787; }   /* output */

/* Documentation map: h3 titles inside grid cards (so they land in the TOC). */
.md-typeset .grid.cards h3 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
}
.md-typeset .grid.cards h3 .headerlink {
  display: none;
}

/* Version / status pill used on the landing page. */
.cards-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--md-accent-fg-color);
  border: 1px solid var(--md-accent-fg-color);
  vertical-align: middle;
}

/* Framed screenshots. */
.cards-shot {
  border-radius: 8px;
  border: 1px solid var(--md-default-fg-color--lightest);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
  max-width: 100%;
}

/* Theme gallery on the landing page. */
.cards-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
  align-items: start;
}
.cards-gallery figure,
.md-typeset figure {
  margin: 0.5rem 0;
}
.md-typeset figcaption {
  font-size: 0.7rem;
  color: var(--md-default-fg-color--light);
  text-align: center;
  margin-top: 0.3rem;
}

.md-typeset .md-button {
  margin-top: 0.3rem;
}
