/* Guides: index cards and long-form articles, built on the shared tokens. */
.masthead__nav a[aria-current="page"] { color: var(--oe-text-strong); }

.g-meta { margin-top: 18px; font-size: var(--oe-type-small); color: var(--oe-text-muted); }
.g-meta a { color: var(--oe-text-strong); }
.g-kicker { font-family: var(--oe-mono); font-size: .8125rem; letter-spacing: .02em; color: var(--oe-glow); }

/* Index */
.g-section { padding-top: var(--oe-space-9); scroll-margin-top: 24px; }
.g-section__head p { margin-top: 12px; max-width: 38em; color: var(--oe-text); }
.g-section h2, .g-related h2, .g-cta h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); }
.g-cards { margin: var(--oe-space-6) 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.g-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 26px 24px; border-radius: var(--oe-r-card); background: var(--oe-deep);
  border: 1px solid var(--oe-line); transition: border-color var(--oe-dur-fast); }
.g-card:hover, .g-card:focus-within { border-color: var(--oe-beam); }
.g-card h3 { font-size: 1.35rem; line-height: 1.2; letter-spacing: -.01em; }
.g-card h3 a { text-decoration: none; }
.g-card h3 a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.g-card p { color: var(--oe-text); font-size: .975rem; }
.g-card .g-meta { margin-top: auto; padding-top: 6px; }
main > .g-section:last-child { padding-bottom: var(--oe-section); }

/* Article header */
.g-head h1 { font-size: clamp(2.3rem, 4.6vw, 4rem); line-height: 1.02; max-width: 22ch; text-wrap: balance; }
.g-head .lead { max-width: 40em; }
.g-crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; font-size: var(--oe-type-small); color: var(--oe-text-muted); }
.g-crumbs a { color: var(--oe-text); text-decoration: none; }
.g-crumbs a:hover { color: var(--oe-text-strong); }

/* Article body */
.g-layout { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 760px); gap: clamp(32px, 5vw, 80px); align-items: start; margin-top: var(--oe-space-8); }
.g-layout > .g-body:only-child { grid-column: 2; }
.g-toc { position: sticky; top: 24px; font-size: .875rem; }
.g-toc p { font-family: var(--oe-mono); font-size: .8125rem; color: var(--oe-text-muted); }
.g-toc ol { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; border-left: 1px solid var(--oe-line); }
.g-toc a { display: block; padding-left: 14px; color: var(--oe-text); text-decoration: none; line-height: 1.35; }
.g-toc a:hover { color: var(--oe-text-strong); }

.g-body { color: var(--oe-text); font-size: 1.0625rem; line-height: 1.72; }
.g-body > * + * { margin-top: 20px; }
.g-body h2 { margin-top: 64px; font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.15; max-width: none; scroll-margin-top: 24px; }
.g-body h3 { margin-top: 40px; font-size: 1.25rem; letter-spacing: -.01em; scroll-margin-top: 24px; }
.g-body h2 + *, .g-body h3 + * { margin-top: 14px; }
.g-body > :first-child { margin-top: 0; }
.g-body strong { color: var(--oe-text-strong); font-weight: 600; }
.g-body a { color: var(--oe-text-strong); text-decoration: underline; text-decoration-color: var(--oe-line-strong); text-underline-offset: 4px; }
.g-body a:hover { text-decoration-color: var(--oe-beam); }
.g-body ul, .g-body ol { padding-left: 1.3em; }
.g-body li + li { margin-top: 8px; }
.g-body code { font-size: .9em; color: var(--oe-glow); }
.g-body :not(pre) > code { padding: 1px 5px; border-radius: 5px; background: rgba(110, 160, 255, .1); overflow-wrap: anywhere; }
.g-code { margin: 0; padding: 18px 20px; border-radius: var(--oe-r-control); background: var(--oe-panel); border: 1px solid var(--oe-line); overflow-x: auto;
  font-size: .8125rem; line-height: 1.65; color: #c9d6e6; tab-size: 4; }
.g-body pre code { padding: 0; background: none; color: inherit; font-size: inherit; }
.g-code[data-lang="text"] { background: rgba(5, 10, 18, .8); color: var(--oe-text); }
.g-math { margin: 0; padding: 16px 20px; overflow-x: auto; text-align: center; font-family: var(--oe-serif); font-size: 1.15rem; line-height: 1.6; color: var(--oe-text-strong);
  white-space: pre; border-top: 1px solid var(--oe-line); border-bottom: 1px solid var(--oe-line); }
.g-note { padding: 16px 20px; border-left: 3px solid var(--oe-beam); background: rgba(34, 99, 237, .08); border-radius: 0 var(--oe-r-control) var(--oe-r-control) 0; font-size: 1rem; }
.g-note p + p { margin-top: 10px; }
.g-table { overflow-x: auto; }
.g-table table { width: 100%; border-collapse: collapse; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.g-table th, .g-table td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--oe-line); text-align: left; vertical-align: top; line-height: 1.5; }
.g-table th { color: var(--oe-text-muted); font-weight: 500; font-size: .875rem; }
.g-table .g-right { text-align: right; }
.g-table .g-center { text-align: center; }

