/* ═══════════════════════════════════════════════════════════════
   blog.css — Blog listing + post template styles
   Loaded by netlify/functions/blog-render.js (server-side rendered)
   Replaces the previous inline BLOG_CSS string for cacheability.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Reading progress bar (top-of-viewport) ─── */
.blog-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    z-index: 9999;
    pointer-events: none;
}
.blog-progress-bar__fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #25D366, #10b981);
    transition: width 0.1s linear;
    box-shadow: 0 0 12px rgba(37, 211, 102, 0.4);
}

/* Breadcrumb + Back link */
.blog-back-row{max-width:800px;margin:100px auto 0;padding:0 24px;display:flex;align-items:center;gap:8px}
.blog-breadcrumb{display:flex;align-items:center;gap:0;font-size:.88rem;color:var(--text-muted, #8b95a5);min-width:0}
.blog-breadcrumb a{display:inline-flex;align-items:center;gap:5px;color:var(--text-secondary, #8b95a5);text-decoration:none;padding:6px 12px;border-radius:8px;transition:all .2s;white-space:nowrap;font-weight:500}
.blog-breadcrumb a:hover{background:rgba(37,211,102,.08);color:#25D366}
.blog-breadcrumb a svg{flex-shrink:0}
.blog-breadcrumb .bc-sep{color:var(--text-muted, #5c6577);margin:0 2px;opacity:.5;flex-shrink:0}
.blog-breadcrumb .bc-title{color:var(--text-primary, #e8ecf1);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:6px 0}
@media(max-width:600px){.blog-breadcrumb{font-size:.82rem}.blog-breadcrumb a{padding:8px 10px;min-height:36px}.blog-breadcrumb .bc-title{display:none}}

/* Cover Image */
.blog-cover{max-width:900px;margin:24px auto 0;padding:0 24px}
.blog-cover img{width:100%;max-height:420px;object-fit:cover;border-radius:16px;border:1px solid var(--glass-border, rgba(255,255,255,.06))}

/* Article Header */
.blog-header{max-width:800px;margin:32px auto 0;padding:0 24px}
.blog-header h1{font-size:2.5rem;margin:12px 0 16px;line-height:1.2}
.blog-meta{display:flex;align-items:center;gap:12px;color:var(--text-secondary, #8b95a5);font-size:.9rem;flex-wrap:wrap}
.blog-meta-dot{width:3px;height:3px;background:var(--text-muted, #5c6577);border-radius:50%}
.blog-share-btn{display:inline-flex;align-items:center;gap:6px;padding:5px 14px;border-radius:20px;border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.04);color:var(--text-secondary, #8b95a5);font-size:.8rem;font-weight:500;cursor:pointer;transition:all .2s;font-family:inherit}
.blog-share-btn:hover{background:rgba(37,211,102,.08);border-color:rgba(37,211,102,.25);color:#25D366}
.blog-share-btn:active{transform:scale(.96)}
.blog-share-btn svg{flex-shrink:0}

/* Category badge */
.blog-cat-badge{display:inline-block;padding:4px 12px;border-radius:20px;font-size:.75rem;font-weight:600;letter-spacing:.02em;background:color-mix(in srgb,var(--cat-color) 15%,transparent);color:var(--cat-color);border:1px solid color-mix(in srgb,var(--cat-color) 25%,transparent)}

/* Article Content */
.blog-content{max-width:800px;margin:40px auto 0;padding:0 24px}
.blog-content h2{font-size:1.75rem;margin:2.5rem 0 1rem;color:var(--text-primary, #e8ecf1)}
.blog-content h3{font-size:1.35rem;margin:2rem 0 .75rem;color:var(--text-primary, #e8ecf1)}
.blog-content h4{font-size:1.1rem;margin:1.5rem 0 .5rem;color:var(--text-primary, #e8ecf1)}
.blog-content p{font-size:1.05rem;line-height:1.85;color:var(--text-secondary, #d0d5dd);margin-bottom:1.25rem}
.blog-content a{color:#25D366;text-decoration:underline;text-underline-offset:3px}
.blog-content a:hover{color:#34d399}
.blog-content strong{color:var(--text-primary, #e8ecf1);font-weight:600}
.blog-content em{font-style:italic}
.blog-content mark{background:rgba(37,211,102,.2);color:var(--text-primary, #e8ecf1);padding:2px 4px;border-radius:3px}
.blog-content ul,.blog-content ol{margin:0 0 1.25rem 1.5rem}
.blog-content ul{list-style:disc}
.blog-content ol{list-style:decimal}
.blog-content li{font-size:1.05rem;line-height:1.85;color:var(--text-secondary, #d0d5dd);margin-bottom:.5rem}
.blog-content figure{margin:2rem 0;text-align:center}
.blog-content figure img{border-radius:12px;border:1px solid var(--glass-border, rgba(255,255,255,.06))}
.blog-content figure.img-stretched img{width:100%}
.blog-content figcaption{font-size:.85rem;color:var(--text-muted, #5c6577);margin-top:8px}
.blog-content pre{background:var(--bg-card, #141720);border:1px solid var(--glass-border, rgba(255,255,255,.06));border-radius:10px;padding:20px;margin:1.5rem 0;overflow-x:auto;font-size:.9rem;line-height:1.7}
.blog-content pre code{font-family:'JetBrains Mono','Fira Code',Consolas,monospace;color:var(--text-secondary, #d0d5dd);background:none;padding:0}
.blog-content code{font-family:'JetBrains Mono','Fira Code',Consolas,monospace;background:rgba(255,255,255,.06);padding:2px 6px;border-radius:4px;font-size:.9em;color:#34d399}
.blog-content blockquote{margin:1.5rem 0;padding:16px 24px;border-left:3px solid #25D366;background:rgba(37,211,102,.04);border-radius:0 10px 10px 0}
.blog-content blockquote p{color:var(--text-secondary, #d0d5dd);margin-bottom:.5rem}
.blog-content blockquote cite{display:block;font-size:.85rem;color:var(--text-muted, #5c6577);font-style:normal;margin-top:4px}
.blog-content hr{border:none;height:1px;background:rgba(255,255,255,.08);margin:3rem auto;max-width:120px}
.table-wrap{overflow-x:auto;margin:1.5rem 0}
.blog-content table{width:100%;border-collapse:collapse;font-size:.95rem}
.blog-content th{background:var(--bg-card, #181b23);font-weight:600;text-align:left;padding:10px 14px;border-bottom:2px solid rgba(255,255,255,.1)}
.blog-content td{padding:10px 14px;border-bottom:1px solid var(--glass-border, rgba(255,255,255,.06))}
.blog-content tbody tr:nth-child(even){background:rgba(255,255,255,.02)}
.embed-wrap{position:relative;padding-bottom:56.25%;height:0;margin:2rem 0;border-radius:12px;overflow:hidden}
.embed-wrap iframe{position:absolute;top:0;left:0;width:100%;height:100%}
.embed-caption{font-size:.85rem;color:var(--text-muted, #5c6577);text-align:center;margin-top:8px}
.callout{margin:1.5rem 0;padding:16px 20px;background:rgba(245,158,11,.06);border-left:3px solid #f59e0b;border-radius:0 10px 10px 0}
.callout-title{font-weight:600;color:#f59e0b;margin-bottom:4px;font-size:.95rem}
.callout p{color:var(--text-secondary, #d0d5dd);margin:0}
.checklist{margin:1.5rem 0 1.5rem .5rem}
.checklist-item{display:flex;align-items:flex-start;gap:8px;margin-bottom:8px;font-size:1.05rem;color:var(--text-secondary, #d0d5dd);list-style:none}
.check-icon{flex-shrink:0;color:#25D366}
.checklist-item.checked{text-decoration:line-through;opacity:.6}

/* FAQ Section */
.blog-faq{max-width:800px;margin:48px auto 0;padding:0 24px}
.blog-faq h2{font-size:1.75rem;margin-bottom:20px}
.faq-item{border:1px solid var(--glass-border, rgba(255,255,255,.06));border-radius:10px;margin-bottom:10px;overflow:hidden;background:var(--bg-card, #141720)}
.faq-q{padding:16px 20px;cursor:pointer;display:flex;align-items:center;justify-content:space-between;font-weight:500;font-size:1rem;color:var(--text-primary, #e8ecf1);transition:background .2s}
.faq-q:hover{background:rgba(255,255,255,.03)}
.faq-q::after{content:'+';font-size:1.3rem;color:var(--text-muted, #5c6577);transition:transform .2s}
.faq-item.open .faq-q::after{content:'-'}
.faq-a{max-height:0;overflow:hidden;transition:max-height .3s ease,padding .3s ease}
.faq-item.open .faq-a{max-height:500px;padding:0 20px 16px}
.faq-a p{font-size:.95rem;color:var(--text-secondary, #8b95a5);line-height:1.7}

/* Subscribe Widget */
.blog-subscribe{max-width:800px;margin:48px auto 0;padding:0 24px}
.blog-subscribe-inner{background:var(--bg-card, #181b23);border:1px solid var(--glass-border, rgba(255,255,255,.06));border-radius:16px;padding:40px;text-align:center}
.blog-subscribe-inner h3{font-size:1.35rem;margin-bottom:6px;color:var(--text-primary, #e8ecf1)}
.blog-subscribe-inner p{color:var(--text-secondary, #8b95a5);margin-bottom:24px;font-size:.95rem}
.blog-sub-form{display:flex;flex-direction:column;gap:12px;max-width:420px;margin:0 auto}
.blog-sub-row{display:flex;gap:10px}
.blog-sub-row input{flex:1;padding:12px 16px;border-radius:10px;border:1px solid var(--glass-border, rgba(255,255,255,.08));background:var(--bg-surface, #141720);color:var(--text-primary, #e8ecf1);font-size:.95rem;font-family:inherit;outline:none;transition:border-color .2s}
.blog-sub-row input:focus{border-color:rgba(37,211,102,.4)}
.blog-sub-row input::placeholder{color:var(--text-muted, #5c6577)}
.blog-sub-channels{display:flex;gap:18px;justify-content:center;margin-bottom:4px}
.blog-sub-channels label{display:inline-flex;align-items:center;gap:8px;font-size:.85rem;color:var(--text-secondary, #8b95a5);cursor:pointer;user-select:none}
.blog-sub-optin{display:flex;align-items:flex-start;gap:10px;margin:4px 2px;font-size:.78rem;line-height:1.5;color:var(--text-secondary, #8b95a5);cursor:pointer;text-align:left;user-select:none}
.blog-sub-optin span{padding-top:1px}

/* ── ODIV branded custom checkbox ──
   Shared utility. Used for blog subscribe channels, blog opt-in consent,
   and end-user dashboard notification prefs so the entire platform has
   the same tick style. Works on dark backgrounds. */
.odiv-check{
  appearance:none;-webkit-appearance:none;-moz-appearance:none;
  width:18px;height:18px;border-radius:5px;
  border:1.5px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.03);
  cursor:pointer;position:relative;flex-shrink:0;margin:0;
  display:inline-flex;align-items:center;justify-content:center;
  transition:border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .12s ease;
}
.odiv-check:hover{border-color:rgba(37,211,102,.5);background:rgba(37,211,102,.06)}
.odiv-check:active{transform:scale(.94)}
.odiv-check:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(37,211,102,.2);border-color:#25D366}
.odiv-check:checked{border-color:#25D366;background:linear-gradient(135deg,#25D366,#10b981)}
.odiv-check:checked::after{
  content:'';width:4px;height:9px;
  border:solid #fff;border-width:0 2px 2px 0;
  transform:rotate(45deg) translate(-.5px,-1px);
}
.odiv-check:disabled{opacity:.4;cursor:not-allowed}
.blog-sub-btn{padding:12px 32px;border-radius:10px;background:linear-gradient(135deg,#25D366,#10b981);color:#fff;font-weight:600;font-size:.95rem;border:none;cursor:pointer;font-family:inherit;transition:opacity .2s}
.blog-sub-btn:hover{opacity:.9}
.blog-sub-btn:disabled{opacity:.5;cursor:not-allowed}
.blog-sub-msg{font-size:.85rem;margin-top:12px;min-height:20px}
.blog-sub-msg.success{color:#25D366}
.blog-sub-msg.error{color:#ef4444}
.blog-sub-note{font-size:.75rem;color:var(--text-muted, #5c6577);margin-top:8px}
@media(max-width:600px){.blog-sub-row{flex-direction:column}.blog-subscribe-inner{padding:28px 20px}}

/* CTA Banner */
.blog-cta{max-width:800px;margin:48px auto 0;padding:0 24px 80px}
.blog-cta-inner{background:linear-gradient(135deg,rgba(37,211,102,.12),rgba(16,185,129,.06));border:1px solid rgba(37,211,102,.2);border-radius:16px;padding:48px;text-align:center}
.blog-cta-inner h3{font-size:1.5rem;margin-bottom:12px}
.blog-cta-inner p{color:var(--text-secondary, #8b95a5);margin-bottom:24px;font-size:1rem}
.blog-cta-btn{display:inline-flex;align-items:center;padding:12px 32px;border-radius:10px;background:linear-gradient(135deg,#25D366,#10b981);color:#fff;font-weight:600;font-size:1rem;transition:opacity .2s;text-decoration:none}
.blog-cta-btn:hover{opacity:.9;color:#fff}

/* Related Posts */
.blog-related{max-width:1100px;margin:56px auto 0;padding:0 24px 80px}
.blog-related h2{font-size:1.5rem;margin-bottom:24px}
.related-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}
.related-card{background:var(--bg-card, #181b23);border:1px solid var(--glass-border, rgba(255,255,255,.06));border-radius:14px;overflow:hidden;transition:border-color .2s,transform .2s;text-decoration:none;color:inherit}
.related-card:hover{border-color:rgba(255,255,255,.12);transform:translateY(-2px)}
.related-card img{width:100%;height:180px;object-fit:cover}
.related-card-body{padding:16px 20px}
.related-card-body h4{font-size:1rem;margin-bottom:8px;line-height:1.4}
.related-card-body p{font-size:.85rem;color:var(--text-muted, #5c6577);line-height:1.5}
@media(max-width:900px){.related-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){.related-grid{grid-template-columns:1fr}.related-card img{height:160px}}

/* Blog Listing */
.blog-hero{text-align:center;padding:80px 24px 32px;max-width:700px;margin:0 auto}
.blog-hero h1{font-size:2.8rem;margin-bottom:12px}
.blog-hero p{font-size:1.1rem;color:var(--text-secondary, #8b95a5)}
.blog-filters{display:flex;gap:8px;justify-content:center;padding:0 24px 32px;flex-wrap:wrap;margin-top:-16px}
.blog-filter-btn{padding:6px 16px;border-radius:20px;border:1px solid rgba(255,255,255,.08);background:transparent;color:var(--text-secondary, #8b95a5);font-size:.85rem;font-family:inherit;cursor:pointer;transition:all .2s}
.blog-filter-btn:hover,.blog-filter-btn.active{background:rgba(37,211,102,.1);border-color:rgba(37,211,102,.3);color:#25D366}
.blog-grid{max-width:1100px;margin:0 auto;padding:0 24px 64px;display:grid;grid-template-columns:repeat(3,1fr);gap:24px}
.blog-card{background:linear-gradient(165deg,var(--bg-card, #181b23) 0%,var(--bg-surface, #141720) 100%);border:1px solid var(--glass-border, rgba(255,255,255,.06));border-radius:16px;overflow:hidden;transition:all .35s cubic-bezier(.4,0,.2,1);text-decoration:none;color:inherit;display:flex;flex-direction:column;position:relative}
.blog-card::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(135deg,#25D366,#10b981);opacity:0;transition:opacity .35s}
.blog-card:hover{border-color:rgba(37,211,102,.2);transform:translateY(-6px);box-shadow:0 20px 40px -12px rgba(0,0,0,.4),0 0 0 1px rgba(37,211,102,.08),0 0 60px -20px rgba(37,211,102,.1)}
.blog-card:hover::before{opacity:1}
.blog-card-img-wrap{position:relative;overflow:hidden}
.blog-card-img-wrap::after{content:'';position:absolute;bottom:0;left:0;right:0;height:40px;background:linear-gradient(to top,var(--bg-card, #181b23),transparent);pointer-events:none}
.blog-card img{width:100%;height:200px;object-fit:cover;display:block;transition:transform .5s cubic-bezier(.4,0,.2,1)}
.blog-card:hover img{transform:scale(1.04)}
.blog-card-body{padding:20px 22px 22px;display:flex;flex-direction:column;flex:1}
.blog-card-body .blog-cat-badge{font-size:.68rem;font-weight:700;letter-spacing:.08em;padding:3px 10px;background:color-mix(in srgb,var(--cat-color) 10%,transparent);border:1px solid color-mix(in srgb,var(--cat-color) 15%,transparent);border-radius:100px;width:fit-content;margin-bottom:10px}
.blog-card-body h3{font-family:'Outfit',sans-serif;font-size:1.1rem;font-weight:700;margin:0 0 10px;line-height:1.35;color:var(--text-primary, #e8ecf1);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;transition:color .2s}
.blog-card:hover h3{color:#fff}
.blog-card-body p{font-size:.85rem;color:var(--text-secondary, #8b95a5);line-height:1.6;margin-bottom:16px;flex:1;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.blog-card-footer{display:flex;align-items:center;gap:8px;font-size:.75rem;color:var(--text-muted, #5c6577);padding-top:14px;border-top:1px solid var(--glass-border, rgba(255,255,255,.06))}
.blog-card-footer .dot{width:3px;height:3px;background:var(--text-muted, #5c6577);border-radius:50%;flex-shrink:0}
.blog-card-read{margin-left:auto;color:#25D366;font-weight:600;font-size:.78rem;display:inline-flex;align-items:center;gap:4px;transition:gap .2s;flex-shrink:0}
.blog-card:hover .blog-card-read{gap:8px}
@media(max-width:900px){.blog-grid{grid-template-columns:repeat(2,1fr);gap:20px}.blog-hero h1{font-size:2.2rem}}
@media(max-width:600px){.blog-grid{grid-template-columns:1fr;gap:16px}.blog-hero h1{font-size:1.8rem}.blog-card img{height:180px}.blog-card-body{padding:16px 18px 18px}}
.blog-empty{text-align:center;padding:80px 24px;color:var(--text-muted, #5c6577)}
.blog-empty h3{margin-bottom:8px;color:var(--text-secondary, #8b95a5)}

/* Language Picker */
.blog-lang-picker{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:16px;padding:0 24px;max-width:800px;margin-left:auto;margin-right:auto}
.blog-lang-btn{padding:4px 10px;border-radius:6px;border:1px solid var(--glass-border, rgba(255,255,255,.06));background:transparent;color:var(--text-secondary, #8b95a5);font-size:.8rem;font-weight:600;cursor:pointer;transition:all .2s;font-family:inherit;text-decoration:none;display:inline-block}
.blog-lang-btn:hover{border-color:rgba(37,211,102,.3);color:var(--text-primary, #e8ecf1)}
.blog-lang-btn.active{background:rgba(37,211,102,.1);border-color:rgba(37,211,102,.3);color:#25D366;pointer-events:none}

/* Article responsive */
@media(max-width:600px){
  .blog-header h1{font-size:1.8rem}
  .blog-content p,.blog-content li{font-size:1rem}
  .blog-cta-inner{padding:32px 20px}
}

/* RTL support (Arabic) — must be AFTER all LTR rules to override */
html[dir="rtl"] .blog-back-row{flex-direction:row-reverse}
html[dir="rtl"] .blog-back-link{flex-direction:row-reverse}
html[dir="rtl"] .blog-back-link svg{transform:scaleX(-1)}
html[dir="rtl"] .blog-breadcrumb{direction:rtl;text-align:right}
html[dir="rtl"] .blog-header{text-align:right}
html[dir="rtl"] .blog-meta{flex-direction:row-reverse;justify-content:flex-start}
html[dir="rtl"] .blog-content{text-align:right;direction:rtl}
html[dir="rtl"] .blog-content p,html[dir="rtl"] .blog-content li{text-align:right}
html[dir="rtl"] .blog-content ul,html[dir="rtl"] .blog-content ol{margin:0 1.5rem 1.25rem 0;padding:0}
html[dir="rtl"] .blog-content ul{list-style-position:inside}
html[dir="rtl"] .blog-content ol{list-style-position:inside}
html[dir="rtl"] .blog-content blockquote{border-left:none;border-right:3px solid #25D366;border-radius:10px 0 0 10px;padding:16px 24px 16px 16px}
html[dir="rtl"] .blog-faq{text-align:right}
html[dir="rtl"] .faq-q{flex-direction:row-reverse}
html[dir="rtl"] .faq-q::after{content:'\2039'}
html[dir="rtl"] .faq-a p{text-align:right}
html[dir="rtl"] .blog-subscribe-inner{text-align:right}
html[dir="rtl"] .blog-sub-channels{flex-direction:row-reverse}
html[dir="rtl"] .blog-cta-inner{text-align:right}
html[dir="rtl"] .blog-related h2{text-align:right}
html[dir="rtl"] .related-card-body{text-align:right}
html[dir="rtl"] .blog-lang-btn{direction:ltr}
html[dir="rtl"] .blog-cat-badge{direction:rtl}
html[dir="rtl"] .checklist-item{flex-direction:row-reverse}
html[dir="rtl"] .callout{border-left:none;border-right:3px solid #f59e0b;border-radius:10px 0 0 10px}
