/* =========================================================
   CaribTax Blog — Shared Enhancements
   Loaded by every blog post page via <link>
   ========================================================= */

/* ── Button color fix ─────────────────────────────────────
   .article-body a { color: var(--gold) } has higher specificity
   (0,1,1) than .btn-gold (0,1,0), making gold-on-gold text.
   Restore correct contrast with a targeted override. */
.article-body a.btn-gold,
.cta-box a.btn-gold {
  color: var(--bg, #ffffff) !important;
  background: var(--gold, #b8860b) !important;
  text-decoration: none !important;
}
.article-body a.btn-gold:hover,
.cta-box a.btn-gold:hover {
  color: var(--gold, #b8860b) !important;
  background: transparent !important;
  border-color: var(--gold, #b8860b) !important;
}

/* Reading progress bar */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gold, #b8860b);
  z-index: 9999;
  width: 0;
  transition: width 0.15s ease;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.55);
  pointer-events: none;
}

/* Smooth scroll offset so fixed nav doesn't cover anchored headings */
.article-body h2,
.article-body h3 {
  scroll-margin-top: 124px;
}

/* Active ToC link */
.toc-list a {
  transition: color 0.2s, padding-left 0.2s;
}
.toc-list a.toc-active {
  color: var(--gold, #b8860b) !important;
  border-left: 2px solid var(--gold, #b8860b);
  padding-left: 10px;
}

/* ToC block styles (when injected by JS) */
.sidebar-block .toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-block .toc-list li {
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.sidebar-block .toc-list li:last-child {
  border-bottom: none;
}
.sidebar-block .toc-list a {
  display: block;
  padding: 11px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted, #64748b);
  text-decoration: none;
  letter-spacing: 0.03em;
  line-height: 1.45;
}
.sidebar-block .toc-list a:hover {
  color: var(--gold, #b8860b);
}

/* Legal disclaimer strip */
.legal-disclaimer {
  background: var(--bg-2, #f8f9fb);
  border: 1px solid var(--border, #e2e8f0);
  border-top: 3px solid var(--gold, #b8860b);
  border-left: 3px solid var(--gold, #b8860b);
  padding: 28px 28px;
  margin-top: 48px;
  border-radius: 0;
  font-size: 15px;
  color: var(--muted, #64748b);
  line-height: 1.7;
}
.legal-disclaimer strong {
  color: var(--text, #0f172a);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 6px;
}

/* Ensure all ghost/outline CTA buttons have a visible border */
a.btn-gold[style*="background:transparent"],
a.btn-gold[style*="background: transparent"],
.btn-gold-outline {
  border: 1px solid var(--gold, #b8860b) !important;
  color: var(--gold, #b8860b) !important;
  background: transparent !important;
  padding: 12px 28px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s, color 0.2s;
}
a.btn-gold[style*="background:transparent"]:hover,
a.btn-gold[style*="background: transparent"]:hover,
.btn-gold-outline:hover {
  background: var(--gold, #b8860b) !important;
  color: var(--bg, #ffffff) !important;
}

/* Disclaimer bar at very top of article (above breadcrumb) */
.article-disclaimer-bar {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(184, 134, 11, 0.08);
  border: 1px solid rgba(184, 134, 11, 0.2);
  border-left: 4px solid var(--gold, #b8860b);
  padding: 16px 20px;
  margin-bottom: 28px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted, #64748b);
  letter-spacing: 0.02em;
  line-height: 1.6;
}
.article-disclaimer-bar svg {
  flex-shrink: 0;
  opacity: 0.6;
  margin-top: 1px;
}

/* ── Article visual hero header ───────────────────────────────────────────────
   Gives each blog post a distinct, branded entry point above the article body.
   Works with the existing HTML — no restructuring needed. */
article {
  position: relative;
}

/* Gold accent rule at very top of article (before disclaimer bar) */
article > .article-disclaimer-bar:first-child {
  margin-top: 0;
}

/* Elevate the article category label */
.article-cat {
  display: inline-block;
  background: rgba(184, 134, 11, 0.08);
  border: 1px solid rgba(184, 134, 11, 0.25);
  padding: 4px 12px;
  border-radius: 2px;
  letter-spacing: 0.1em;
}

/* Make H1 more commanding */
article h1 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--text, #0f172a);
  margin-top: 14px;
  margin-bottom: 20px;
}

/* Article meta row — subtle visual separation */
.article-meta {
  background: var(--bg-2, #f8f9fb);
  padding: 12px 16px !important;
  border-left: 3px solid var(--gold, #b8860b);
  border-top: 1px solid var(--border, #e2e8f0) !important;
  border-bottom: 1px solid var(--border, #e2e8f0) !important;
}

/* First paragraph of article body — slightly larger lead text */
.article-body > p:first-of-type {
  font-size: 17px;
  color: var(--text, #0f172a);
  line-height: 1.75;
  font-weight: 400;
}

/* h2 headings — gold left rule for visual anchoring */
.article-body h2 {
  border-left: 3px solid var(--gold, #b8860b);
  padding-left: 14px;
  margin-left: -14px;
}

/* Sidebar CTA block — slightly elevated */
.sidebar-block:first-child {
  border-top: 3px solid var(--gold, #b8860b);
  box-shadow: 0 2px 12px rgba(184, 134, 11, 0.08);
}

/* Smooth image rendering in related posts grid */
.related-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

/* Related posts hover — gold lift effect */
.related-card:hover .related-post-title {
  color: var(--gold, #b8860b);
}

/* Mobile: article wrap padding fix */
@media (max-width: 768px) {
  .article-wrap {
    padding: 108px 20px 60px !important;
    gap: 40px;
  }
  article h1 {
    font-size: clamp(24px, 7vw, 36px);
  }
  .article-body h2 {
    margin-left: 0;
    padding-left: 12px;
  }
  .stat-block {
    padding: 20px 16px;
    gap: 16px;
  }
  .stat-block-num {
    font-size: 26px;
  }
  .cta-box {
    padding: 24px 16px;
  }
}

/* ── Rich site footer for blog posts ─────────────────────────────────────── */
.site-footer {
  background: #0f172a;
  color: #94A3B8;
  margin-top: 80px;
}
.site-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 32px 48px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-footer-logo-link { display: inline-block; transition: opacity 0.2s; }
.site-footer-logo-link:hover { opacity: 0.75; }
.site-footer-logo {
  height: 52px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.85;
  margin-bottom: 16px;
}
.site-footer-desc {
  font-size: 14px;
  line-height: 1.7;
  color: #94A3B8;
  margin-bottom: 16px;
  max-width: 280px;
}
.site-footer-parent-link {
  color: #b8860b;
  font-size: 14px;
  text-decoration: none;
}
.site-footer-parent-link:hover { text-decoration: underline; }
.site-footer-links h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #cbd5e1;
  margin-bottom: 16px;
}
.site-footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer-links li {
  margin-bottom: 12px;
  border-bottom: none !important;
  padding: 0 !important;
}
.site-footer-links li::before { content: none !important; }
.site-footer-links li.text-only {
  color: #94A3B8;
  font-size: 14px;
}
.site-footer-links a {
  color: #94A3B8 !important;
  text-decoration: none !important;
  font-size: 14px;
  transition: color 0.2s;
}
.site-footer-links a:hover {
  color: #b8860b !important;
  text-decoration: none !important;
}
.site-footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.site-footer-copy {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #64748b;
}
.site-footer-disclaimer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 32px 32px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.site-footer-disclaimer p {
  font-size: 12px;
  color: #64748B;
  line-height: 1.7;
  text-align: center;
  margin: 0;
}
.site-footer-disclaimer strong { color: #94A3B8; }
.site-footer .xfirm-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #64748b;
}
.site-footer .xfirm-bar a {
  color: #64748b !important;
  text-decoration: none !important;
}
.site-footer .xfirm-bar a:hover { color: #b8860b !important; }
@media (max-width: 1024px) {
  .site-footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}
@media (max-width: 600px) {
  .site-footer-inner {
    grid-template-columns: 1fr;
    padding: 48px 20px 32px;
  }
  .site-footer-bottom {
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
  }
  .site-footer-disclaimer { padding: 16px 20px 24px; }
}
