/* ============================================================
   blog.css — Shared blog design + bulletproof mobile rules
   Loaded last so it overrides inline styles where needed.
   ============================================================ */

/* ---------- 1. Mobile bulletproof base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: hidden !important; max-width: 100vw; }
img, video, iframe, embed, object, svg { max-width: 100%; height: auto; }
table { max-width: 100%; }
pre, code { white-space: pre-wrap; word-break: break-word; }
a { word-break: break-word; }

/* Smooth scroll to anchor */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

/* ---------- 2. Reading progress bar (top of page) ---------- */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #f5a623, #ff6b6b, #a78bfa);
  z-index: 1000;
  transition: width .1s linear;
  pointer-events: none;
}

/* ---------- 3. Article wrap improvements ---------- */
.article-wrap {
  max-width: 760px !important;
  padding: 2rem 1.25rem !important;
}
@media (max-width: 600px) {
  .article-wrap {
    padding: 1.25rem 1rem !important;
  }
}

/* H1 — fluid sizing already exists; reinforce on small screens */
.article-wrap h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem) !important;
  line-height: 1.25 !important;
  letter-spacing: -.01em;
}

/* H2 — accent left border for clear hierarchy */
.article-wrap h2 {
  position: relative;
  padding-left: .85rem;
  border-left: 4px solid #f5a623;
  margin: 2.25rem 0 1rem !important;
  font-size: clamp(1.2rem, 3.5vw, 1.5rem) !important;
  line-height: 1.3 !important;
}

/* H3 — subtler underline */
.article-wrap h3 {
  margin: 1.75rem 0 .6rem !important;
  font-size: clamp(1.05rem, 2.8vw, 1.2rem) !important;
  color: #a78bfa !important;
}

/* Paragraph spacing + readability */
.article-wrap p {
  font-size: clamp(.95rem, 2.4vw, 1rem) !important;
  line-height: 1.75 !important;
  margin-bottom: 1.15rem !important;
  color: #e8e4f8;
}

/* First paragraph after H1 — slightly larger lead */
.article-wrap > p:first-of-type,
.article-wrap .post-meta + p {
  font-size: clamp(1rem, 2.6vw, 1.1rem) !important;
  color: #f0ecff;
}

