/* ============================================================================
   BLOG DESIGN SYSTEM V2 — Shared canonical blog stylesheet
   ----------------------------------------------------------------------------
   Single source of truth for ALL blog article layout.
   Replaces the per-article inline <style> blocks (Article-specific CSS = 0).
   Articles 01-04 all link this file. Legacy FAQ (.blog-faq) and legacy
   Related (.blog-related) markup from older articles is styled identically
   to the current system so every article reads as one template.

   Design goals (user spec):
   - Final CTA -> Footer effective gap ~64px desktop / ~48px mobile
   - Compact Final CTA (no oversized block + huge white void)
   - Identical FAQ / Related / CTA component design across all articles
   - No stacked margins (CTA margin + article padding + main padding)
   ============================================================================ */

:root {
  /* Cookie banner safe space — set by the banner script when visible.
     Default 0 = no effect until the banner is open. */
  --cookie-banner-safe-space: 0px;
}

/* Reserve page-bottom space only while the cookie banner is open,
   so it never overlaps the footer and never adds a permanent blank gap. */
body.cookie-banner-open {
  padding-bottom: var(--cookie-banner-safe-space);
}

/* ----- Article shell ----- */
.blog-article { max-width: 900px; margin: 0 auto; padding: 48px 24px 0; }

.blog-breadcrumb { font-size: 14px; color: var(--text-light); margin-bottom: 24px; }
.blog-breadcrumb a { color: var(--navy); text-decoration: none; }
.blog-breadcrumb a:hover { color: var(--orange); }
.blog-breadcrumb span { margin: 0 8px; color: var(--gray-400); }

.blog-header { margin-bottom: 48px; }
.blog-header__category { font-size: 12px; font-weight: 600; color: var(--orange); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 12px; }
.blog-header h1 { font-size: clamp(32px, 4vw, 48px); font-weight: 300; line-height: 1.2; margin-bottom: 16px; color: var(--navy); }
.blog-header__meta { font-size: 14px; color: var(--text-light); }

/* ----- Content sections ----- */
.blog-section { margin-bottom: 40px; }
.blog-section h2 { font-size: clamp(22px, 2.5vw, 28px); font-weight: 300; margin: 40px 0 20px; color: var(--navy); border-bottom: 1px solid var(--gray-200); padding-bottom: 12px; }
.blog-section h3 { font-size: 18px; font-weight: 600; margin: 24px 0 12px; color: var(--navy); }
.blog-section p { font-size: 16px; line-height: 1.7; color: var(--text); margin-bottom: 16px; }
.blog-section ul, .blog-section ol { margin: 0 0 16px 24px; }
.blog-section li { font-size: 16px; line-height: 1.7; margin-bottom: 8px; }

/* ----- Tables ----- */
.blog-table { width: 100%; border-collapse: collapse; margin: 20px 0; background: var(--white); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.blog-table th, .blog-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--gray-200); font-size: 14px; }
.blog-table th { background: var(--navy); color: var(--white); font-weight: 600; }
.blog-table tr:last-child td { border-bottom: none; }
.blog-table strong { color: var(--navy); }
@media (max-width: 768px) { .blog-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; } }

