/* The guides. Builds on /style.css and /tools/assets/tools.css: same tokens, type, app module and tool cards. */

@media (max-width: 400px) {
  .top nav a[href='/tools'] { display: none; }
}

/* Article */
.post { max-width: 760px; margin: 0 auto; }
.post-head { padding: 20px 0 8px; }
.post-head h1 { font-size: clamp(32px, 6vw, 48px); margin-bottom: 14px; text-wrap: balance; }
.post-head .lead { font-size: 20px; color: var(--muted-strong); margin: 0 0 14px; text-wrap: pretty; }
.post-meta { font-size: 14px; color: var(--muted); margin: 0; }
.cover { margin: 24px 0 8px; }
.cover img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 20px; background: var(--accent-soft); }

.prose { font-size: 18px; line-height: 1.7; }
.prose h2 { font-size: clamp(24px, 4vw, 30px); margin: 52px 0 14px; scroll-margin-top: 16px; text-wrap: balance; }
.prose h3 { font-size: 20px; margin: 32px 0 8px; scroll-margin-top: 16px; }
.prose p, .prose ul, .prose ol { margin: 0 0 18px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 8px; padding-left: 2px; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 650; }
.prose blockquote { margin: 24px 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); color: var(--muted-strong); font-size: 19px; }
.prose blockquote p:last-child { margin-bottom: 0; }

/* The answer first, for readers and for anything summarising the page */
.short { background: var(--surface); border: 1px solid var(--hairline); border-left: 4px solid var(--accent); border-radius: 14px; padding: 18px 22px 4px; margin: 28px 0 24px; }
.short-label { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px !important; }
.short p { font-size: 18px; }

.note { background: var(--accent-soft); border-radius: 14px; padding: 16px 20px 2px; margin: 24px 0; font-size: 17px; }
.note p { margin-bottom: 14px; }

/* Contents */
.toc { border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 16px 0 10px; margin: 0 0 8px; }
.toc-title { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px !important; }
.toc ol { columns: 2; column-gap: 32px; margin: 0; padding-left: 1.2em; font-size: 16px; line-height: 1.5; }
.toc li { break-inside: avoid; margin-bottom: 6px; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 640px) { .toc ol { columns: 1; } }

/* Formulas and other text typed as written */
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; padding: 1px 5px; border-radius: 6px; background: var(--surface); overflow-wrap: anywhere; }

/* Tables */
.prose .table-wrap { margin: 20px 0 24px; }
.prose table.data { font-size: 16px; line-height: 1.5; }
.prose table.data tbody th { font-weight: 600; font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--text); text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.prose table.data td { vertical-align: top; overflow-wrap: normal; }
/* Wide tables scroll sideways on a phone rather than breaking words */
.prose table.cols-4 { min-width: 520px; }
.prose table.cols-5, .prose table.cols-6, .prose table.cols-7 { min-width: 680px; }
.prose table.cols-6 th:first-child, .prose table.cols-7 th:first-child { position: sticky; left: 0; background: var(--bg); }

/* A real app screen, in a phone edge */
.screen { margin: 32px auto; max-width: 320px; text-align: center; }
.screen img { width: 100%; border-radius: 36px; border: 8px solid #1c1c1f; box-shadow: 0 12px 32px rgba(24, 24, 27, 0.14); background: var(--surface); }
.screen figcaption { font-size: 15px; color: var(--muted); margin-top: 12px; line-height: 1.45; }

/* Inline tool card */
.tool-inline { margin: 28px 0; border-left: 4px solid var(--accent); }
.tool-inline strong { font-family: 'Outfit', -apple-system, sans-serif; font-size: 21px; font-weight: 600; display: block; margin: 2px 0 6px; }
.tool-kicker { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.tool-body { color: var(--muted); font-size: 16px; display: block; margin-bottom: 12px; }

/* The app module inside an article: a heading that stays out of the outline */
.prose .app-cta, .post-end .app-cta { margin: 36px 0; }
.app-cta-title { font-family: 'Outfit', -apple-system, sans-serif; font-weight: 600; font-size: clamp(22px, 3.2vw, 28px); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 6px !important; text-wrap: balance; }
.prose .app-cta-body { font-size: 17px; line-height: 1.6; }
.prose .app-cta .pill { color: var(--on-accent); text-decoration: none; }

/* Bar list: one series, one hue, the values written out */
.barlist { margin: 28px 0; background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; padding: 18px 20px 12px; }
.barlist figcaption { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; font-size: 16px; }
.barlist figcaption span { font-size: 14px; color: var(--muted); }
.barlist table { width: 100%; border-collapse: collapse; font-size: 15px; }
.barlist thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.barlist th { text-align: left; font-weight: 500; padding: 5px 12px 5px 0; white-space: nowrap; width: 1%; color: var(--text); }
.barlist td { padding: 5px 0; display: flex; align-items: center; gap: 10px; }
.barlist .bar { display: block; flex: 1 1 0; width: 100%; height: 12px; min-width: 0; }
.barlist .bar rect { fill: var(--accent); }
.barlist .v { flex: none; width: 4.6em; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted-strong); font-weight: 600; white-space: nowrap; }
@media (max-width: 560px) {
  .barlist table, .barlist tbody { display: block; }
  .barlist tr { display: grid; grid-template-columns: 1fr; padding: 4px 0; }
  .barlist th { padding: 0; width: auto; white-space: normal; }
  .barlist td { padding: 2px 0 6px; }
}

/* Sources and questions */
.sources { margin-top: 48px; font-size: 15px; color: var(--muted); }
.sources h2 { font-size: 18px; margin: 0 0 10px; }
.sources ul { padding-left: 1.2em; }
.sources li { margin-bottom: 6px; }
.qa { border-top: 1px solid var(--hairline); padding-top: 4px; }
.qa h3 { margin-top: 18px; }

/* After the article */
.post-end { margin-top: 56px; }
.related-title { font-size: 24px; margin: 48px 0 16px; }

/* Cards */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin: 20px 0 8px; }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--hairline); border-radius: 18px; overflow: hidden; text-decoration: none; color: var(--text); transition: border-color 0.15s, transform 0.15s; }
.post-card:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.post-card img { width: 100%; aspect-ratio: 800 / 420; object-fit: cover; background: var(--accent-soft); }
.post-card-text { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; flex: 1; }
.post-card strong { font-family: 'Outfit', -apple-system, sans-serif; font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.post-card-body { color: var(--muted); font-size: 15px; line-height: 1.5; }
.post-card-meta { color: var(--muted); font-size: 13px; margin-top: auto; padding-top: 6px; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.post-feature { margin: 28px 0 0; }
.post-card-wide { display: grid; grid-template-columns: 1.25fr 1fr; }
.post-card-wide img { height: 100%; aspect-ratio: auto; min-height: 260px; }
.post-card-wide .post-card-text { justify-content: center; padding: 28px; }
.post-card-wide strong { font-size: clamp(24px, 3vw, 32px); }
.post-card-wide .post-card-body { font-size: 17px; }
@media (max-width: 760px) {
  .post-card-wide { grid-template-columns: 1fr; }
  .post-card-wide img { aspect-ratio: 800 / 420; min-height: 0; }
  .post-card-wide .post-card-text { padding: 16px 18px 18px; }
}

@media (max-width: 520px) {
  .prose { font-size: 17px; }
  .post-head .lead { font-size: 18px; }
  .cover img { border-radius: 14px; }
}

@media print {
  .toc, .app-cta, .post-end, .tool-inline, header.top nav, footer { display: none !important; }
  .prose { font-size: 11pt; }
}
