/* =========================================================
   taxflo-post.css
   Typography and layout for /blog/<slug> article pages.

   Load AFTER the compiled global stylesheet.
   Every rule is scoped to .tf-post so nothing here can leak
   into the homepage, blog index, or any other route.

   Specificity note: the global stylesheet uses !important on
   heading font-size, so class-level specificity alone does NOT
   win. This was verified: with specificity only, the colour
   applied but the size stayed at 15px at all 13 widths tested.
   !important is therefore used on the typography properties of
   .tf-post headings only. Every one is scoped to .tf-post, so
   nothing here can affect any other route.

   Do not simplify these selectors back to `.tf-post h1` and do
   not strip the !important flags. Both were tried and both
   failed.
   ========================================================= */

.tf-post {
  --tf-blue: #2563EB;
  --tf-blue-dark: #1D4ED8;
  --tf-teal: #14B8A6;
  --tf-ink: #172554;
  --tf-charcoal: #374151;
  --tf-tint: #E9F1FE;
  --tf-border: #E2E8F0;
  --tf-border-strong: #CBD5E1;
  --tf-subtle: #F1F5F9;
  --tf-text: #0F172A;
  --tf-text-2: #475569;
  --tf-text-3: #64748B;
  --tf-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tf-body: 'DM Sans', 'Inter', system-ui, sans-serif;
}

/* ---------- 1. HERO TITLE — the defect being fixed ----------
   Was rendering ~15px, smaller than the 19px lead beneath it,
   and wrapping to three short lines.
   ---------------------------------------------------------- */

.tf-post h1.tf-post-title,
.tf-post .tf-post-title {
  font-family: var(--tf-ui) !important;
  font-size: clamp(28px, 4.6vw, 46px) !important;
  line-height: 1.14 !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
  color: var(--tf-ink) !important;
  margin: 0 0 16px !important;
  max-width: 22ch !important;   /* was 20ch — caused the early wrap */
  text-wrap: balance;
}

@media (max-width: 480px) {
  .tf-post h1.tf-post-title,
  .tf-post .tf-post-title {
    max-width: none !important;   /* never wrap-limit on a phone */
    letter-spacing: -0.02em !important;
    line-height: 1.18 !important;
  }
}

.tf-post p.tf-post-lead,
.tf-post .tf-post-lead {
  font-family: var(--tf-body) !important;
  font-size: clamp(16px, 1.5vw, 19px) !important;
  line-height: 1.6 !important;
  font-weight: 400 !important;
  color: var(--tf-text-2) !important;
  max-width: 60ch;
  margin: 0 0 26px;
}

/* Guarantee the hierarchy holds no matter what global CSS does:
   the lead can never render larger than the title. */


/* ---------- 2. ARTICLE BODY HEADINGS ---------- */

.tf-post article h2,
.tf-post .tf-h2 {
  font-family: var(--tf-ui);
  font-size: clamp(22px, 3vw, 30px) !important;
  line-height: 1.22 !important;
  font-weight: 700 !important;
  letter-spacing: -0.025em !important;
  color: var(--tf-ink) !important;
  margin: 48px 0 14px;
}

.tf-post article h3,
.tf-post .tf-h3 {
  font-family: var(--tf-ui);
  font-size: clamp(17px, 1.7vw, 19px) !important;
  line-height: 1.35 !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  color: var(--tf-ink) !important;
  margin: 32px 0 10px;
}

.tf-post article > h2:first-of-type { margin-top: 0; }

.tf-post .tf-kicker {
  display: block;
  font-family: var(--tf-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tf-teal);
  margin-bottom: 6px;
}

/* ---------- 3. BODY COPY ---------- */

.tf-post article p,
.tf-post article li {
  font-family: var(--tf-body);
  color: var(--tf-charcoal);
}

.tf-post article p { font-size: 16px; line-height: 1.65; margin: 0 0 18px; }
.tf-post article ul,
.tf-post article ol { margin: 0 0 20px; padding-left: 22px; }
.tf-post article li { margin-bottom: 9px; line-height: 1.6; }
.tf-post article li::marker { color: var(--tf-blue); }
.tf-post article strong { color: var(--tf-text); font-weight: 600; }
.tf-post article { max-width: 72ch; }

