/* Guides (MD-41): builds on /styles.css and /labs/labs.css. */

.guide-header {
  max-width: 820px;
  padding-top: 24px;
}
.guide-header .eyebrow a {
  color: inherit;
}
.guide-header h1 {
  margin: 12px 0 14px;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.guide-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  font-size: 0.85rem;
  color: #9cdfca;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  margin-top: 36px;
}
@media (min-width: 1040px) {
  .guide-layout {
    grid-template-columns: 200px minmax(0, 720px) minmax(0, 1fr);
    align-items: start;
  }
  .guide-toc,
  .guide-aside {
    position: sticky;
    top: 24px;
  }
}

.guide-toc h2,
.guide-aside h2 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8fa3bb;
}
.guide-toc ol {
  margin: 0;
  padding: 0 0 0 18px;
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  color: #8fa3bb;
}
.guide-toc a {
  color: #c4d2e2;
}
.guide-toc a:hover,
.guide-toc a:focus-visible {
  color: var(--mint);
}
@media (max-width: 1039px) {
  .guide-toc {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
  }
}

/* The article text. */
.guide-body {
  min-width: 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #d6e0ec;
}
.guide-body > :first-child {
  margin-top: 0;
}
.guide-body h2 {
  margin: 2.2em 0 0.6em;
  font-size: 1.5rem;
  line-height: 1.25;
  color: #f3f5fa;
  scroll-margin-top: 24px;
}
.guide-body h3 {
  margin: 1.8em 0 0.5em;
  font-size: 1.15rem;
  color: #f3f5fa;
}
.guide-body p,
.guide-body ul,
.guide-body ol {
  margin: 0 0 1em;
}
.guide-body li + li {
  margin-top: 0.4em;
}
.guide-body strong {
  color: #f3f5fa;
}
.guide-body a {
  color: var(--mint);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.guide-body code {
  font-family:
    "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: #15243b;
  color: #e6f2f8;
  overflow-wrap: anywhere;
}
.guide-code {
  margin: 0 0 1.2em;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b1526;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.6;
}
.guide-code code {
  padding: 0;
  background: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Tables: a grid on wide screens, cards on phones. */
.guide-table {
  margin: 0 0 1.4em;
  overflow-x: auto;
}
.guide-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  line-height: 1.5;
}
.guide-table th,
.guide-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.guide-table th {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8fa3bb;
}
@media (max-width: 640px) {
  .guide-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .guide-table tr {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  /* Block, not grid: a grid would put each text run and <code> on its own row. */
  .guide-table td {
    display: block;
    padding: 0;
    border: 0;
  }
  .guide-table td::before {
    display: block;
    margin-bottom: 2px;
    content: attr(data-label);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8fa3bb;
  }
}

.guides-main .labs-note a {
  color: var(--mint);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Sidebar: the tool, sources and related guides. */
.guide-aside {
  display: grid;
  gap: 28px;
}
.guide-tool {
  padding: 20px;
  border: 1px solid #2c5a52;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f2a2a, #0b1526 75%);
}
.guide-tool p {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: #c4d2e2;
}
.guide-sources ul,
.guide-related ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
}
.guide-sources a,
.guide-related a {
  color: #c4d2e2;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.guide-related a {
  color: var(--mint);
}
