/* ==========================================================================
   Article (topic page) — single.php. Design-system tokens only.
   One readable column, left-aligned like every other section on the site.
   ========================================================================== */

.rg-article { padding-block: 40px var(--rg-section-y); }
.rg-article__wrap > * { max-width: 760px; }

/* ---- Head ---- */

.rg-article__title { margin: 0 0 16px; font-size: var(--rg-fs-h2-lg); line-height: var(--rg-lh-heading); }
.rg-article__byline { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 14px; font-size: var(--rg-fs-small); color: var(--rg-muted); }
.rg-article__byline a { color: var(--rg-green); }
.rg-article__evidence { margin: 0 0 34px; font-size: var(--rg-fs-small); line-height: var(--rg-lh-body); color: var(--rg-muted); }
.rg-article__evidence-tag { margin-right: 8px; }

/* ---- Body (block content) ---- */
.rg-article__body { font-size: var(--rg-fs-body); line-height: var(--rg-lh-body); color: var(--rg-green-deep); }
.rg-article__body > * { margin: 0 0 18px; }
.rg-article__body h2, .rg-article__h2 { margin: 44px 0 14px; font-size: var(--rg-fs-h3); line-height: var(--rg-lh-heading); color: var(--rg-green); }
.rg-article__body h3 { margin: 30px 0 10px; font-size: var(--rg-fs-h4); line-height: var(--rg-lh-heading); color: var(--rg-green-deep); }
.rg-article__body > p:first-child { font-size: var(--rg-fs-lead); }
.rg-article__body a { color: var(--rg-green); text-decoration: underline; text-underline-offset: 2px; }
.rg-article__body a:hover { color: var(--rg-green-deep); }
.rg-article__body ul, .rg-article__body ol { padding-left: 22px; }
.rg-article__body li { margin: 0 0 8px; }
.rg-article__body li::marker { color: var(--rg-green); }
.rg-article__more { font-size: var(--rg-fs-small); font-weight: var(--rg-fw-semibold); }
.rg-article__body .rg-article__more a { text-decoration: none; }

/* Tables scroll inside their own box on narrow screens (no page-wide scroll). */
.rg-article__table { margin: 0 0 22px; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rg-line); border-radius: var(--rg-radius-md); }
.rg-article__table table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: var(--rg-fs-small); line-height: var(--rg-lh-snug); }
.rg-article__table th, .rg-article__table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rg-line); }
.rg-article__table th { background: var(--rg-bg-soft); font-weight: var(--rg-fw-semibold); color: var(--rg-green); }
.rg-article__table tr:last-child td { border-bottom: 0; }

/* Status chips (Other conditions): palette only — strongest = darkest. */
.rg-status { display: inline-block; padding: 3px 10px; border-radius: var(--rg-radius-pill); font-weight: var(--rg-fw-semibold); }
.rg-status--yes   { background: rgba(var(--rg-green-rgb), .12); color: var(--rg-green); }
.rg-status--maybe { background: rgba(var(--rg-beige-rgb), .22); color: var(--rg-green-deep); }
.rg-status--no    { background: var(--rg-green-deep); color: var(--rg-white); }

/* ---- Callouts: risks, crisis line, emergency ---- */
.rg-callout { margin: 0 0 22px; padding: 18px 20px; border-radius: var(--rg-radius-md); border-left: 4px solid var(--rg-green); background: var(--rg-bg-soft); }
/* Classic themes wrap group content in .wp-block-group__inner-container. */
.rg-article__body .rg-callout > *:last-child,
.rg-article__body .rg-callout .wp-block-group__inner-container > *:last-child,
.rg-callout__text:last-child { margin-bottom: 0; }
.rg-callout__title,
.rg-article__body .rg-callout h2:first-child { margin: 0 0 8px; font-size: var(--rg-fs-lead); font-weight: var(--rg-fw-semibold); color: var(--rg-green); }
.rg-callout__text { margin: 0; font-size: var(--rg-fs-body); line-height: var(--rg-lh-body); color: var(--rg-green-deep); }
.rg-callout a { color: var(--rg-green); text-decoration: underline; text-underline-offset: 2px; }
.rg-callout--crisis { border-left-color: var(--rg-beige); background: rgba(var(--rg-beige-rgb), .14); }
.rg-callout--crisis .rg-callout__title { color: var(--rg-green-deep); }
.rg-callout--emergency { border-left-color: var(--rg-line); }
.rg-callout__numbers { margin-top: 8px; font-weight: var(--rg-fw-semibold); }
.rg-callout--emergency .rg-callout__title { font-size: var(--rg-fs-body); }
.rg-callout--emergency .rg-callout__text { font-size: var(--rg-fs-small); }
.rg-article__body .rg-callout--risk { margin-top: 34px; }

/* ---- Sources ---- */
.rg-article__sources { margin-top: 40px; }
.rg-article__h2-small { margin: 0 0 12px; font-size: var(--rg-fs-lead); color: var(--rg-green); }
.rg-article__source-list { margin: 0; padding-left: 20px; font-size: var(--rg-fs-small); line-height: var(--rg-lh-body); color: var(--rg-green-deep); }
.rg-article__source-list li { margin-bottom: 8px; }
.rg-article__source-list a { color: var(--rg-green); word-break: break-word; }