.tf-post article a {
  color: var(--tf-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.tf-post article a:hover { color: var(--tf-blue-dark); }

/* ---------- 4. MOBILE-CRITICAL: TABLES ----------
   Two tables in this post exceed phone width. They must
   scroll inside their own container, never widen the page.
   The min-width on the grid children is what stops a CSS
   grid blowout at 320-414px.
   ------------------------------------------------- */

.tf-post .tf-cols > * { min-width: 0; }

.tf-post .tf-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 26px;
  border: 1px solid var(--tf-border);
  border-radius: 16px;
  background: #fff;
}

.tf-post .tf-table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 460px;
}

.tf-post .tf-table-scroll caption {
  caption-side: top;
  text-align: left;
  font-family: var(--tf-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tf-text-3);
  padding: 14px 18px 0;
}

.tf-post .tf-table-scroll th {
  font-family: var(--tf-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tf-text-2);
  text-align: left;
  background: var(--tf-subtle);
  padding: 12px 18px;
  border-bottom: 1px solid var(--tf-border);
}

.tf-post .tf-table-scroll td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--tf-border);
  color: var(--tf-charcoal);
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}

.tf-post .tf-table-scroll tbody tr:last-child td { border-bottom: 0; }
.tf-post .tf-table-scroll tbody tr:nth-child(even) { background: #FCFDFF; }

/* ---------- 5. STRUCTURED BLOCKS ---------- */

.tf-post .tf-takeaways {
  background: #fff;
  border: 1px solid var(--tf-border);
  border-left: 4px solid var(--tf-teal);
  border-radius: 16px;
  padding: 22px 24px;
  margin: 0 0 36px;
}
.tf-post .tf-takeaways h2,
.tf-post .tf-takeaways .tf-h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tf-text-3);
  margin: 0 0 12px;
}
.tf-post .tf-takeaways ul { margin: 0; padding-left: 0; list-style: none; }
.tf-post .tf-takeaways li { display: flex; gap: 11px; margin-bottom: 11px; font-size: 15px; line-height: 1.55; }
.tf-post .tf-takeaways li:last-child { margin-bottom: 0; }
.tf-post .tf-takeaways svg { flex: none; margin-top: 4px; color: var(--tf-teal); }

.tf-post .tf-callout {
  background: var(--tf-tint);
  border-left: 4px solid var(--tf-blue);
  border-radius: 0 8px 8px 0;
  padding: 18px 22px;
  margin: 0 0 24px;
}
.tf-post .tf-callout p { margin: 0; color: var(--tf-ink); font-size: 15px; }
.tf-post .tf-callout p + p { margin-top: 10px; }

.tf-post .tf-steps { list-style: none; counter-reset: tfs; margin: 0 0 8px; padding: 0; }
.tf-post .tf-steps > li { counter-increment: tfs; position: relative; padding-left: 52px; margin-bottom: 28px; }
.tf-post .tf-steps > li::before {
  content: counter(tfs);
  position: absolute; left: 0; top: 1px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--tf-tint); color: var(--tf-blue);
  font-family: var(--tf-ui); font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
@media (max-width: 480px) {
  .tf-post .tf-steps > li { padding-left: 44px; }
  .tf-post .tf-steps > li::before { width: 30px; height: 30px; font-size: 14px; }
}

.tf-post .tf-faq-item { border-bottom: 1px solid var(--tf-border); padding: 20px 0; }
.tf-post .tf-faq-item:last-child { border-bottom: 0; }
.tf-post .tf-faq-item h3, .tf-post .tf-faq-item .tf-h3 { margin: 0 0 8px; }
.tf-post .tf-faq-item p { margin: 0; }

/* ---------- 6. TAP TARGETS ---------- */

@media (max-width: 1099px) {
  .tf-post .tf-toc a,
  .tf-post .tf-copy-btn,
  .tf-post .tf-cta a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* ---------- 7. PRINT ---------- */

@media print {
  .tf-post .tf-rail,
  .tf-post .tf-copy-btn,
  .tf-post .tf-band { display: none; }
  .tf-post .tf-cols { display: block; }
  .tf-post article { max-width: none; }
  .tf-post article a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  .tf-post .tf-table-scroll, .tf-post table { page-break-inside: avoid; }
}

/* ---------- 8. MOTION ---------- */

@media (prefers-reduced-motion: reduce) {
  .tf-post *, .tf-post *::before, .tf-post *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}

