/* Shared styles for the long-form doc pages (guide.html, brand.html).
   Uses the Stoplight default light palette so these pages match the API reference. */
body {
  margin: 0;
  font-family: var(--font-functional);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0.15px;
  color: var(--text-primary);
  background: var(--bg-primary);
}

/* Stoplight Elements' default light palette, so the guide matches the API reference.
   Scoped to .guide so the shared nav bar keeps the theme colours. */
.guide {
  --text-primary: #262626;
  --text-secondary: rgba(38, 38, 38, 0.7);
  --brand-main: #080808;
  --link-text: #126fa5;
  --bg-secondary: #f5f7fa;
  --bg-tertiary: #ebeef5;
  --bg-invert: #121821;
  --border-divider: #d5ddeb;
  --mono: 'SF Mono', ui-monospace, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;

  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 64px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 24px 120px;
}

/* ---- On this page ---- */
.toc {
  position: sticky;
  top: 32px;
  align-self: start;
  font-size: 14px;
  line-height: 1.4;
}
.toc__title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--border-divider);
}
.toc a {
  display: block;
  padding: 8px 16px;
  margin-left: -1px;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
}
.toc a:hover {
  color: var(--brand-main);
  background: var(--bg-secondary);
}
.toc a[aria-current='true'] {
  color: var(--brand-main);
  font-weight: var(--fw-semibold);
  border-left-color: var(--brand-main);
}

/* ---- Content ---- */
main {
  min-width: 0;
  max-width: 760px;
}
h1,
h2,
h3 {
  color: var(--brand-main);
  font-weight: var(--fw-semibold);
}
h1 {
  margin: 0 0 16px;
  font-size: 36px;
  line-height: 1.2;
  letter-spacing: -0.2px;
}
.lead {
  margin: 0 0 48px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
}
h2 {
  margin: 72px 0 20px;
  padding-top: 40px;
  border-top: 1px solid var(--border-divider);
  font-size: 24px;
  line-height: 1.33;
  scroll-margin-top: 24px;
}
.lead + h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
p {
  margin: 0 0 16px;
  max-width: 68ch;
}
ul {
  margin: 0 0 16px;
  padding-left: 24px;
}
li {
  margin: 8px 0;
  padding-left: 4px;
}
a {
  color: var(--link-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- Code ---- */
code {
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: var(--mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}
pre {
  margin: 20px 0 28px;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  background: var(--bg-invert);
  color: #dbdbdb;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
}
pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  overflow-wrap: normal;
}

/* ---- Tables ---- */
.table-wrap {
  margin: 24px 0 32px;
  overflow-x: auto;
  border: 1px solid var(--border-divider);
  border-radius: var(--radius-md);
}
table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}
th,
td {
  padding: 14px 20px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-divider);
}
tr:last-child > td {
  border-bottom: 0;
}
th {
  background: var(--bg-secondary);
  font-size: 12px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}
td.nowrap code {
  white-space: nowrap;
  overflow-wrap: normal;
}
td[rowspan] {
  border-right: 1px solid var(--border-divider);
  font-weight: var(--fw-semibold);
  background: var(--bg-secondary);
}

/* ---- Callout ---- */
.note {
  display: flex;
  gap: 14px;
  margin: 24px 0 28px;
  padding: 18px 20px;
  border: 1px solid var(--border-divider);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}
.note svg {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
}
.note p {
  margin: 0;
}

/* ---- Narrow screens: contents list moves above the article ---- */
@media (max-width: 900px) {
  .guide {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    padding: 32px 16px 80px;
  }
  .toc {
    position: static;
    padding: 20px;
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
  }
  .toc ul {
    border-left: 0;
  }
  .toc a {
    padding: 8px 0;
    margin-left: 0;
    border-left: 0;
  }
  .toc a:hover {
    background: none;
  }
  h1 {
    font-size: 30px;
  }
  h2 {
    margin-top: 56px;
    padding-top: 32px;
  }
}

/* ---- Single-column pages (brand.html) ---- */
.guide--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 840px;
}

/* ---- Name usage examples ---- */
.name-examples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 32px;
}

.name-example {
  margin: 0;
  padding: 20px 24px 24px;
  border: 1px solid var(--border-divider);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.name-example figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.name-example figcaption svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.name-example__text {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
  font-weight: var(--fw-semibold);
  color: var(--brand-main);
}

/* The "don't" card is dashed and muted, so it reads as different without relying on colour */
.name-example--avoid {
  border-style: dashed;
  background: var(--bg-primary);
}

.name-example--avoid .name-example__text {
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .name-examples {
    grid-template-columns: minmax(0, 1fr);
  }
}
