/* ==========================================================================
   Insights — archive + single. Loaded only on those views (inc/insights.php).
   Builds on main.css tokens (--ink, --red, --mist, --line, --slate …), the
   .page-head/.crumbs/.card-grid/.rcard/.btn/.cta-band/.prose components.
   ========================================================================== */

/* ---- Archive: featured + sidebar ---------------------------------------- */
.insight-top{padding:56px 0;}
.insight-top-grid{display:grid; grid-template-columns:2fr 1fr; gap:40px; align-items:start;}
.insight-featured{border:1px solid var(--line); border-radius:8px; overflow:hidden; background:var(--white);}
.insight-featured-img{display:block; aspect-ratio:16/9; background:var(--mist); overflow:hidden;}
.insight-featured-img img{width:100%; height:100%; object-fit:cover;}
.insight-featured-body{padding:32px; display:flex; flex-direction:column; gap:14px; align-items:flex-start;}
.insight-featured-body h2{font-size:clamp(24px,2.6vw,32px); line-height:1.2;}
.insight-featured-body h2 a{text-decoration:none;}
.insight-featured-body h2 a:hover{color:var(--red);}
.insight-featured-body p{color:var(--slate); font-size:16.5px;}

.insight-widget{margin-bottom:28px;}
.insight-widget-title{font-size:14px; text-transform:uppercase; letter-spacing:0.05em; color:var(--slate); margin-bottom:14px;}
.insight-recent{list-style:none; margin:0; padding:0;}
.insight-recent li{padding:14px 0; border-bottom:1px solid var(--line); display:flex; gap:14px; align-items:center;}
.insight-recent li > div{display:flex; flex-direction:column; gap:2px; min-width:0;}
.insight-recent-thumb{flex:0 0 72px; width:72px; height:72px; border-radius:6px; overflow:hidden; background:var(--mist);}
.insight-recent-thumb img{width:100%; height:100%; object-fit:cover;}
.insight-recent li:last-child{border-bottom:none;}
.insight-recent a{font-weight:700; font-size:15.5px; line-height:1.35; text-decoration:none; color:var(--ink-soft);}
.insight-recent a:hover{color:var(--red);}
.insight-recent .date{font-size:12.5px; color:var(--slate);}

/* ---- Archive: sticky filter tab bar ------------------------------------- */
.insight-tabs{position:sticky; top:85px; z-index:40; background:var(--white);
  border-top:1px solid var(--line); border-bottom:1px solid var(--line);}
.insight-tabs-scroll{display:flex; flex-wrap:wrap; gap:8px; padding:14px 0;
  -webkit-overflow-scrolling:touch; scrollbar-width:none;}
.insight-tabs-scroll::-webkit-scrollbar{display:none;}
.insight-tab{flex:0 0 auto; background:var(--white); border:1px solid var(--line); border-radius:100px;
  padding:8px 18px; font:inherit; font-size:14.5px; font-weight:600; color:var(--ink-soft); cursor:pointer;
  transition:background .2s ease, border-color .2s ease, color .2s ease;}
.insight-tab:hover{border-color:var(--slate);}
.insight-tab.is-active{background:var(--ink); border-color:var(--ink); color:var(--white);}

/* ---- Archive: per-term sections ----------------------------------------- */
.insight-section{padding:var(--section-padding) 0; background:var(--white);}
.insight-section.is-alt{background:var(--mist);}
.insight-section[hidden]{display:none;}
.insight-section-head{display:flex; justify-content:space-between; align-items:baseline; gap:16px; margin-bottom:28px;}
.insight-section-head{align-items:flex-end;}
.insight-section-head h2{font-size:clamp(24px,2.6vw,32px); margin-bottom:4px;}
.insight-section-head h2 a{text-decoration:none; color:inherit;}
.insight-section-head h2 a:hover{color:var(--red);}
.insight-section-sub{color:var(--slate); font-size:15px;}
.insight-section-foot{text-align:center; margin-top:32px;}
.insight-viewall{font-size:14.5px; font-weight:700; color:var(--red); text-decoration:none; white-space:nowrap;}
.insight-viewall:hover{color:var(--red-deep);}
.insight-section .card-grid .rcard{background:var(--white);}

/* ---- CTA strip (reuses .cta-band) --------------------------------------- */
.insight-cta-strip{width:100%; text-align:left;}
.insight-cta-strip-inner{display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:20px;}
.insight-cta-strip .insight-cta-text h2{margin:0 0 6px; max-width:none; font-size:clamp(22px,2.6vw,30px);}
.insight-cta-strip .insight-cta-text p{margin:0; max-width:none;}

/* ---- Single: featured image (top of the article column, not a hero) ----- */
.insight-featured-figure{margin:0 0 28px;}
.insight-featured-figure img{width:100%; height:auto; border-radius:8px;}

/* ---- Single: in-content images, takeaway callout, tables, FAQ ----------- */
.insight-main .prose figure.insight-figure{margin:32px 0; clear:both; text-align:center;}
.insight-main .prose figure.insight-figure img{display:inline-block; max-width:100%; max-height:420px; width:auto; height:auto; border-radius:8px;}
.insight-main .prose h2{clear:both;}

.insight-takeaway{clear:both; background:var(--red-tint); border-left:4px solid var(--red); border-radius:0 8px 8px 0;
  padding:22px 26px; margin:0 0 28px;}