/* ----- Key Takeaways ----- */
.key-takeaways { background: linear-gradient(135deg, #FEF7E6 0%, #FDF4DC 100%); border: 1px solid #F59E0B; border-radius: 12px; padding: 24px; margin: 24px 0; }
.key-takeaways h3 { font-size: 16px; font-weight: 600; color: #92400E; margin-bottom: 16px; }
.key-takeaways ul { list-style: none; padding: 0; margin: 0; }
.key-takeaways li { font-size: 15px; color: #92400E; padding-left: 20px; position: relative; margin-bottom: 10px; }
.key-takeaways li::before { content: "\2713"; position: absolute; left: 0; color: #F59E0B; font-weight: bold; }

/* ----- Checklist ----- */
.checklist { background: var(--white); border: 1px solid var(--gray-200); border-radius: 12px; padding: 24px; margin: 24px 0; }
.checklist h3 { font-size: 18px; font-weight: 600; color: var(--navy); margin-bottom: 16px; }
.checklist ul { list-style: none; padding: 0; margin: 0; }
.checklist li { font-size: 15px; line-height: 1.8; color: var(--text); padding-left: 24px; position: relative; }
.checklist li::before { content: "\2610"; position: absolute; left: 0; color: var(--orange); font-weight: bold; }

/* ----- FAQ (current system: .faq-section > .faq-item) -----
   Legacy A01 system (.blog-faq > .faq-question/.faq-answer) is aliased
   below so the rendered FAQ box is visually identical. */
.faq-section, .blog-faq {
  background: var(--gray-light);
  border-radius: 12px;
  padding: 32px;
  margin: 40px 0;
}
.faq-section h2, .blog-faq h2 { font-size: 24px; margin-bottom: 24px; color: var(--navy); }

.faq-item { border-bottom: 1px solid var(--gray-200); padding: 16px 0; }
.faq-item:first-child { border-top: none; }

.faq-question {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-question::after { content: "+"; font-size: 20px; color: var(--orange); }
.faq-question[aria-expanded="true"]::after { content: "-"; }

.faq-answer { display: none; max-height: 0; overflow: hidden; }
.faq-answer.visible { display: block; max-height: 600px; padding-top: 12px; }
.faq-answer p { font-size: 15px; line-height: 1.6; color: var(--text); margin: 0; }

/* Legacy A01 FAQ question/answer override — flatten the old boxed accordion
   into the unified divider style so A01 matches A02/A03/A04. */
.blog-faq .faq-question {
  background: none;
  border: none;
  border-radius: 0;
  padding: 16px 0;
  margin-bottom: 0;
}
.blog-faq .faq-question:hover { background: none; border-color: transparent; }
.blog-faq .faq-question[aria-expanded="true"] { background: none; color: var(--navy); border-color: transparent; }
.blog-faq .faq-answer {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0 0 12px;
  margin-bottom: 0;
}

/* ----- Related Articles -----
   Pipeline output: <section class="blog-section"> (h2 + ul).
   Legacy A01 output: <div class="blog-related"> (h3 + ul).
   Both are unified into the same clean link-chip box. */
.blog-related {
  background: var(--gray-light);
  border-radius: 12px;
  padding: 28px 32px;
  margin: 40px 0;
}
.blog-related h2, .blog-related h3 { font-size: 22px; margin-bottom: 20px; color: var(--navy); }
.blog-related ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.blog-related a, .blog-section > ul > li > a {
  display: inline-block;
  padding: 8px 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  font-size: 14px;
  color: var(--navy);
  text-decoration: none;
  transition: all 0.2s;
}
.blog-related a:hover, .blog-section > ul > li > a:hover {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
}

/* ----- Final CTA (the ONLY full CTA card) -----
   Compact padding; bottom margin is the sole contributor to the
   Final CTA -> Footer gap (article padding-bottom is 0, main has no
   extra bottom padding) => effective gap ~64px desktop. */
.blog-cta {
  background: linear-gradient(135deg, var(--navy) 0%, #1E293B 100%);
  color: var(--white);
  padding: 40px 32px;
  border-radius: 16px;
  text-align: center;
  margin: 0 0 64px;
}
.blog-cta h3 { font-size: 24px; font-weight: 300; margin-bottom: 16px; }
.blog-cta p { font-size: 16px; opacity: 0.9; margin-bottom: 24px; max-width: 500px; margin-left: auto; margin-right: auto; }
.blog-cta__btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.blog-cta .btn-primary { background: var(--orange); color: var(--white); padding: 14px 28px; border-radius: 8px; font-weight: 600; text-decoration: none; display: inline-block; transition: all 0.2s; }
.blog-cta .btn-primary:hover { background: #D97706; transform: translateY(-1px); }
.blog-cta .btn-whatsapp { background: #25D366; color: var(--white); padding: 14px 28px; border-radius: 8px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: all 0.2s; }
.blog-cta .btn-whatsapp:hover { background: #20BD5A; transform: translateY(-1px); }
.blog-cta .btn-whatsapp svg { width: 20px; height: 20px; fill: currentColor; }

/* ----- Inline Contextual CTA (middle of article) -----
   Lightweight advisory tip, NOT an ad banner. One link, no buttons,
   no WhatsApp. Sits in the content flow, well before the Final CTA. */
.blog-inline-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--gray-50, #F8FAFC);
  border-left: 4px solid var(--orange, #E65100);
  border-radius: 10px;
  padding: 22px 24px;
  margin: 40px 0;
}
.blog-inline-cta__content { flex: 1 1 320px; min-width: 260px; }
.blog-inline-cta__content strong { display: block; font-size: 16px; font-weight: 600; color: var(--navy, #0F172A); margin-bottom: 8px; line-height: 1.4; }
.blog-inline-cta__content p { font-size: 14px; line-height: 1.6; color: var(--gray-600, #475569); margin: 0; }
.blog-inline-cta__link { flex: 0 0 auto; background: var(--orange, #E65100); color: var(--white, #FFFFFF); text-decoration: none; font-weight: 600; font-size: 14px; padding: 12px 20px; border-radius: 8px; white-space: nowrap; transition: all .2s; }
.blog-inline-cta__link:hover { background: #CC4600; transform: translateY(-1px); }

/* ----- Mobile ----- */
@media (max-width: 768px) {
  .blog-article { padding: 32px 16px 0; }
  .blog-cta { margin-bottom: 48px; }     /* tighter Final CTA -> Footer gap on mobile */
  .faq-section, .blog-faq, .blog-related { padding: 24px 20px; }
}
@media (max-width: 600px) {
  .blog-cta { padding: 28px 20px; }
  .blog-cta__btns { flex-direction: column; align-items: center; }
  .blog-inline-cta { flex-direction: column; align-items: stretch; }
  .blog-inline-cta__link { width: 100%; text-align: center; }
  .blog-related ul { flex-direction: column; }
}