/* Lists — better bullet color and spacing */
.article-wrap ul, .article-wrap ol {
  margin: 0 0 1.2rem 1.4rem !important;
  font-size: clamp(.95rem, 2.4vw, 1rem) !important;
  line-height: 1.7 !important;
}
.article-wrap ul li::marker { color: #f5a623; }
.article-wrap ol li::marker { color: #a78bfa; font-weight: 700; }
.article-wrap li { margin-bottom: .45rem; }

/* Strong + Em styling */
.article-wrap strong { color: #f5a623; font-weight: 700; }
.article-wrap em { color: #a78bfa; font-style: italic; }

/* Inline links — subtle underline */
.article-wrap a:not(.cta-btn):not(.related-card):not(.read-more) {
  color: #a78bfa !important;
  text-decoration: underline;
  text-decoration-color: rgba(167, 139, 250, .35);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s, color .2s;
}
.article-wrap a:not(.cta-btn):not(.related-card):not(.read-more):hover {
  color: #f5a623 !important;
  text-decoration-color: rgba(245, 166, 35, .7);
}

/* ---------- 4. Tables — responsive wrap ---------- */
.compare-table,
.article-wrap table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  width: 100% !important;
  max-width: 100%;
  font-size: .9rem !important;
  border-radius: 12px;
  border: 1px solid rgba(167, 139, 250, .15);
}
@media (max-width: 600px) {
  .compare-table,
  .article-wrap table {
    font-size: .82rem !important;
  }
  .compare-table th,
  .compare-table td,
  .article-wrap th,
  .article-wrap td {
    padding: .55rem .65rem !important;
  }
}

/* Visual hint that table scrolls on mobile */
@media (max-width: 600px) {
  .compare-table::after,
  .article-wrap table::after {
    content: '';
  }
}

/* ---------- 5. Info boxes ---------- */
.info-box, .highlight-box, .key-takeaway {
  background: linear-gradient(135deg, rgba(245, 166, 35, .07), rgba(167, 139, 250, .05));
  border: 1px solid rgba(245, 166, 35, .25);
  border-left: 4px solid #f5a623;
  border-radius: 12px;
  padding: 1.1rem 1.3rem !important;
  margin: 1.5rem 0 !important;
}
.info-box p, .highlight-box p, .key-takeaway p {
  margin: 0 !important;
  font-size: .92rem !important;
  color: #e8e4f8 !important;
  line-height: 1.65 !important;
}
@media (max-width: 600px) {
  .info-box, .highlight-box, .key-takeaway {
    padding: .9rem 1rem !important;
  }
  .info-box p, .highlight-box p, .key-takeaway p {
    font-size: .88rem !important;
  }
}

/* ---------- 6. Compare grid — stack on mobile ---------- */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
@media (max-width: 640px) {
  .compare-grid { grid-template-columns: 1fr !important; gap: .75rem !important; }
}
.compare-col {
  background: rgba(24, 21, 53, .6);
  border: 1px solid rgba(167, 139, 250, .15);
  border-radius: 12px;
  padding: 1.1rem;
}
.compare-col h4 {
  font-size: .95rem !important;
  margin-bottom: .55rem !important;
  color: #a78bfa !important;
}
.compare-col p {
  font-size: .88rem !important;
  color: #c2bce0 !important;
  margin: 0 !important;
  line-height: 1.65 !important;
}

/* ---------- 7. FAQ items — better touch targets ---------- */
.faq-item {
  background: rgba(24, 21, 53, .6);
  border: 1px solid rgba(167, 139, 250, .15);
  border-radius: 12px;
  margin-bottom: .65rem;
  overflow: hidden;
  transition: border-color .2s;
}
.faq-item:hover { border-color: rgba(167, 139, 250, .35); }
.faq-item.open { border-color: rgba(245, 166, 35, .35); }
.faq-q {
  padding: 1rem 1.1rem !important;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  cursor: pointer;
  font-weight: 600;
  font-size: .94rem !important;
  line-height: 1.4 !important;
  -webkit-tap-highlight-color: rgba(245, 166, 35, .15);
}
.faq-q .arr {
  flex-shrink: 0;
  color: #a78bfa;
  font-size: 1.1rem;
  transition: transform .25s ease;
}
.faq-item.open .faq-q .arr { transform: rotate(180deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  padding: 0 1.1rem;
  transition: max-height .35s ease, padding .35s ease;
}
.faq-item.open .faq-a {
  max-height: 800px;
  padding: 0 1.1rem 1rem;
}
.faq-a p {
  font-size: .9rem !important;
  color: #c2bce0 !important;
  line-height: 1.7 !important;
  margin: 0 !important;
}
@media (max-width: 600px) {
  .faq-q { padding: .9rem 1rem !important; font-size: .9rem !important; }
  .faq-a { padding: 0 1rem; }
  .faq-item.open .faq-a { padding: 0 1rem .9rem; }
}

/* ---------- 8. CTA box — larger touch target on mobile ---------- */
.cta-box {
  background: linear-gradient(135deg, rgba(245, 166, 35, .12), rgba(167, 139, 250, .08));
  border: 1px solid rgba(245, 166, 35, .35);
  border-radius: 16px;
  padding: 2rem 1.5rem !important;
  margin: 2.25rem 0 !important;
  text-align: center;
}
.cta-box h3 {
  font-size: clamp(1.1rem, 3vw, 1.3rem) !important;
  margin-bottom: .6rem !important;
  color: #fff !important;
}
.cta-box p {
  color: #c2bce0 !important;
  font-size: .92rem !important;
  margin-bottom: 1.25rem !important;
  line-height: 1.6 !important;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f5a623;
  color: #0d0b1e;
  border-radius: 10px;
  padding: .8rem 1.6rem !important;
  font-weight: 700;
  text-decoration: none;
  font-size: .98rem;
  min-height: 48px;
  min-width: 200px;
  transition: transform .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 166, 35, .35);
}
.cta-btn:active { transform: translateY(0); }
@media (max-width: 600px) {
  .cta-box { padding: 1.5rem 1.1rem !important; }
  .cta-btn { width: 100%; min-width: 0; }
}

/* ---------- 9. Related posts ---------- */
.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
@media (max-width: 640px) {
  .related-grid { grid-template-columns: 1fr !important; gap: .75rem !important; }
}
.related-card {
  background: rgba(24, 21, 53, .6);
  border: 1px solid rgba(167, 139, 250, .15);
  border-radius: 12px;
  padding: 1rem 1.1rem !important;
  text-decoration: none;
  display: block;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  min-height: 88px;
}
.related-card:hover {
  border-color: rgba(167, 139, 250, .5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.related-card .rc-tag {
  font-size: .68rem !important;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #f5a623 !important;
  margin-bottom: .45rem !important;
  font-weight: 700;
}
.related-card .rc-title {
  font-size: .9rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  color: #e8e4f8;
}

/* ---------- 10. Post tag pill ---------- */
.post-tag {
  display: inline-block;
  font-size: .72rem !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: rgba(0, 212, 170, .12);
  color: #00d4aa !important;
  padding: .3rem .75rem !important;
  border-radius: 20px;
  margin-bottom: 1rem;
}

/* ---------- 11. Post meta row ---------- */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  font-size: .82rem !important;
  color: #a8a2c8 !important;
  margin-bottom: 1.75rem !important;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(167, 139, 250, .12);
}

/* ---------- 12. Breadcrumb ---------- */
.breadcrumb {
  font-size: .8rem !important;
  color: #a8a2c8 !important;
  margin-bottom: 1.25rem !important;
  word-break: break-word;
}
.breadcrumb a {
  color: #a8a2c8 !important;
  text-decoration: none;
  transition: color .15s;
}
.breadcrumb a:hover { color: #f5a623 !important; }

/* ---------- 13. Block quote ---------- */
.article-wrap blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid #a78bfa;
  background: rgba(167, 139, 250, .06);
  border-radius: 0 10px 10px 0;
  font-style: italic;
  color: #e8e4f8;
}
.article-wrap blockquote p { margin: 0 !important; }

/* ---------- 14. Navigation — touch targets ---------- */
nav .hamburger {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 13px 11px;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  -webkit-tap-highlight-color: rgba(245, 166, 35, .15);
}
@media (max-width: 768px) {
  nav .hamburger { display: flex !important; }
  nav .nav-links { display: none !important; }
  nav .nav-links.open {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: rgba(13, 11, 30, .98);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(167, 139, 250, .15);
    z-index: 99;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  }
  nav .nav-links.open a {
    padding: .85rem 1rem !important;
    display: flex;
    align-items: center;
    border-radius: 8px;
    min-height: 44px;
    font-size: .95rem !important;
  }
}

/* ---------- 15. Legal banner — better mobile layout ---------- */
@media (max-width: 600px) {
  #legal-banner {
    padding: .6rem 1rem !important;
    font-size: .72rem !important;
  }
}

/* ---------- 16. Footer ---------- */
footer {
  padding: 1.75rem 1.25rem !important;
}
footer p { line-height: 1.65; }
footer a {
  display: inline-block;
  padding: .25rem .5rem;
  margin: .15rem !important;
  transition: color .15s;
}

/* ---------- 17. Section dividers ---------- */
.article-wrap > h2 + p {
  margin-top: 0;
}

/* ---------- 18. Selection color ---------- */
::selection {
  background: rgba(245, 166, 35, .35);
  color: #fff;
}

/* ---------- 19. Focus visible (accessibility) ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid #f5a623;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 20. Tap highlight ---------- */
a, button { -webkit-tap-highlight-color: transparent; }

/* ---------- 21. Print styles ---------- */
@media print {
  nav, footer, .reading-progress, .cta-box, .related-posts,
  #legal-banner, .newsletter-capture-mount, .ad-slot { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .article-wrap { max-width: 100% !important; padding: 0 !important; }
  .article-wrap p, .article-wrap li { color: #000 !important; }
  .article-wrap h1, .article-wrap h2, .article-wrap h3 { color: #000 !important; }
}
