/* ============================================================
   ===================  BLOG CSS — START  ====================
   Everything between this line and "BLOG CSS — END" is scoped
   to the blog article template. Safe to lift into a separate
   blog.css file later without touching homepage styles.
   ============================================================ */

/* ---- Global overflow safety net (fixes mobile horizontal scrollbar) ----
   NOTE: we intentionally do NOT set overflow-x:hidden on html/body — doing so
   breaks position:sticky for any descendant (like the TOC sidebar), because
   sticky stops working once any ancestor has overflow other than visible.
   The real fix for the horizontal-scroll bug is the minmax(0,...) grid
   columns below, plus overflow-wrap on prose text. */

   *{ min-width:0; }            /* stops CSS Grid / Flex children from forcing overflow */



/* ---------- Article header ---------- */
.article-header{padding:8px 0 30px; max-width:800px; margin:0 auto;}
.cat-badge{
  display:inline-block; background:#FFF3E8; color:var(--primary-dark); font-size:12.5px; font-weight:700;
  padding:5px 12px; border-radius:20px; margin-bottom:16px; text-transform:uppercase; letter-spacing:.03em;
}
.article-header h1{font-family:'Fraunces', serif; font-size:clamp(28px,4.2vw,42px); font-weight:600; line-height:1.2; margin-bottom:18px;}
.author-row{display:flex; align-items:center; gap:12px;}
.author-avatar{width:42px; height:42px; border-radius:50%; background:linear-gradient(135deg,var(--ink),#3A3F47); flex-shrink:0;}
.author-meta{display:flex; flex-direction:column;}
.author-meta strong{font-size:14.5px;}
.author-meta span{font-size:12.5px; color:var(--muted);}

/* ---------- Cover image ---------- */
.cover-image{
  max-width:900px; width:100%; margin:0 auto 40px; aspect-ratio:16/9; border-radius:var(--radius);
  /* background:linear-gradient(135deg,#FFE3C7,#FFF3E8); border:1px solid var(--border); */
}
.cover-image img{
    border-radius:8px;
}
/* ---------- Article layout ---------- */
/* NOTE: minmax(0, ...) below is the actual fix for the mobile horizontal-scroll
   bug — without it, CSS Grid lets wide children (like the data table) force
   the whole grid track wider than the screen. */
.article-layout{display:grid; grid-template-columns:minmax(0,2.4fr) minmax(0,1fr); gap:48px; max-width:1200px; margin:0 auto; padding-bottom:60px; align-items:start;}
@media(max-width:960px){ .article-layout{grid-template-columns:minmax(0,1fr);} }

/* ---------- Prose styling ---------- */
.prose{max-width:760px; min-width:0; overflow-wrap:break-word; word-wrap:break-word;}
.prose > p{font-size:16.5px; color:#2A2E33; margin-bottom:22px;}
.prose h2{font-family:'Fraunces', serif; font-size:26px; font-weight:600; margin:44px 0 18px; scroll-margin-top:90px;}
.prose h3{font-size:19px; font-weight:700; margin:28px 0 12px;}
.prose ul, .prose ol{margin:0 0 22px 22px;}
.prose li{margin-bottom:8px; font-size:16px; color:#2A2E33;}
.prose strong{color:var(--ink);}
.prose a.inline-link{color:var(--primary); font-weight:600; border-bottom:1px solid currentColor;}
.prose a.inline-link:hover{color:var(--primary-dark);}

.lede-hook{
  font-size:18px; color:var(--ink); border-left:3px solid var(--primary); padding-left:18px; margin-bottom:26px;
  font-weight:500;
}

/* Data table */
.data-table-wrap{
  overflow-x:auto; -webkit-overflow-scrolling:touch; margin:26px 0;
  border:1px solid var(--border); border-radius:10px; max-width:100%;
}
table{width:100%; border-collapse:collapse; font-size:14px; min-width:560px;}
thead{background:var(--ink); color:#fff;}
th{padding:12px 16px; text-align:left; font-weight:600; font-size:13px;}
td{padding:12px 16px; border-top:1px solid var(--border);}
tbody tr:nth-child(even){background:var(--bg);}
tbody tr td.highlight{color:var(--primary-dark); font-weight:700;}

/* Callout / stat box */
.stat-callout{
  background:#FFF3E8; border:1px solid #FBD9B6; border-radius:var(--radius); padding:22px 24px; margin:26px 0;
  display:flex; gap:16px; align-items:flex-start;
}
.stat-callout i{color:var(--primary-dark); font-size:22px; margin-top:2px;}
.stat-callout p{font-size:15px; color:#5A3A1A; margin:0;}

.pull-quote{
  font-family:'Fraunces', serif; font-size:22px; font-weight:600; line-height:1.4; color:var(--ink);
  border-left:3px solid var(--ink); padding-left:20px; margin:32px 0;
}

/* Tool CTA card embedded in article */
.tool-cta-card{
  display:flex; align-items:center; gap:16px; background:#fff; border:1px solid var(--border);
  border-radius:var(--radius); padding:20px; margin:30px 0; box-shadow:var(--shadow);
}
.tool-cta-card .tool-icon{
  width:48px; height:48px; border-radius:10px; background:linear-gradient(135deg,var(--primary),#FFB84D);
  display:flex; align-items:center; justify-content:center; color:#fff; font-size:20px; flex-shrink:0;
}
.tool-cta-card .cta-text{flex:1;}
.tool-cta-card h4{font-size:15.5px; font-weight:700; margin-bottom:4px;}
.tool-cta-card p{font-size:13.5px; color:var(--muted);}
.tool-cta-card .cta-btn{
  background:var(--ink); color:#fff; padding:10px 18px; border-radius:8px; font-size:13.5px; font-weight:600;
  white-space:nowrap;
}
.tool-cta-card .cta-btn:hover{background:var(--primary);}
@media(max-width:560px){ .tool-cta-card{flex-direction:column; align-items:flex-start;} }

/* ---------- FAQ accordion ---------- */
.faq-list{margin-top:14px;}
.faq-item{border-bottom:1px solid var(--border);}
.faq-q{width:100%; display:flex; justify-content:space-between; align-items:center; padding:16px 4px; background:none; border:none; font-size:15px; font-weight:600; text-align:left; cursor:pointer; font-family:inherit;}
.faq-q i{transition:transform .2s ease; color:var(--muted); flex-shrink:0; margin-left:12px;}
.faq-item.open .faq-q i{transform:rotate(180deg);}
.faq-a{max-height:0; overflow:hidden; transition:max-height .25s ease;}
.faq-item.open .faq-a{max-height:260px;}
.faq-a p{padding:0 4px 16px; font-size:14.5px; color:var(--muted);}

/* ---------- Author box ---------- */
.author-box{
  display:flex; gap:18px; background:#fff; border:1px solid var(--border); border-radius:var(--radius);
  padding:24px; margin-top:44px;
}
@media(max-width:560px){ .author-box{flex-direction:column;} }
.author-box .author-avatar{width:64px; height:64px;}
.author-box h4{font-size:16px; font-weight:700; margin-bottom:6px;}
.author-box p{font-size:14px; color:var(--muted); line-height:1.6;}

/* ---------- Related articles ---------- */
.related-section{margin-top:48px;}
.related-section h3{font-size:18px; font-weight:700; margin-bottom:18px;}
.related-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:16px;}
@media(max-width:700px){ .related-grid{grid-template-columns:1fr;} }
.related-card{background:#fff; border:1px solid var(--border); border-radius:10px; overflow:hidden;}
.related-thumb{aspect-ratio:16/10; background:linear-gradient(135deg,#E7EEFA,#F7F8FA);}
.related-card h4{font-size:13.5px; font-weight:700; padding:14px 14px 16px; line-height:1.4;}

/* ---------- Sidebar (TOC + widgets) ---------- */
.sidebar{position:sticky; top:84px; display:flex; flex-direction:column; gap:20px; min-width:0;}
/* On mobile the sidebar would otherwise render AFTER the full article (last in
   the DOM/grid stack). Per request: hide it on mobile rather than reflow it
   awkwardly above the first paragraph. */
@media(max-width:960px){
  .sidebar{display:none;}
}
.toc-box{background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:20px;}
.toc-box h4{font-size:13px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); margin-bottom:14px;}
.toc-box ul{list-style:none;}
.toc-box li{margin-bottom:2px;}
.toc-box a{
  display:block; font-size:13.5px; padding:8px 10px; border-radius:6px; color:var(--muted);
  border-left:2px solid transparent;
}
.toc-box a:hover, .toc-box a.active{color:var(--primary); background:#FFF3E8; border-left-color:var(--primary);}

.side-tool-box{background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:20px; text-align:center;}
.side-tool-box .tool-icon{
  width:44px; height:44px; margin:0 auto 12px; border-radius:10px; background:linear-gradient(135deg,var(--primary),#FFB84D);
  display:flex; align-items:center; justify-content:center; color:#fff; font-size:19px;
}
.side-tool-box h4{font-size:14.5px; font-weight:700; margin-bottom:6px;}
.side-tool-box p{font-size:13px; color:var(--muted); margin-bottom:14px; line-height:1.5;}
.side-tool-box .cta-btn{
  display:block; background:var(--ink); color:#fff; padding:10px; border-radius:8px; font-size:13.5px; font-weight:600;
}
.side-tool-box .cta-btn:hover{background:var(--primary);}

/* ---------- Ad slots ---------- */
.ad-slot{margin:36px auto; max-width:900px;}
.ad-slot .ad-inner{
  border:1px dashed var(--border); border-radius:10px; background:#fff; min-height:90px;
  display:flex; align-items:center; justify-content:center; font-size:12px; color:var(--muted);
  text-transform:uppercase; letter-spacing:.04em;
}
.article-layout .prose .wp-block-paragraph a {
    color: var(--primary);
    font-weight: 600;
    border-bottom: 1px solid currentColor;
}
/* ============================================================
   ====================  BLOG article CSS — END  ======================
   ============================================================ */