/* ---- FAQ (items reuse the homepage FAQ component) ---- */
.rg-article__faq { margin-top: 44px; }
.rg-article__faq-list { display: grid; gap: 12px; }

/* ---- Disclaimer ---- */
.rg-article__disclaimer { margin: 36px 0 0; padding-top: 18px; border-top: 1px solid var(--rg-line); font-size: var(--rg-fs-small); line-height: var(--rg-lh-body); color: var(--rg-muted); }

@media (max-width: 640px) {
  .rg-article { padding-top: 24px; }
  /* Status table → one card per row: condition, status chip, note. */
  .rg-article__table--stack { overflow: visible; border: 0; }
  .rg-article__table--stack table { min-width: 0; }
  .rg-article__table--stack thead { display: none; }
  .rg-article__table--stack tr { display: block; margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--rg-line); border-radius: var(--rg-radius-md); }
  .rg-article__table--stack td { display: block; padding: 0; border: 0; }
  .rg-article__table--stack td + td { margin-top: 8px; }
  .rg-article__table--stack tr:last-child td { border-bottom: 0; }
  .rg-callout { padding: 16px; }
}

/* Button inside the article text: not an inline link */
.rg-article__body .rg-btn, .rg-article__body .rg-btn:hover { color: var(--rg-white); text-decoration: none; }
.rg-article__body .rg-section-cta { margin: 24px 0; }

/* Country guide: clinic cards in the reading column */
.rg-article__wrap .rg-guide__clinics { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin: 18px 0 16px; }
.rg-article__wrap .rg-guide__clinics:has(> :nth-child(3)) { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } /* three cards in one row */
.rg-guide__note { margin: 0 0 22px; }

/* Tables in page/article text (e.g. the plans on /for-clinics/). Scrolls sideways on small phones. */
.rg-article__body .wp-block-table { margin: 0 0 18px; overflow-x: auto; }
.rg-article__body table { width: 100%; border-collapse: collapse; background: var(--rg-white); border-radius: var(--rg-radius-md); overflow: hidden; font-size: var(--rg-fs-small); }
.rg-article__body th, .rg-article__body td { padding: 12px 16px; border-bottom: 1px solid var(--rg-line); text-align: left; vertical-align: top; }
.rg-article__body thead th { background: var(--rg-green); color: var(--rg-white); font-weight: var(--rg-fw-semibold); }
.rg-article__body tbody tr:last-child td { border-bottom: 0; }
.rg-article__body td:not(:first-child), .rg-article__body th:not(:first-child) { text-align: center; }
@media (max-width: 560px) {
  .rg-article__body table { font-size: var(--rg-fs-badge); }
  .rg-article__body th, .rg-article__body td { padding: 9px 6px; overflow-wrap: break-word; }
  .rg-article__body td:first-child { width: 36%; }
}
/* Two-column tables (name | description), e.g. concierge packages: text stays left-aligned. */
.rg-article__body .rg-table-2col td, .rg-article__body .rg-table-2col th { text-align: left; }
.rg-article__body .rg-table-2col td:first-child { width: 30%; hyphens: manual; -webkit-hyphens: manual; }
@media (max-width: 560px) { .rg-article__body .rg-table-2col td:first-child { width: 36%; } }

/* Contact Form 7 in page text (the clinic listing request) — same look as the quiz form. */
.rg-article__body .wpcf7 { margin: 0 0 18px; padding: 28px 32px; background: var(--rg-white); border-radius: var(--rg-radius-card); }
.rg-article__body .wpcf7 p { margin: 0 0 14px; }
.rg-article__body .wpcf7 label { display: block; font-size: var(--rg-fs-small); font-weight: var(--rg-fw-semibold); color: var(--rg-green-deep); }
.rg-article__body .wpcf7 input[type="text"],
.rg-article__body .wpcf7 input[type="email"],
.rg-article__body .wpcf7 input[type="tel"],
.rg-article__body .wpcf7 input[type="url"],
.rg-article__body .wpcf7 textarea {
  width: 100%; margin-top: 6px; padding: 14px 18px;
  border: 1px solid rgba(var(--rg-green-rgb), .22); border-radius: var(--rg-radius-md);
  background: var(--rg-white); font: inherit; font-size: var(--rg-fs-body); color: var(--rg-green-deep);
}
.rg-article__body .wpcf7 textarea { min-height: 120px; }
.rg-article__body .wpcf7 input:focus, .rg-article__body .wpcf7 textarea:focus { outline: none; border-color: var(--rg-green); }
.rg-article__body .wpcf7 input[type="submit"] {
  min-height: 50px; padding: 0 28px; border: 0; border-radius: var(--rg-radius-btn); cursor: pointer;
  background: var(--rg-beige); color: var(--rg-white);
  font: inherit; font-size: var(--rg-fs-body); font-weight: var(--rg-fw-semibold);
}
.rg-article__body .wpcf7 input[type="submit"]:hover { background: var(--rg-beige-dark); }
.rg-article__body .wpcf7 .rg-form-note { font-size: var(--rg-fs-small); color: var(--rg-muted); }
@media (max-width: 720px) { .rg-article__body .wpcf7 { padding: 22px 18px; } }
