/* ═══════════════════════════════════════════
   blog/blog.css — RevAvenues blog
   Shared by the blog listing (blog/index.html) and every post page.
   Linked with an absolute path (/blog/blog.css) because the listing is
   also served at /blog/<category> via _redirects.
═══════════════════════════════════════════ */

/* BASE */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:"Inter",sans-serif;background:#fff;color:#0B1F3A;min-height:100vh}

/* HEADER — the site header (#nav + mobile drawer) comes from /shared.css,
   the same file the main site uses. It is fixed and 64px tall, so the page
   starts below it. */
body{padding-top:64px}

/* ── LISTING PAGE ── */

/* HERO */
.blog-hero{background:linear-gradient(135deg,#0B1F3A 0%,#122848 100%);padding:5rem 2rem 3.5rem;text-align:center}
.blog-hero .label{display:inline-block;background:rgba(46,111,242,.2);color:#7ba5ff;font-size:.72rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;padding:.35rem .9rem;border-radius:50px;margin-bottom:1.2rem;border:1px solid rgba(46,111,242,.3)}
.blog-hero h1{font-size:clamp(2rem,5vw,3.2rem);font-weight:900;color:#fff;letter-spacing:-.03em;line-height:1.1;margin-bottom:1rem}
.blog-hero h1 em{font-style:normal;color:#2E6FF2}
.blog-hero p{font-size:1.05rem;color:rgba(255,255,255,.55);max-width:520px;margin:0 auto;line-height:1.6}

/* CATEGORY TABS */
.cat-bar{background:#fff;border-bottom:1px solid rgba(11,31,58,.08);position:sticky;top:64px;z-index:90}
.cat-bar-inner{max-width:1100px;margin:0 auto;padding:0 1.5rem;display:flex;align-items:center;gap:.25rem;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.cat-bar-inner::-webkit-scrollbar{display:none}
.cat-tab{flex-shrink:0;padding:.65rem 1rem;font-size:.8rem;font-weight:600;color:#64748b;background:none;border:none;cursor:pointer;border-bottom:2px solid transparent;transition:color .15s,border-color .15s;white-space:nowrap;font-family:"Inter",sans-serif}
.cat-tab:hover{color:#0B1F3A}
.cat-tab.active{color:#2E6FF2;border-bottom-color:#2E6FF2}
.cat-count{display:inline-block;background:rgba(46,111,242,.1);color:#2E6FF2;font-size:.65rem;font-weight:700;padding:.1rem .4rem;border-radius:50px;margin-left:.35rem;vertical-align:middle}
.cat-tab.active .cat-count{background:#2E6FF2;color:#fff}

/* POSTS GRID */
.blog-main{max-width:1100px;margin:0 auto;padding:2.5rem 1.5rem 5rem}
.posts-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:1.75rem}
.post-card{border:1px solid rgba(11,31,58,.1);border-radius:14px;overflow:hidden;transition:box-shadow .2s,transform .2s;background:#fff;cursor:pointer;text-decoration:none;color:inherit;display:block}
.post-card:hover{box-shadow:0 8px 32px rgba(11,31,58,.12);transform:translateY(-2px)}
.card-img{background:linear-gradient(135deg,#0B1F3A,#1a3a60);height:180px;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}
.card-img img{width:100%;height:100%;object-fit:cover;display:block}
.card-img-pattern{position:absolute;inset:0;background-image:radial-gradient(circle at 20% 50%, rgba(46,111,242,.4) 0%, transparent 60%),radial-gradient(circle at 80% 20%, rgba(46,111,242,.2) 0%, transparent 50%)}
.card-img-icon{font-size:2.5rem;position:relative;z-index:1}
.card-body{padding:1.4rem}
.card-category{font-size:.7rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:#2E6FF2;margin-bottom:.6rem}
.card-title{font-size:1rem;font-weight:700;color:#0B1F3A;line-height:1.35;margin-bottom:.65rem;letter-spacing:-.015em}
.card-excerpt{font-size:.82rem;color:#64748b;line-height:1.6;margin-bottom:1rem;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.card-meta{display:flex;align-items:center;gap:.7rem;font-size:.73rem;color:#94a3b8}
.card-meta span{display:flex;align-items:center;gap:.25rem}

/* SECTION HEADINGS (archive summary; category sections on the All tab) */
.blog-section-title{display:flex;align-items:center;font-size:1.15rem;font-weight:800;color:#0B1F3A;letter-spacing:-.02em;line-height:1.3}

/* CATEGORY SECTIONS — All tab: one section per category, heading + "View all (N) →" */
.blog-section+.blog-section{margin-top:3rem}
.blog-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:1rem;margin-bottom:1.25rem}
.blog-section-link{flex-shrink:0;font-size:.82rem;font-weight:700;color:#2E6FF2;text-decoration:none}
.blog-section-link:hover{color:#1A5ADB;text-decoration:underline;text-underline-offset:2px}

/* ARCHIVE — posts older than 3 months, collapsible <details> below the active posts */
.blog-archive{margin-top:3.5rem;padding-top:1.75rem;border-top:1px solid rgba(11,31,58,.08)}
.blog-archive>summary{display:flex;align-items:center;gap:.6rem;cursor:pointer;list-style:none}
.blog-archive>summary::-webkit-details-marker{display:none}
.blog-archive>summary::before{content:"\25B8";color:#2E6FF2;font-size:.9rem;transition:transform .15s}
.blog-archive[open]>summary{margin-bottom:1.5rem}
.blog-archive[open]>summary::before{transform:rotate(90deg)}
.blog-archive>summary:hover .blog-section-title{color:#2E6FF2}

/* EMPTY / LOADING */
.state-box{text-align:center;padding:5rem 2rem;color:#94a3b8}
.state-box h2{font-size:1.3rem;font-weight:700;color:#0B1F3A;margin-bottom:.5rem}
.state-box p{font-size:.9rem}

/* ── POST PAGES ── */

/* POST HERO */
.post-hero{background:linear-gradient(135deg,#0B1F3A 0%,#152d52 100%);padding:4rem 2rem 3.5rem}
.post-hero-inner{max-width:860px;margin:0 auto}
.back-link{display:inline-flex;align-items:center;gap:.4rem;color:rgba(255,255,255,.5);font-size:.8rem;font-weight:600;text-decoration:none;letter-spacing:.02em;margin-bottom:1.5rem;transition:color .15s;border:1px solid rgba(255,255,255,.15);padding:.35rem .85rem;border-radius:50px}
.back-link:hover{color:#fff;border-color:rgba(255,255,255,.35)}
.post-category{display:inline-block;background:rgba(46,111,242,.25);color:#7ba5ff;font-size:.7rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;padding:.3rem .9rem;border-radius:50px;margin-bottom:1rem;border:1px solid rgba(46,111,242,.4)}
.post-title{font-size:clamp(1.75rem,4.5vw,2.8rem);font-weight:900;color:#fff;letter-spacing:-.03em;line-height:1.15;margin-bottom:1rem}
.post-meta{display:flex;align-items:center;gap:.6rem;font-size:.8rem;color:rgba(255,255,255,.45);flex-wrap:wrap}
.meta-sep{opacity:.4}
.post-excerpt{font-size:1rem;color:rgba(255,255,255,.55);line-height:1.65;max-width:640px;margin-top:.9rem}

/* FEATURED IMAGE */
.post-feat-img{max-width:1100px;margin:0 auto;padding:2rem 2rem 0;line-height:0}
.post-feat-img img{width:100%;height:auto;border-radius:12px;box-shadow:0 8px 40px rgba(11,31,58,.18)}
.post-feat-img figcaption{font-size:.78rem;color:#94a3b8;text-align:center;margin-top:.75rem;line-height:1.5;padding:0 1rem}

/* TWO-COLUMN LAYOUT */
.post-layout{max-width:1100px;margin:0 auto;padding:3rem 2rem 5rem;display:grid;grid-template-columns:220px 1fr;gap:3.5rem;align-items:start}

/* TOC */
.post-toc{position:sticky;top:90px;max-height:calc(100vh - 110px);overflow-y:auto;scrollbar-width:none}
.post-toc::-webkit-scrollbar{display:none}
/* Article always in column 2: when a post has no H2s the TOC is hidden (display:none) and the body would otherwise auto-place into the 220px TOC column */
.post-body{grid-column:2;min-width:0}
.toc-label{font-size:.68rem;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:#94a3b8;margin-bottom:.85rem}
.toc-nav{display:flex;flex-direction:column;gap:.1rem}
.toc-nav a{font-size:.8rem;font-weight:500;color:#64748b;text-decoration:none;padding:.35rem .6rem;border-radius:5px;border-left:2px solid transparent;transition:color .15s,border-color .15s,background .15s;line-height:1.4;display:block}
.toc-nav a:hover{color:#2E6FF2;background:rgba(46,111,242,.06);border-left-color:#2E6FF2}
.toc-nav a.toc-active{color:#2E6FF2;background:rgba(46,111,242,.08);border-left-color:#2E6FF2;font-weight:600}

/* ARTICLE */
.article-body{font-size:1rem;line-height:1.75;color:#1e293b;min-width:0}
.article-body h2{scroll-margin-top:80px;font-size:1.45rem;font-weight:800;color:#0B1F3A;letter-spacing:-.025em;margin:2.75rem 0 .9rem;line-height:1.25;padding-bottom:.6rem;border-bottom:2px solid rgba(46,111,242,.12)}
.article-body h3{font-size:1.1rem;font-weight:700;color:#0B1F3A;letter-spacing:-.015em;margin:1.75rem 0 .65rem;line-height:1.3}
.article-body p{margin-bottom:1.1rem}
.article-body ul,.article-body ol{margin:0 0 1.1rem 1.5rem}
.article-body li{margin-bottom:.35rem}
.article-body strong{font-weight:700;color:#0B1F3A}
.article-body em{font-style:italic}
.article-body a{color:#2E6FF2;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}
.article-body a:hover{color:#1A5ADB}
.article-body blockquote{border-left:3px solid #2E6FF2;padding:.6rem 1.25rem;margin:1.5rem 0;color:#475569;background:rgba(46,111,242,.04);border-radius:0 8px 8px 0}
.article-body blockquote p{margin:0}
.article-body code{background:rgba(46,111,242,.08);color:#1e40af;padding:.1em .4em;border-radius:4px;font-size:.88em;font-family:'Courier New',monospace}
.article-body pre{background:#0f172a;color:#e2e8f0;padding:1.25rem 1.5rem;border-radius:10px;overflow-x:auto;font-size:.85rem;margin:1.5rem 0}
.article-body pre code{background:none;color:inherit;padding:0;font-size:1em}
.article-body hr{border:none;border-top:1px solid rgba(11,31,58,.1);margin:2rem 0}
.article-body table{width:100%;border-collapse:collapse;margin:1.5rem 0;font-size:.9rem}
.article-body th,.article-body td{padding:.65rem .9rem;border:1px solid rgba(11,31,58,.12);text-align:left}
.article-body th{background:#f1f5f9;font-weight:700;color:#0B1F3A}
.article-body img{max-width:100%;height:auto;border-radius:8px;margin:1rem 0}

/* FAQ */
.faq-section{margin-top:3rem;padding-top:2.5rem;border-top:1px solid rgba(11,31,58,.1)}
.faq-section>h2{font-size:1.4rem;font-weight:800;color:#0B1F3A;margin-bottom:1.4rem}
.faq-item{border:1px solid rgba(11,31,58,.1);border-radius:10px;padding:1.1rem 1.3rem;margin-bottom:.75rem;background:#f8fafc}
.faq-q{font-size:.93rem;font-weight:700;color:#0B1F3A;margin-bottom:.5rem;line-height:1.35}
.faq-a{font-size:.87rem;color:#475569;line-height:1.65}
.faq-a p{margin:0}

/* READ NEXT */
.read-next{margin-top:3rem;padding-top:2.5rem;border-top:1px solid rgba(11,31,58,.1)}
.rn-label{font-size:.68rem;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:#94a3b8;margin-bottom:1.25rem}
.rn-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem}
.rn-card{border:1px solid rgba(11,31,58,.1);border-radius:10px;padding:1.2rem;text-decoration:none;color:inherit;display:block;transition:box-shadow .2s,transform .2s}
.rn-card:hover{box-shadow:0 6px 24px rgba(11,31,58,.1);transform:translateY(-2px)}
.rn-cat{font-size:.68rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:#2E6FF2;margin-bottom:.5rem}
.rn-title{font-size:.9rem;font-weight:700;color:#0B1F3A;line-height:1.35;margin-bottom:.4rem}
.rn-excerpt{font-size:.78rem;color:#64748b;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* CTA */
.post-cta{background:linear-gradient(135deg,#0B1F3A,#152d52);border-radius:14px;padding:2.5rem 2rem;text-align:center;margin-top:3rem}
.post-cta h2{font-size:1.4rem;font-weight:800;color:#fff;letter-spacing:-.025em;margin-bottom:.75rem}
.post-cta p{color:rgba(255,255,255,.6);font-size:.9rem;line-height:1.6;max-width:480px;margin:0 auto 1.5rem}
.cta-btn{display:inline-block;background:#2E6FF2;color:#fff;text-decoration:none;padding:.7rem 1.75rem;border-radius:50px;font-size:.88rem;font-weight:700;transition:background .2s}
.cta-btn:hover{background:#1A5ADB}

/* FOOTER */
.site-footer{background:#0B1F3A;padding:2rem;text-align:center;font-size:.78rem;color:rgba(255,255,255,.3)}
.site-footer a{color:rgba(255,255,255,.5);text-decoration:none}

/* RESPONSIVE */
@media(max-width:960px){
  .post-layout{grid-template-columns:1fr;gap:2rem;padding:2rem 1.25rem 4rem}
  .post-body{grid-column:auto}
  .post-toc{position:static;max-height:none;border:1px solid rgba(11,31,58,.1);border-radius:10px;padding:1rem 1.25rem;background:#f8fafc}
  .post-feat-img{padding:1.5rem 1.25rem 0}
  .post-hero{padding:3rem 1.25rem 2.5rem}
}
@media(max-width:600px){
  .blog-hero{padding:3.5rem 1.25rem 3rem}
  .blog-main{padding:2rem 1rem 4rem}
  .posts-grid{grid-template-columns:1fr}
  .cat-tab{padding:.55rem .8rem;font-size:.76rem}
  .post-layout{padding:1.75rem 1rem 3.5rem}
}