/* After the article */
.g-related { padding-top: var(--oe-space-9); }
.g-cta { margin-top: var(--oe-space-9); margin-bottom: var(--oe-section); padding-top: 40px; padding-bottom: 40px; border-radius: var(--oe-r-window); background: var(--oe-deep);
  border: 1px solid var(--oe-line); max-width: calc(var(--oe-max) + 2 * var(--oe-gutter) - 2 * var(--oe-gutter)); }
.g-cta p { margin-top: 12px; max-width: 40em; color: var(--oe-text); }
.g-cta__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 24px; }
.g-cta__pip { padding: 16px 18px; border-radius: var(--oe-r-control); background: rgba(5, 10, 18, .7); border: 1px solid var(--oe-line-strong); color: var(--oe-text-strong); font-size: var(--oe-type-code); }
.g-cta__pip::before { content: '$ '; color: var(--oe-ok); }

@media (max-width: 900px) {
  .g-layout { grid-template-columns: minmax(0, 1fr); margin-top: var(--oe-space-7); }
  .g-layout > .g-body:only-child { grid-column: auto; }
  .g-toc { position: static; padding: 16px 18px; border-radius: var(--oe-r-card); background: var(--oe-deep); border: 1px solid var(--oe-line); }
  .g-toc ol { border-left: 0; }
  .g-toc a { padding-left: 0; }
  .g-body h2 { margin-top: 48px; }
  .g-cta { margin-left: var(--oe-gutter); margin-right: var(--oe-gutter); width: auto; padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 600px) {
  .g-cards { grid-template-columns: minmax(0, 1fr); }
  .g-math { font-size: 1rem; text-align: left; }
}

/* Glossary and FAQ */
.g-letters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 28px; }
.g-letters a { display: inline-grid; place-items: center; min-width: 38px; min-height: 38px; border-radius: 9px; border: 1px solid var(--oe-line);
  color: var(--oe-text); text-decoration: none; font-family: var(--oe-mono); font-size: .875rem; }
.g-letters a:hover { border-color: var(--oe-beam); color: var(--oe-text-strong); }
.g-reference { max-width: calc(860px + 2 * var(--oe-gutter)); margin-left: 0; padding-bottom: var(--oe-space-6); }
.g-letter { padding-top: var(--oe-space-8); scroll-margin-top: 24px; }
.g-letter h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); color: var(--oe-glow); font-family: var(--oe-mono); font-weight: 500; }
.g-terms { margin: 12px 0 0; }
.g-terms dt { margin-top: 28px; color: var(--oe-text-strong); font-size: 1.2rem; font-weight: 600; letter-spacing: -.01em; scroll-margin-top: 24px; }
.g-terms dd { margin: 8px 0 0; color: var(--oe-text); line-height: 1.7; }
.g-terms dd p + p, .g-question p + p { margin-top: 12px; }
.g-reference a { color: var(--oe-text-strong); text-decoration: underline; text-decoration-color: var(--oe-line-strong); text-underline-offset: 4px; }
.g-reference code { font-size: .9em; color: var(--oe-glow); padding: 1px 5px; border-radius: 5px; background: rgba(110, 160, 255, .1); }
.g-faq { padding-top: var(--oe-space-7); }
.g-question { padding: 28px 0; border-top: 1px solid var(--oe-line); scroll-margin-top: 24px; }
.g-question h2 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); line-height: 1.2; max-width: none; }
.g-question p { margin-top: 12px; color: var(--oe-text); line-height: 1.7; }

