/* Resources: the guide index and the guide pages. Tokens come from site.css only. */

.guide-head .slab__face { gap: 18px; }
.guide-head .h1 { max-width: 24ch; font-size: clamp(2rem, 1.2rem + 3.4vw, 3.75rem); }
.guide-head .lede { max-width: 60ch; }
.guide__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; font-size: 0.9375rem; color: var(--text-secondary); }
.guide__meta strong { color: var(--text-primary); font-weight: 600; }
.guide__meta a { color: var(--text-primary); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.guide-layout { display: grid; gap: 36px; }
@media (min-width: 960px) {
  .guide-layout { grid-template-columns: 220px minmax(0, 720px); gap: 72px; justify-content: start; align-items: start; }
}

.guide-toc { font-size: 0.9375rem; }
@media (min-width: 960px) { .guide-toc { position: sticky; top: 112px; } }
.guide-toc__title { margin: 0 0 14px; font-family: var(--font-display); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.guide-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.guide-toc a { color: var(--text-secondary); text-decoration: none; }
.guide-toc a:hover { color: var(--text-primary); text-decoration: underline; text-underline-offset: 4px; }

.guide { color: var(--text-secondary); font-size: 1.0625rem; line-height: 1.65; }
.guide > * + * { margin-top: 18px; }
.guide p { max-width: 68ch; text-wrap: pretty; margin-bottom: 0; }
.guide strong { color: var(--text-primary); font-weight: 600; }
.guide a { color: var(--text-primary); text-decoration: underline; text-decoration-thickness: 1.5px; text-decoration-color: var(--border-strong); text-underline-offset: 4px; }
.guide a:hover { text-decoration-color: currentColor; }
.guide h2 { margin: 56px 0 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2rem); line-height: 1.12; letter-spacing: -0.01em; color: var(--text-primary); scroll-margin-top: 110px; text-wrap: balance; }
.guide h3 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.1875rem; line-height: 1.25; color: var(--text-primary); }
.guide ul:not(.steps) { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; max-width: 68ch; }
.guide li::marker { color: var(--border-strong); }

.answer { padding: 22px 24px; border: 1px solid var(--border-subtle); border-radius: var(--r-tile); background: var(--surface-well); }
.answer h2 { margin: 0 0 8px; font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.answer p { color: var(--text-primary); font-size: 1.125rem; line-height: 1.55; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 30px; counter-reset: step; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 18px; row-gap: 8px; scroll-margin-top: 110px; }
.steps > li::before { content: counter(step); grid-row: 1 / span 4; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-tile); background: var(--brand-solid); color: var(--text-on-brand); font-family: var(--font-display); font-weight: 700; font-size: 1.125rem; }
.steps > li > * { grid-column: 2; margin: 0; }
.steps > li > h3 { padding-top: 8px; }

.guide-note { padding: 22px 24px; border: 1px solid var(--border-subtle); border-radius: var(--r-tile); background: var(--surface-card); }
.guide-note h2 { margin: 0 0 8px; font-size: 1.25rem; }

.guide .faq { margin-top: 8px; }
.guide .faq details p { font-size: 1rem; }

.sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sources a { word-break: break-word; }

.related { display: grid; gap: 14px; padding-top: 8px; }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.guide__updated { font-size: 0.9375rem; color: var(--text-secondary); }

/* Index */
.guide-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
@media (min-width: 840px) { .guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.guide-card { display: grid; align-content: start; gap: 14px; height: 100%; padding: 26px; border: 1px solid var(--border-subtle); border-radius: var(--r-tile); background: var(--surface-card); box-shadow: var(--shadow-tile); }
.guide-card h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.375rem; line-height: 1.18; color: var(--text-primary); }
.guide-card h2 a { text-decoration: none; }
.guide-card h2 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.guide-card p { margin: 0; color: var(--text-secondary); }
.guide-card__meta { font-size: 0.875rem; color: var(--text-secondary); }
.guide-card .link { margin-top: 4px; }
.resources__note { margin-top: 40px; }

/* Posts: numbered source notes, and tables that stack into cards on phones */
.guide a.cite { display: inline-block; margin-left: 1px; padding: 0 2px; font-size: 0.72em; font-weight: 700; line-height: 1; vertical-align: super; text-decoration: none; color: var(--text-secondary); }
.guide a.cite::after { content: attr(data-n); }
.guide a.cite + a.cite { margin-left: 0; padding-left: 0; }
.guide a.cite + a.cite::before { content: ","; }
.guide a.cite:hover { color: var(--text-primary); text-decoration: underline; }
.sources--num { counter-reset: src; }
.sources--num li { counter-increment: src; position: relative; padding-left: 36px; scroll-margin-top: 110px; }
.sources--num li::before { content: counter(src); position: absolute; left: 0; top: 0; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--chip-surface); color: var(--chip-text); font-family: var(--font-display); font-size: 0.875rem; font-weight: 700; }
.sources--num li:target { background: var(--surface-well); border-radius: 8px; }

.gtable { max-width: 100%; overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: var(--r-tile); background: var(--surface-card); }
.gtable table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.45; color: var(--text-strong); }
.gtable th, .gtable td { padding: 12px 14px; text-align: left; vertical-align: top; border-top: 1px solid var(--border-subtle); overflow-wrap: break-word; }
.gtable thead th { border-top: 0; background: var(--surface-well); color: var(--text-primary); font-family: var(--font-display); font-weight: 700; font-size: 0.8125rem; }
.gtable thead th:first-child, .gtable tbody th { min-width: 7.5rem; }
.gtable tbody th { color: var(--text-primary); font-weight: 700; }
@media (max-width: 719px) {
  .gtable { overflow: visible; border: 0; background: transparent; }
  .gtable table, .gtable tbody { display: block; }
  .gtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .gtable tr { display: block; margin-bottom: 14px; padding: 4px 0; border: 1px solid var(--border-subtle); border-radius: var(--r-tile); background: var(--surface-card); }
  .gtable th, .gtable td { display: block; padding: 8px 16px; border-top: 0; }
  .gtable tbody th { padding-top: 12px; font-size: 1rem; }
  .gtable td::before { content: attr(data-label); display: block; margin-bottom: 2px; font-family: var(--font-display); font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); }
}
