/* =====================================================================
   Graph examples library: /tools/graph/examples/ and its topic pages.
   Uses the tokens and components of main.css (.wrap, .card, .chip, .btn).
   The graphs themselves are styled by /tools/graph/css/embed.css.
   ===================================================================== */
.gx, .gx-home { max-width: 860px; }
.gx-home { max-width: var(--maxw); }
.gx-page h1 { font-size: clamp(28px, 6vw, 42px); font-weight: 800; margin-top: 8px; }
.gx-intro { margin-top: 12px; font-size: 17px; color: var(--body); max-width: 40em; }
.gx-how { margin-top: 10px; font-size: 14px; color: var(--muted); }
.gx-how b { color: var(--navy); }

/* contents of a topic page */
.gx-toc { margin-top: 22px; padding: 14px 18px; background: var(--white); border: var(--line); border-radius: var(--r-md); }
.gx-toc ol { margin: 0; padding-left: 22px; columns: 2 260px; column-gap: 28px; font-size: 14.5px; font-weight: 700; }
.gx-toc li { break-inside: avoid; padding: 3px 0; }
.gx-toc a { text-decoration: none; }
.gx-toc a:hover { text-decoration: underline; }

/* one example */
.gx-ex { margin-top: 34px; scroll-margin-top: 80px; }
.gx-ex h2 { display: flex; align-items: center; gap: 10px; font-size: clamp(19px, 3.6vw, 23px); font-weight: 800; }
.gx-num { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--blue2); color: var(--white); font-size: 14px; letter-spacing: 0; }
.gx-ex > p { margin-top: 8px; color: var(--body); }
.gx-graph { margin-top: 12px; border-radius: 14px; background: var(--white); }
.gx-eqs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; }
.gx-eqs span { font-weight: 800; color: var(--muted); }
.gx-eqs code { padding: 3px 9px; background: var(--white); border: 1.5px solid var(--wash); border-radius: 8px; font: 600 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--navy); }

/* next / previous topic and the plotter link */
.gx-pager { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 44px; }
.gx-pager .btn { flex: 1 1 200px; text-align: center; white-space: normal; line-height: 1.25; padding-block: 8px; }
.gx-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; padding: 18px 20px; }
.gx-cta b { font-family: var(--display); font-size: 18px; color: var(--navy); }
.gx-cta p { margin-top: 2px; font-size: 14px; color: var(--body); }

/* home: jump links and topic cards */
.gx-jump { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.gx-jump .chip { text-decoration: none; min-height: 40px; font-size: 14px; }
.gx-jump .chip:hover { border-color: var(--blue2); color: var(--blue); }
.gx-jump .btn { margin-left: auto; }
.gx-level { margin-top: 40px; font-size: clamp(22px, 4.4vw, 28px); font-weight: 800; scroll-margin-top: 80px; }
.gx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.gx-card { display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 14px; text-decoration: none; color: var(--ink); transition: border-color .15s ease, transform .15s ease; }
.gx-card:hover { border-color: var(--blue2); transform: translateY(-2px); color: var(--ink); }
.gx-card .lam-graph, .gx-thumb { pointer-events: none; border-radius: 12px; }
.gx-card b { margin: 6px 4px 0; font-family: var(--display); font-size: 17px; font-weight: 800; color: var(--navy); line-height: 1.25; }
.gx-card small { margin: 0 4px; font-size: 13.5px; font-weight: 600; color: var(--body); line-height: 1.45; }
.gx-count { margin: auto 4px 0; padding-top: 4px; font-size: 13px; font-weight: 800; color: var(--blue2); }

@media (max-width: 600px) {
  .gx-jump .btn { margin-left: 0; width: 100%; }
}
@media print {
  .gx-toc, .gx-pager, .gx-cta, .gx-how { display: none; }
  .gx-ex { break-inside: avoid; }
}