/* Home page learn section */
.scene--learn .g-cards { margin-top: var(--oe-space-7); }

/* Topic pathways: useful as ordinary HTML, including with JavaScript disabled. */
.g-path-nav { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 26px; font-size: .9375rem; }
.g-path-nav a { color: var(--oe-text-strong); text-decoration: underline; text-decoration-color: var(--oe-line-strong); text-underline-offset: 4px; }
.g-path-nav a:hover { text-decoration-color: var(--oe-beam); }
.g-path-nav--end { margin-top: var(--oe-space-9); padding-top: 24px; border-top: 1px solid var(--oe-line); }
.g-path-readings { list-style: none; counter-reset: reading; margin: 28px 0 0; padding: 0; max-width: 900px; }
.g-path-readings li { counter-increment: reading; position: relative; padding: 24px 0 24px 52px; border-top: 1px solid var(--oe-line); }
.g-path-readings li::before { content: counter(reading, decimal-leading-zero); position: absolute; left: 0; top: 26px; color: var(--oe-glow); font-family: var(--oe-mono); font-size: .875rem; }
.g-path-readings h3 { font-size: 1.35rem; line-height: 1.3; }
.g-path-readings h3 a { color: var(--oe-text-strong); text-decoration: none; }
.g-path-readings h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.g-path-readings p { margin-top: 9px; color: var(--oe-text); line-height: 1.6; }
.g-topic-card .g-kicker { color: var(--oe-glow); }

/* Method pages: generated capability tables, limitations and the Learn hub's method lists */
.g-caps th[scope="row"] { min-width: 9.5em; color: var(--oe-text-muted); font-weight: 500; }
.g-caps code, .g-opts code, .g-params code, .g-lookup code { white-space: nowrap; overflow-wrap: normal; }
.g-limits li::marker { color: var(--oe-text-muted); }
.g-links { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.g-links a { color: var(--oe-text-strong); text-decoration: underline; text-decoration-color: var(--oe-line-strong); text-underline-offset: 4px; line-height: 1.35; }
.g-links a:hover { text-decoration-color: var(--oe-beam); }
.g-lookup { margin-top: var(--oe-space-6); max-width: 960px; }
.g-lookup a { color: var(--oe-text-strong); text-decoration: underline; text-decoration-color: var(--oe-line-strong); text-underline-offset: 4px; }
@media (max-width: 600px) {
  .g-caps th[scope="row"] { min-width: 6.5em; }
  .g-opts thead { display: none; }
  .g-opts tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--oe-line); }
  .g-opts td { display: block; padding: 2px 0; border: 0; }
  .g-opts td:nth-child(2)::before { content: 'Values: '; color: var(--oe-text-muted); }
  .g-opts td:nth-child(3)::before { content: 'Default: '; color: var(--oe-text-muted); }
}

/* Teaching lab pages: MathML formulas, figures, resources and lab-to-lab navigation */
.g-body .katex { font-size: 1.08em; color: var(--oe-text-strong); }
.g-display-math { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.g-display-math .katex-display { margin: 0; }
.g-figure { margin: 0; padding: 12px; border-radius: var(--oe-r-card); background: var(--oe-paper); }
.g-figure img { width: 100%; height: auto; }
.g-head .g-kicker { margin-bottom: 14px; }
.g-resources { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.g-resources .oe-btn { min-height: 46px; padding: 0 18px; font-size: .9375rem; }
.g-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: var(--oe-space-9); }
.g-pager a { display: flex; flex-direction: column; gap: 6px; padding: 20px 22px; border-radius: var(--oe-r-card); border: 1px solid var(--oe-line);
  background: var(--oe-deep); color: var(--oe-text-strong); text-decoration: none; font-weight: 600; line-height: 1.3; }
.g-pager a:last-child { text-align: right; }
.g-pager a:hover { border-color: var(--oe-beam); }
.g-pager span { font-family: var(--oe-mono); font-size: .8125rem; font-weight: 400; color: var(--oe-text-muted); }
.g-labcards { counter-reset: none; }
.lab h3 a { color: inherit; text-decoration: none; }
.lab h3 a:hover { text-decoration: underline; text-decoration-color: var(--oe-beam); text-underline-offset: 4px; }
@media (max-width: 600px) {
  .g-pager { grid-template-columns: minmax(0, 1fr); }
  .g-pager a:last-child { text-align: left; }
}
