/* ============================================================
   UNIFIA — Article components (blog). Loaded on /blog/{slug}/ only.
   ============================================================ */

/* ---------- Reading rhythm ---------- */
.article-body { max-width: 740px; }
.article-body > p:first-child { font-size: 19px; line-height: 1.75; color: var(--dark); }
.article-body h2 { font-size: clamp(23px, 2.6vw, 29px); line-height: 1.25; margin: 52px 0 16px; scroll-margin-top: 100px; }
.article-body h3 { font-size: 20px; line-height: 1.3; margin: 32px 0 10px; letter-spacing: -.3px; }
.article-body ul:not([class]), .article-body ol:not([class]) { margin: 0 0 22px; padding-left: 0; }
.article-body ul:not([class]) li, .article-body ol:not([class]) li {
  position: relative; padding-left: 26px; margin-bottom: 10px; font-size: 17px; line-height: 1.7; color: var(--grey-700);
}
.article-body ul:not([class]) li::before {
  content: ''; position: absolute; left: 6px; top: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange);
}
.article-body ol:not([class]) { counter-reset: ol; }
.article-body ol:not([class]) li { counter-increment: ol; }
.article-body ol:not([class]) li::before {
  content: counter(ol) '.'; position: absolute; left: 0; top: 0; font-weight: 800; color: var(--orange);
}
.article-body strong { color: var(--dark); }
.article-body a:not(.link-animated):not(.btn-primary):not(.btn-outline-dark) {
  color: #C2410C; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.article-body a:not(.btn-primary):hover { color: var(--orange); }

/* ---------- Table of contents ---------- */
.article-toc { max-width: 740px; margin: 0 auto 40px; }
.article-toc details { background: var(--off-white); border-radius: var(--radius-lg); padding: 20px 24px; }
.article-toc summary {
  cursor: pointer; font-size: 13px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: var(--navy);
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.article-toc summary::-webkit-details-marker { display: none; }
.article-toc summary::after { content: '+'; font-size: 20px; color: var(--orange); transition: transform .2s; }
.article-toc details[open] summary::after { transform: rotate(45deg); }
.article-toc ol { margin: 14px 0 0; padding: 0; counter-reset: toc; }
.article-toc li { counter-increment: toc; padding: 6px 0 6px 30px; position: relative; font-size: 15.5px; line-height: 1.45; }
.article-toc li::before { content: counter(toc, decimal-leading-zero); position: absolute; left: 0; top: 7px; font-size: 12px; font-weight: 800; color: var(--orange); }
.article-toc a { color: var(--grey-800); font-weight: 500; }
.article-toc a:hover { color: var(--orange); }

/* ---------- Key answer / definition ---------- */
.article-answer {
  border-left: 4px solid var(--orange); background: #FFF7F4; border-radius: 0 var(--radius) var(--radius) 0;
  padding: 22px 26px; margin: 28px 0 32px;
}
.article-answer__label { display: block; font-size: 12px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: #C2410C; margin-bottom: 8px; }
.article-body .article-answer p { font-size: 17px; color: var(--dark); margin: 0; }
.article-body .article-answer p + p, .article-body .article-answer p + ol, .article-body .article-answer p + ul { margin-top: 10px; }
.article-answer ol, .article-answer ul { margin-bottom: 0 !important; }

.article-def { border: 1px solid var(--grey-200); border-radius: var(--radius); padding: 20px 24px; margin: 24px 0; }
.article-def dt { font-weight: 800; color: var(--dark); font-size: 17px; margin-bottom: 6px; }
.article-def dd { margin: 0; font-size: 16.5px; line-height: 1.7; color: var(--grey-700); }

/* ---------- Pull quote ---------- */
.article-quote {
  margin: 36px 0; padding: 0 0 0 24px; border-left: 3px solid var(--navy);
  font-size: 22px; line-height: 1.45; font-weight: 700; letter-spacing: -.3px; color: var(--navy);
}

/* ---------- Tables ---------- */
.article-table { margin: 26px 0 32px; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--grey-200); border-radius: var(--radius); }
.article-table table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.article-table th { background: var(--navy); color: var(--white); text-align: left; font-weight: 700; padding: 12px 16px; font-size: 14px; }
.article-table td { padding: 12px 16px; border-top: 1px solid var(--grey-200); vertical-align: top; line-height: 1.55; color: var(--grey-700); }
.article-table tr:nth-child(even) td { background: #FAFAF8; }
.article-table td:first-child { font-weight: 700; color: var(--dark); }
.article-table caption { caption-side: bottom; text-align: left; font-size: 13px; color: var(--grey-500); padding: 10px 16px; }

/* ---------- Checklist ---------- */
.article-checklist { margin: 22px 0 30px; padding: 0; display: grid; gap: 10px; }
.article-checklist li {
  position: relative; padding: 14px 16px 14px 52px; border: 1px solid var(--grey-200); border-radius: var(--radius);
  font-size: 16px; line-height: 1.55; color: var(--grey-800); background: var(--white);
}
.article-checklist li::before {
  content: ''; position: absolute; left: 16px; top: 15px; width: 22px; height: 22px; border-radius: 6px;
  background: var(--orange-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF4B1F' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.article-checklist li strong { display: block; margin-bottom: 2px; }
.article-checklist--q li::before { content: '?'; background: var(--navy); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; }

/* ---------- Numbered steps ---------- */
.article-steps { margin: 26px 0 32px; padding: 0; counter-reset: st; position: relative; }
.article-steps::before { content: ''; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px; background: var(--grey-200); }
.article-steps li { counter-increment: st; position: relative; padding: 0 0 22px 56px; }
.article-steps li::before {
  content: counter(st); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--orange); color: #fff; font-weight: 800; font-size: 14px; display: grid; place-items: center;
  box-shadow: 0 0 0 5px var(--white);
}
.article-steps li strong { display: block; font-size: 17.5px; color: var(--dark); margin: 5px 0 2px; }
.article-steps li span { display: block; font-size: 16px; line-height: 1.65; color: var(--grey-700); }

/* ---------- Info cards ---------- */
.article-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 24px 0 32px; }
.article-cards > div { border: 1px solid var(--grey-200); border-radius: var(--radius); padding: 20px; background: var(--white); }
.article-cards h3, .article-cards h4 { font-size: 17px !important; margin: 0 0 6px !important; }
.article-body .article-cards p { font-size: 15.5px; line-height: 1.6; margin: 0; }
.article-cards--dark > div { background: var(--navy); border-color: var(--navy); }
.article-cards--dark h3, .article-cards--dark h4 { color: #fff; }
.article-body .article-cards--dark p { color: rgba(255,255,255,.72); }

/* ---------- Figures ---------- */
.article-figure { margin: 32px 0 36px; }
.article-figure img { width: 100%; height: auto; border-radius: var(--radius-lg); background: var(--off-white); }
.article-figure figcaption { font-size: 14px; color: var(--grey-500); margin-top: 10px; line-height: 1.5; }

/* ---------- Inline soft CTA ---------- */
.article-cta {
  display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--navy); border-radius: var(--radius-lg); padding: 24px 26px; margin: 36px 0;
}
.article-body .article-cta p { color: rgba(255,255,255,.82); margin: 0; font-size: 16px; line-height: 1.6; flex: 1 1 320px; }
.article-cta p strong { color: #fff; }
.article-cta .btn-primary { flex-shrink: 0; }

/* ---------- Final CTA section ---------- */
.article-final-cta { padding: 0 0 90px; }
.faq-section + .article-final-cta { padding-top: 0; }
.article-final-cta__card {
  max-width: 1000px; margin: 0 auto; background: var(--navy); border-radius: var(--radius-xl);
  padding: 48px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; position: relative; overflow: hidden;
}
.article-final-cta__card::after {
  content: ''; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,75,31,.18), transparent 70%); pointer-events: none;
}
.article-final-cta .section-label { color: var(--orange); }
.article-final-cta h2 { color: #fff; font-size: clamp(26px, 3vw, 36px); margin-bottom: 14px; }
.article-final-cta p { color: rgba(255,255,255,.75); font-size: 17px; }
.article-final-cta__list { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; }
.article-final-cta__list li {
  font-size: 13px; font-weight: 600; color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 6px 12px;
}
.article-final-cta__actions { display: grid; gap: 14px; justify-items: start; position: relative; z-index: 1; }
.article-final-cta__actions .btn-primary { white-space: normal; text-align: center; justify-content: center; }
.article-final-cta__more { color: rgba(255,255,255,.85); font-weight: 600; font-size: 15px; border-bottom: 1px solid rgba(255,255,255,.35); padding-bottom: 2px; }
.article-final-cta__more:hover { color: var(--orange); border-color: var(--orange); }

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .article-body > p:first-child { font-size: 17.5px; }
  .article-body p, .article-body ul:not([class]) li, .article-body ol:not([class]) li { font-size: 16.5px; }
  .article-body h2 { margin-top: 42px; }
  .article-cover { margin-bottom: 28px; border-radius: var(--radius-lg); }
  .article-toc details { padding: 16px 18px; }
  .article-answer { padding: 18px 18px; }
  .article-quote { font-size: 19px; padding-left: 18px; }
  .article-cards { grid-template-columns: 1fr; }
  .article-cta { padding: 22px 20px; }
  .article-cta .btn-primary { width: 100%; justify-content: center; white-space: normal; text-align: center; }
  .article-final-cta { padding-bottom: 64px; }
  .article-final-cta__card { grid-template-columns: 1fr; padding: 32px 22px; gap: 26px; border-radius: var(--radius-lg); }
  .article-final-cta__actions, .article-final-cta__actions .btn-primary { width: 100%; }
  .article-final-cta__actions { justify-items: stretch; }
  .article-final-cta__more { justify-self: center; }
}

/* Tables → stacked cards on phones (no sideways scrolling) */
@media (max-width: 600px) {
  .article-table { border: 0; overflow: visible; }
  .article-table table { min-width: 0; }
  .article-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .article-table tr { display: block; border: 1px solid var(--grey-200); border-radius: var(--radius); padding: 6px 0; margin-bottom: 10px; background: var(--white); }
  .article-table tr:nth-child(even) td { background: transparent; }
  .article-table td { display: block; border: 0; padding: 6px 16px; font-size: 15px; }
  .article-table td:first-child { font-size: 16px; padding-top: 10px; }
  .article-table td:not(:first-child)[data-label]:not([data-label=""])::before {
    content: attr(data-label); display: block; font-size: 11.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #C2410C; margin-bottom: 2px;
  }
}

/* Tighter rhythm between the article and its FAQ */
article.section + .faq-section { padding-top: 24px; }
article.section:has(+ .faq-section) { padding-bottom: 40px; }

/* Buttons inside the article body: override style.css's
   `.article-body a:not(.link-animated)` (orange text), which otherwise
   makes the label invisible on the orange button. */
.article-body a.btn-primary,
.article-body a.btn-primary:hover,
.article-body a.btn-primary:focus-visible {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
}