.insight-takeaway p{margin:0; color:var(--ink);}
.insight-takeaway strong{color:var(--red-deep);}

.insight-main .prose table{clear:both; width:100%; border-collapse:separate; border-spacing:0; margin:28px 0;
  border:1px solid var(--line); border-radius:8px; overflow:hidden; font-size:15.5px;}
.insight-main .prose th, .insight-main .prose td{padding:14px 18px; text-align:left; vertical-align:top;
  border-bottom:1px solid var(--line); color:var(--ink-soft);}
.insight-main .prose th{background:var(--ink); color:var(--white); font-weight:700; font-size:14px;
  letter-spacing:0.03em;}
.insight-main .prose tbody tr:nth-child(even) td{background:var(--mist);}
.insight-main .prose tbody tr:last-child td{border-bottom:none;}
.insight-main .prose td:first-child{font-weight:700; color:var(--ink);}

.insight-faq{clear:both; margin-bottom:12px;}
.insight-faq .faq-answer{max-width:none;}
.insight-faq .faq-answer p{font-size:15.5px; color:var(--slate); margin-bottom:12px;}
.insight-faq .faq-q{font-size:inherit;}

/* ---- Single: layout ----------------------------------------------------- */
.insight-body{display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr); gap:40px; align-items:start; padding-top:56px; padding-bottom:var(--section-padding);}
.insight-aside{position:sticky; top:100px; align-self:start;}
.insight-aside h3{font-size:16px; line-height:1.3;}

.insight-tags{list-style:none; display:flex; flex-wrap:wrap; gap:8px; margin:32px 0 0; padding:0;}
.insight-tags a{display:inline-block; background:var(--mist); border:1px solid var(--line); border-radius:100px;
  padding:5px 14px; font-size:13px; font-weight:600; text-decoration:none; color:var(--ink-soft);}
.insight-tags a:hover{border-color:var(--red); color:var(--red);}

/* ---- Single: author box ------------------------------------------------- */
.insight-author{display:flex; gap:20px; align-items:flex-start; margin-top:40px; padding:24px;
  border:1px solid var(--line); border-radius:8px; background:var(--mist);}
.insight-author img{border-radius:50%; flex:0 0 72px; width:72px; height:72px;}
.insight-author-name{font-weight:800; font-size:17px; margin-bottom:4px;}
.insight-author-bio{font-size:15px; color:var(--slate);}

/* ---- Single: Recent Insights (full-width section below the article) ----- */
.insight-related{background:var(--mist); padding:var(--section-padding) 0; border-top:1px solid var(--line);}
.insight-related .card-grid{grid-template-columns:repeat(3,1fr);}

/* ---- Single: TOC -------------------------------------------------------- */
.insight-toc-widget{background:var(--mist); border:1px solid var(--line); border-radius:8px; padding:24px; margin-bottom:28px;}
.insight-toc-widget[hidden]{display:none;}
.insight-toc[hidden]{display:none;}
#insight-toc-nav{position:relative; max-height:320px; overflow-y:auto; overscroll-behavior:contain;
  scrollbar-width:thin; scrollbar-color:var(--line) transparent;}
#insight-toc-nav::-webkit-scrollbar{width:6px;}
#insight-toc-nav::-webkit-scrollbar-thumb{background:var(--line); border-radius:3px;}
#insight-toc-nav ol{list-style:none; margin:0; padding:0; border-left:2px solid var(--line);}
#insight-toc-nav a{display:block; padding:8px 0 8px 16px; margin-left:-2px; border-left:2px solid transparent;
  font-size:14.5px; font-weight:600; line-height:1.4; color:var(--ink-soft); text-decoration:none;
  transition:color .2s ease, border-color .2s ease, background .2s ease;}
#insight-toc-nav a:hover{color:var(--red);}
#insight-toc-nav a.is-active{color:var(--red); border-left-color:var(--red); background:var(--red-tint);}
.insight-main h2[id]{scroll-margin-top:110px;}

/* ---- Single: CTA box ---------------------------------------------------- */
.insight-cta-box{background:var(--ink); color:var(--white); border-radius:8px; padding:28px 24px;}
.insight-cta-box h3{font-size:20px; margin-bottom:8px;}
.insight-cta-box p{color:#B4B7BC; font-size:15px; margin-bottom:20px;}

/* ---- Responsive --------------------------------------------------------- */
@media (max-width:980px){
  .insight-top-grid{grid-template-columns:1fr; gap:32px;}
  .insight-body{grid-template-columns:1fr; gap:40px;}
  .insight-aside{position:static;}
  .insight-related .card-grid{grid-template-columns:repeat(2,1fr);}
}
@media (max-width:620px){
  .insight-top{padding:36px 0;}
  .insight-featured-body{padding:22px;}
  .insight-tabs-scroll{flex-wrap:nowrap; overflow-x:auto; white-space:nowrap;}
  .insight-cta-strip-inner{flex-direction:column; align-items:flex-start;}
  .insight-main .prose table{display:block; overflow-x:auto;}
  .insight-related .card-grid{grid-template-columns:1fr;}
  .insight-section-head{flex-direction:column; align-items:flex-start; gap:6px;}
  .insight-author{flex-direction:column;}
}
@media (prefers-reduced-motion:reduce){
  .insight-tab, #insight-toc-nav a{transition:none;}
}
