/* public/css/article.css — styles for the /learn articles.
   Loaded after onboarding.css and legal.css, which supply the page shell,
   header/footer and base long-form typography (.legal-page). */

/* The body is a flex column, so a child with auto side margins would
   shrink-wrap to its content instead of filling the 720px column. */
.article-page {
  width: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ── Typography ───────────────────────────────────────────────────────────── */

.article-page h1 {
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.article-page h2 {
  font-size: 1.375rem;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: 1rem;
}

.article-page h3 {
  font-size: 1.0625rem;
  margin: 1.5rem 0 0.4rem;
}

.article-page p,
.article-page li {
  font-size: 1.0625rem;
  line-height: 1.7;
}

.article-page p {
  margin-bottom: 1rem;
}

.article-page a {
  color: #0057b8;
}
.article-page a:hover {
  color: #003d82;
}

/* ── Header block ─────────────────────────────────────────────────────────── */

.article-page .article-eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3b5bdb;
  margin-bottom: 0.5rem;
}

.article-page .article-meta {
  font-size: 0.875rem;
  color: #555;
  margin-bottom: 1.25rem;
}

.article-page .article-lede {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: #1a1a2e;
}

.article-page .article-disclosure {
  font-size: 0.9375rem;
  color: #444;
  border-left: 3px solid #c7d2fe;
  padding-left: 0.875rem;
}

/* ── Short-answer callout and table of contents ───────────────────────────── */

.article-callout {
  background: #f0f6ff;
  border: 1px solid #c7d2fe;
  border-left: 4px solid #3b5bdb;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.article-page .article-callout h2 {
  font-size: 1.0625rem;
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.article-callout p:last-child {
  margin-bottom: 0;
}

.article-toc {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 0;
}

.article-page .article-toc h2 {
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.article-toc ol {
  padding-left: 1.25rem;
  margin: 0;
}

.article-page .article-toc li {
  font-size: 0.9375rem;
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */

.table-scroll {
  overflow-x: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin: 1.25rem 0 1.5rem;
}

.table-scroll:focus-visible {
  outline: 2px solid #3b5bdb;
  outline-offset: 2px;
}

.data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.data-table caption {
  text-align: left;
  font-weight: 700;
  padding: 0.75rem 1rem;
  color: #1a1a2e;
}

.data-table th,
.data-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e5e7eb;
  line-height: 1.5;
  color: #333;
}

.data-table thead th {
  background: #f4f6f9;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1a1a2e;
}

.data-table tbody th {
  font-weight: 600;
  color: #1a1a2e;
}

/* ── Sample text conversation ─────────────────────────────────────────────── */

.sms-figure {
  margin: 1.5rem 0;
}

.article-page .sms-thread {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 440px;
  margin: 0 auto;
  padding: 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
}

.article-page .sms-thread .sms {
  max-width: 88%;
  margin: 0;
  padding: 0.55rem 0.85rem;
  border-radius: 18px;
  font-size: 0.9375rem;
  line-height: 1.4;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.article-page .sms-thread .sms--in {
  align-self: flex-start;
  background: #e9ecf3;
  color: #1a1a2e;
  border-bottom-left-radius: 6px;
}

.article-page .sms-thread .sms--out {
  align-self: flex-end;
  background: #3b5bdb;
  color: #fff;
  border-bottom-right-radius: 6px;
}

.sms-figure figcaption {
  font-size: 0.875rem;
  color: #555;
  text-align: center;
  margin-top: 0.75rem;
  line-height: 1.5;
}

/* Screen-reader-only text (speaker labels in the sample conversation). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Steps ────────────────────────────────────────────────────────────────── */

.article-page ol.article-steps {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.article-page .article-steps li {
  margin-bottom: 0.75rem;
}

/* ── FAQ ──────────────────────────────────────────────────────────────────── */

.article-faq details {
  border-bottom: 1px solid #e5e7eb;
  padding: 0.75rem 0;
}

.article-faq details:last-of-type {
  border-bottom: none;
}

.article-faq summary {
  cursor: pointer;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.5;
}

.article-faq summary:focus-visible {
  outline: 2px solid #3b5bdb;
  outline-offset: 2px;
}

.article-page .article-faq details p {
  margin: 0.5rem 0 0.25rem;
  font-size: 1rem;
}

/* ── Call to action ───────────────────────────────────────────────────────── */

.article-cta {
  background: #1a1a2e;
  border-radius: 12px;
  padding: 1.75rem 1.5rem;
  margin: 2.5rem 0;
  text-align: center;
}

.article-page .article-cta h2 {
  color: #fff;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.article-page .article-cta p {
  color: #d6dbf5;
  margin-bottom: 1rem;
}

.article-page a.btn {
  color: #fff;
  text-decoration: none;
}

.article-cta .btn-primary {
  display: block;
  max-width: 260px;
  margin: 0 auto 1.25rem;
}

.article-page .article-cta .article-cta__links {
  font-size: 0.9375rem;
  margin-bottom: 0;
}

.article-page .article-cta__links a {
  color: #c7d2fe;
}
.article-page .article-cta__links a:hover {
  color: #fff;
}

/* ── Sources ──────────────────────────────────────────────────────────────── */

.article-page .article-sources li {
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* ── Small screens ────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .article-page h1 {
    font-size: 1.625rem;
  }
  .article-page h2 {
    font-size: 1.25rem;
  }
  .article-page .article-lede {
    font-size: 1.0625rem;
  }
}
