/*
 * GraphQL-Markdown demo styles (shared visual system), scoped to main.content.
 * Colours come from the theme variables in theme.css (light/dark aware).
 */
main.content {
  --gqlmd-chip-bg: var(--soft);
  --gqlmd-chip-border: var(--border);
  --gqlmd-code-bg: var(--code-bg);
  --gqlmd-radius: 0.5rem;
}

main.content > h1:first-of-type {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0.25rem 0 1.25rem;
  overflow-wrap: anywhere;
}
main.content h2,
main.content h3 { font-weight: 600; letter-spacing: -0.01em; }
main.content h2 { margin: 2rem 0 0.75rem; }
main.content h3 {
  font-size: 1.4rem;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

main.content h4:has(.gqlmd-mdx-entity) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  margin: 1.1rem 0 0.3rem;
}
main.content h4:has(.gqlmd-mdx-entity) + p { margin-top: 0.25rem; color: var(--muted); }

main.content .gqlmd-mdx-entity {
  display: inline-flex;
  align-items: baseline;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--gqlmd-chip-border);
  border-radius: 0.375rem;
  background: var(--gqlmd-chip-bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875rem;
  color: var(--fg);
  overflow-wrap: anywhere;
}
main.content .gqlmd-mdx-entity code { padding: 0; background: none; font-size: inherit; color: inherit; }
main.content .gqlmd-mdx-entity .gqlmd-mdx-entity-parent { color: var(--muted); }
main.content .gqlmd-mdx-entity .gqlmd-mdx-entity-name { font-weight: 600; }
main.content a:has(> .gqlmd-mdx-entity) { text-decoration: none; }
main.content a:not(.gqlmd-permalink, [href="#"]) > .gqlmd-mdx-entity .gqlmd-mdx-entity-name { color: var(--accent); }
main.content a:has(> .gqlmd-mdx-entity):hover .gqlmd-mdx-entity { border-color: var(--accent); }

main.content .gqlmd-mdx-bullet {
  display: inline-block;
  font-size: 0.4rem;
  line-height: 1;
  color: var(--muted);
  margin: 0 0.15rem;
  vertical-align: middle;
}

/* badges as translucent pills */
main.content .gqlmd-badge {
  --b: var(--muted);
  display: inline-block;
  padding: 0.2em 0.65em;
  border: 1px solid color-mix(in srgb, var(--b) 40%, transparent);
  border-radius: 50rem;
  background: color-mix(in srgb, var(--b) 14%, transparent);
  color: var(--b);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  vertical-align: middle;
  white-space: nowrap;
}
main.content .gqlmd-badge[data-kind="non-null"] { --b: var(--accent); }
main.content .gqlmd-badge[data-kind="deprecated"] { --b: var(--warn); }
main.content .gqlmd-badge[data-kind="query"],
main.content .gqlmd-badge[data-kind="mutation"],
main.content .gqlmd-badge[data-kind="subscription"] { --b: #16a34a; }

main.content p:has(> .gqlmd-mdx-bullet, > .gqlmd-badge) { line-height: 2.1; }
main.content p > .gqlmd-mdx-bullet { margin: 0 0.45rem; }

main.content p > a > code,
main.content li > a > code {
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--gqlmd-chip-border);
  border-radius: 0.375rem;
  background: var(--gqlmd-chip-bg);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}
main.content p > a:has(> code),
main.content li > a:has(> code) { text-decoration: none; }
main.content p > a:has(> code):hover > code,
main.content li > a:has(> code):hover > code { border-color: var(--accent); }
main.content p > a:has(> code) + .gqlmd-badge { margin-left: 0.15rem; }

main.content a { text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

main.content :not(pre) > code {
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
  background: var(--gqlmd-code-bg);
  color: var(--fg);
  font-size: 0.875em;
}
main.content pre {
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--gqlmd-radius);
  background: var(--gqlmd-code-bg);
  font-size: 0.875rem;
  line-height: 1.6;
}
main.content pre > code { padding: 0; background: transparent; }

/* alerts: deprecation notice (blockquote) */
main.content blockquote {
  margin: 1rem 0 1.5rem;
  padding: 0.9rem 1.1rem;
  border: 0;
  border-left: 4px solid var(--warn);
  border-radius: var(--gqlmd-radius);
  background: var(--warn-bg);
  color: var(--warn-fg);
}
main.content blockquote p { margin: 0.3rem 0; }
main.content blockquote p:first-child { margin-top: 0; }
main.content blockquote p:last-child { margin-bottom: 0; }
main.content blockquote code { background: rgba(0,0,0,.08); color: inherit; }

@media (max-width: 767.98px) {
  main.content > h1:first-of-type { font-size: 1.75rem; }
  main.content h3 { font-size: 1.25rem; margin-top: 2rem; }
  main.content pre { font-size: 0.8rem; }
}

/* ── Landing page ─────────────────────────────────────────────────────── */
main.content.landing { max-width: 72rem; }
.gqlmd-landing { --gqlmd-shadow: var(--shadow); }
.gqlmd-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3.5rem;
  align-items: center;
  padding: 3rem 0 4rem;
}
.gqlmd-eyebrow { margin: 0 0 1.5rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.875rem; color: var(--accent); }
.gqlmd-landing h1.gqlmd-hero-title {
  max-width: 36rem;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.75rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: normal;
}
.gqlmd-hero-text { max-width: 32rem; margin: 1.75rem 0 0; font-size: 1.125rem; line-height: 2rem; }
.gqlmd-hero-links { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }
.gqlmd-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-weight: 500;
  text-decoration: none;
}
.gqlmd-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.gqlmd-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.gqlmd-btn-outline { color: var(--fg); }
.gqlmd-btn-outline:hover { background: var(--soft); color: var(--fg); }
.gqlmd-hero-intro { margin: 1.5rem 0 0; color: var(--muted); }
.gqlmd-preview {
  overflow: hidden;
  background: #1f1f1f;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 20px 20px 0 var(--gqlmd-shadow);
}
.gqlmd-preview-bar { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid rgb(63 63 70 / 0.8); }
.gqlmd-preview-file { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.875rem; color: #a1a1aa; }
.gqlmd-preview-chip { padding: 0.25rem 0.5rem; border-radius: 0.25rem; background: rgb(76 184 238 / 0.12); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; color: #4cb8ee; }
main.content .gqlmd-preview pre { margin: 0; padding: 1.5rem; overflow-x: auto; background: transparent; border: 0; font-size: 0.875rem; line-height: 1.75; color: #e4e4e7; }
main.content .gqlmd-preview pre > code { display: block; padding: 0; background: transparent; color: inherit; white-space: pre; }
.gqlmd-preview .token-keyword { color: #d8b4fe; }
.gqlmd-preview .token-type { color: #93c5fd; }
.gqlmd-preview .token-field { color: #f0abfc; }
.gqlmd-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.gqlmd-highlights p { margin: 0; }
.gqlmd-highlights .gqlmd-eyebrow-sm { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; color: var(--accent); }
.gqlmd-highlights div > p:last-child { margin-top: 0.75rem; font-size: 1.125rem; }
@media (max-width: 768px) {
  .gqlmd-hero { grid-template-columns: 1fr; gap: 2.5rem; padding: 1.5rem 0 3rem; }
  .gqlmd-landing h1.gqlmd-hero-title { font-size: 2.5rem; }
  .gqlmd-preview { box-shadow: 10px 10px 0 var(--gqlmd-shadow); }
  .gqlmd-highlights { grid-template-columns: 1fr; gap: 1.5rem; }
}
