/* HandCalc — long-form pages: guides, the about page, section introductions (site pages, inside .legal)
   and the "About this calculation" block under the free calculators (tool pages, .hc-explain). */

/* ---- site pages (.legal articles) ---- */
.legal.guide { max-width: 820px; }
.legal h3 { font-family: var(--font-serif); font-size: 17px; font-weight: 600; margin: 22px 0 6px; color: var(--ink); }
.legal ol { margin: 8px 0 0 22px; }
.legal ol li + li { margin-top: 4px; }
.legal ul + p, .legal ol + p, .legal table + p { margin-top: 10px; }
.legal .eqn { font-family: var(--font-math); font-size: 16px; color: var(--ink); background: var(--surface-alt); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 14px; margin: 12px 0; overflow-x: auto; direction: ltr; text-align: left; }
.legal .eqn + .eqn { margin-top: -4px; }
.legal i.m, .hc-explain i.m { font-family: var(--font-math); }
.legal .guide-meta { font-size: 12.5px; color: var(--ink-3); margin-bottom: 18px; }
.legal .key-points { background: var(--surface-alt); border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 12px 16px; margin: 14px 0 6px; }
.legal .key-points h2 { margin-top: 0; font-size: 17px; }
.legal .related { border-top: 1px solid var(--line); margin-top: 30px; padding-top: 18px; }
.legal .related h2 { font-size: 17px; margin-top: 0; }
.legal td.num, .legal th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.guide-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; max-width: 980px; margin: 0 auto; }
.guide-card { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none; transition: border-color 150ms, transform 150ms; }
.guide-card:hover, .guide-card:focus-visible { border-color: var(--line-2); transform: translateY(-2px); }
.guide-card h2 { font-family: var(--font-serif); font-size: 18px; font-weight: 600; line-height: 1.3; }
.guide-card p { font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.guide-card .guide-tag { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }

.section-intro { padding: 8px 0 44px; }
.section-intro .legal { max-width: 900px; }

/* ---- tool pages: "About this calculation" under the cards ---- */
.hc-explain { max-width: 860px; margin: 28px auto 8px; padding: 26px 30px; background: #fff; border: 1px solid var(--line, #cfd9e8);
  border-radius: 12px; color: var(--ink, #0c1e3e); font-family: var(--font-ui, system-ui, sans-serif); line-height: 1.65; }
.hc-explain h2 { font-family: var(--font-serif, Georgia, serif); font-size: 21px; font-weight: 600; margin: 0 0 8px; }
.hc-explain h3 { font-family: var(--font-serif, Georgia, serif); font-size: 16.5px; font-weight: 600; margin: 20px 0 6px; }
.hc-explain p, .hc-explain li { font-size: 14.5px; color: var(--ink-2, #2c4670); }
.hc-explain p + p, .hc-explain ul + p, .hc-explain ol + p { margin-top: 10px; }
.hc-explain ul, .hc-explain ol { margin: 6px 0 0 20px; }
.hc-explain li + li { margin-top: 4px; }
.hc-explain a { color: var(--accent, #2f80ed); text-decoration: underline; text-underline-offset: 2px; }
.hc-explain .eqn { font-family: 'Cambria Math', Cambria, 'Times New Roman', Georgia, serif; font-size: 15.5px; background: #f5f8fc;
  border: 1px solid var(--line, #cfd9e8); border-radius: 8px; padding: 8px 12px; margin: 10px 0; overflow-x: auto; direction: ltr; text-align: left; }
.hc-explain table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13.5px; }
.hc-explain th, .hc-explain td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line, #cfd9e8); vertical-align: top; }
.hc-explain th { font-weight: 600; background: #f5f8fc; }
.hc-explain td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) {
  .hc-explain { margin: 20px 12px 8px; padding: 20px 18px; }
  .hc-explain table { display: block; overflow-x: auto; }
}
@media print { .hc-explain { display: none; } }

/* ---- home page: guides band ---- */
.guides-home .section-head { max-width: 980px; margin: 0 auto 20px; }
.guides-home .section-head h2 { font-family: var(--font-serif); font-size: 28px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.guides-home .section-head p { color: var(--ink-3); margin-top: 6px; }
.guide-card h3 { font-family: var(--font-serif); font-size: 18px; font-weight: 600; line-height: 1.3; }
.guides-home-more { max-width: 980px; margin: 18px auto 0; }

/* formula lines: each group stays whole and wraps as a unit on narrow screens */
.eqn .eq-part { display: inline-block; white-space: nowrap; margin-right: 2.4em; }
.eqn .eq-part:last-child { margin-right: 0; }
