/* The guides (/guides, /ar-guides): pages/guides/, built by scripts/build.mjs. On top of site.css; sizes, corners and
   colours come from tokens.css (tests/design-test.mjs). */
main { padding: var(--space-8) 0 var(--space-16); }
.g-crumbs { font-size: var(--text-sm); color: var(--muted); margin-bottom: var(--space-4); }
.g-crumbs a { color: var(--muted); text-decoration: none; }
.g-crumbs a:hover { color: var(--accent); text-decoration: underline; }
.g-meta { font-size: var(--text-sm); color: var(--muted); margin: var(--space-3) 0 0; }

.g-body { min-width: 0; }
.g-body h2 { font-size: var(--text-2xl); margin: var(--space-12) 0 var(--space-3); scroll-margin-top: var(--space-6); }
.g-body h2:first-child { margin-top: 0; }
.g-body h3 { font-size: var(--text-lg); }
.g-body p, .g-body li { line-height: 1.7; }
.g-body code { font-family: var(--font-mono); font-size: 0.92em; background: var(--surface-2); padding: 1px 5px; border-radius: var(--radius-sm); overflow-wrap: anywhere; }
[dir="rtl"] .g-body ul, [dir="rtl"] .g-body ol { padding-left: 0; padding-right: 1.3em; }

/* Numbered steps, each in its own box. */
.g-steps { list-style: none; counter-reset: step; padding: 0 !important; display: grid; gap: var(--space-3); margin: var(--space-4) 0; }
.g-steps > li { counter-increment: step; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3) var(--space-4); padding-inline-start: 52px; margin: 0; }
.g-steps > li::before { content: counter(step); position: absolute; inset-inline-start: var(--space-4); top: var(--space-3); width: 24px; height: 24px; border-radius: var(--radius-full); background: var(--accent); color: var(--accent-ink); font-size: var(--text-sm); font-weight: 600; display: grid; place-items: center; line-height: 1; }

/* A short note beside the steps. */
.g-note { background: var(--accent-soft); border-inline-start: 3px solid var(--accent); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); margin: var(--space-4) 0; }
.g-note > :last-child { margin-bottom: 0; }
.g-warn { background: var(--guess-soft); border-inline-start-color: var(--guess); }

/* Tables scroll inside their own box on narrow screens, never the page. */
.g-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: var(--space-4) 0; }
.g-table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.g-table th, .g-table td { padding: var(--space-2) var(--space-3); text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; }
.g-table tr:last-child > * { border-bottom: 0; }
.g-table thead th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }

.g-body figure { margin: var(--space-6) 0; }
.g-body figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); background: var(--surface); }
.g-body figcaption { font-size: var(--text-sm); color: var(--muted); margin-top: var(--space-2); }

.g-body .faq-list { margin-top: var(--space-3); }
.g-body .faq-list details > :not(summary) { margin: 0; padding: 0 var(--space-4) var(--space-4); }

.g-aside h2 { font-size: var(--text-lg); }
.g-btns { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Guide cards: the list page and "More guides". */
.g-cards { list-style: none; padding: 0; margin: var(--space-4) 0 0; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.g-cards a { display: flex; flex-direction: column; height: 100%; box-sizing: border-box; padding: var(--space-6); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); color: inherit; text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color var(--speed-fast), box-shadow var(--speed-fast); }
.g-cards a:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.g-cards h2, .g-cards h3 { font-size: var(--text-lg); margin: 0 0 var(--space-2); }
.g-cards p { color: var(--muted); margin: 0 0 var(--space-4); flex: 1; }
.g-read { color: var(--accent); font-weight: 600; font-size: var(--text-base); }
.g-related { margin-top: var(--space-16); }
.g-related h2 { font-size: var(--text-2xl); }
