/* Glossary: /glossary/ and /glossary/<slug>/ (scripts/render-glossary-pages.mjs, site/glossary/*).
   Layout classes come from tools.css (including the .tool-breadcrumb reset: styles.css turns every nav into the
   phone menu panel); this file adds the reading column, lists, code examples and the hub's two groups. */
.glossary-page .gl-section { max-width: 820px; margin-top: 44px; }
.glossary-page .gl-lead { margin: 12px 0 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.glossary-page .gl-note { margin: 14px 0 0; color: #85858d; font-size: 14px; line-height: 1.6; }
.glossary-page .gl-list { display: grid; gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; }
.glossary-page .gl-list li { position: relative; padding-left: 20px; color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.glossary-page .gl-list li::before { content: ""; position: absolute; top: 10px; left: 2px; width: 6px; height: 6px; border-radius: 50%; background: #5c5c64; }
.glossary-page .gl-list strong { color: var(--ink); font-weight: 500; }
.glossary-page ol.gl-list { counter-reset: gl-step; }
.glossary-page ol.gl-list li { padding-left: 38px; counter-increment: gl-step; }
.glossary-page ol.gl-list li::before { content: counter(gl-step); top: 1px; left: 0; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #1f1f22; color: #d6d5cf; font-size: 12.5px; font-weight: 500; }
.glossary-page .gl-code { min-height: 0; max-width: 100%; margin: 18px 0 0; padding: 18px 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #0f0f10; color: #d6d5cf; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; }
.glossary-page .gl-code code { padding: 0; background: none; font-size: inherit; }
.glossary-page .gl-links { display: grid; margin: 18px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.glossary-page .gl-links li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.glossary-page .gl-links a { flex: none; color: var(--ink); font-size: 15px; font-weight: 500; text-decoration: underline; text-decoration-color: #ffffff40; text-underline-offset: 3px; }
.glossary-page .gl-links span { flex: 1 1 260px; min-width: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.glossary-page .gl-section p a, .glossary-page .gl-list a { color: var(--ink); text-decoration: underline; text-decoration-color: #ffffff40; text-underline-offset: 3px; }
.glossary-page .gl-group { margin-top: 56px; }
.glossary-page .gl-group h2 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -.025em; }
.glossary-page .gl-group .gl-lead { max-width: 720px; }
.glossary-page .gl-group .tool-grid { margin-top: 22px; }
.glossary-page .tool-card { overflow-wrap: anywhere; }
.glossary-page .gl-section p, .glossary-page .gl-list li { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .glossary-page .gl-section { margin-top: 36px; }
  .glossary-page .gl-code { padding: 14px 16px; font-size: 12.5px; }
}

/* Quiet, centred reading layout: an entry is one column in the middle of the page, grids never leave a lone card. */
.glossary-page main.tool-main:not(.tools-hub) { max-width: 880px; margin-inline: auto; }
.glossary-page .tool-more .tool-grid:has(> li:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.glossary-page .tool-card { background: #171717; }
.glossary-page .tool-card:hover, .glossary-page .tool-card:focus-within { background: #1c1c1c; border-color: #3a3a3a; }
.glossary-page .tool-card-open { color: var(--muted); text-decoration: underline; text-decoration-color: #4a4a4a; text-underline-offset: 4px; }
.glossary-page .tool-cta { background: #171717; }
.glossary-page .gl-links a, .glossary-page .gl-section p a, .glossary-page .gl-list a { text-decoration-color: #6b6b6b; }
.glossary-page ol.gl-list li::before { background: #1f1f1f; }
@media (max-width: 760px) {
  .glossary-page .tool-more .tool-grid:has(> li:nth-child(3):last-child) { grid-template-columns: minmax(0, 1fr); }
}
/* A group of 4, 10 or 16 entries would leave one card alone in a row of three. */
.glossary-page .gl-group .tool-grid:has(> li:nth-child(even):last-child):has(> li:nth-child(3n+1):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) {
  .glossary-page .gl-group .tool-grid:has(> li:nth-child(even):last-child):has(> li:nth-child(3n+1):last-child) { grid-template-columns: minmax(0, 1fr); }
}
