/**
 * Blog article body: block-editor content styled to the original Manus article
 * design. Front end: <article class="rox-post-body"> in single.php. Editor: the
 * same rules apply inside .editor-styles-wrapper, so posts look like the site
 * while they are written.
 *
 * Top-level vertical rhythm must stay in step with DEF in
 * scripts/blog-migration/converter.js — imported blocks only carry an explicit
 * margin where these defaults would not reproduce the original gap. Adjacent
 * margins collapse, so the gap between two blocks is the larger of the two.
 */

/* --- Flow: spacing (kept at low, equal specificity; :first-child wins last) - */
:is(.rox-post-body, .editor-styles-wrapper .is-root-container) > p { margin: 0 0 20px; }
:is(.rox-post-body, .editor-styles-wrapper .is-root-container) > h2 { margin: 48px 0 20px; }
:is(.rox-post-body, .editor-styles-wrapper .is-root-container) > .wp-block-quote { margin: 48px 0; }
:is(.rox-post-body, .editor-styles-wrapper .is-root-container) > .wp-block-table,
:is(.rox-post-body, .editor-styles-wrapper .is-root-container) > .wp-block-group,
:is(.rox-post-body, .editor-styles-wrapper .is-root-container) > .wp-block-columns { margin: 28px 0 48px; }
:is(.rox-post-body, .editor-styles-wrapper .is-root-container) > .is-style-rox-sources { margin: 0; }
:is(.rox-post-body, .editor-styles-wrapper .is-root-container) > .is-style-rox-disclaimer { margin: 36px 0 0; }
:is(.rox-post-body, .editor-styles-wrapper .is-root-container) > :first-child { margin-top: 0; }

/* --- Flow: typography ----------------------------------------------------- */
:is(.rox-post-body, .editor-styles-wrapper) { font-family: Inter, sans-serif; }
:is(.rox-post-body, .editor-styles-wrapper .is-root-container) > p {
  font-size: 17px; color: rgb(71, 85, 105); line-height: 1.85;
}
:is(.rox-post-body, .editor-styles-wrapper .is-root-container) > h2 {
  font-size: clamp(24px, 3vw, 36px); font-weight: 800; color: rgb(11, 19, 32); letter-spacing: -0.03em;
}
:is(.rox-post-body, .editor-styles-wrapper) p a { color: rgb(11, 19, 32); font-weight: 700; text-decoration: none; }
:is(.rox-post-body, .editor-styles-wrapper) strong { color: rgb(11, 19, 32); }

:is(.rox-post-body, .editor-styles-wrapper) p.is-style-rox-disclaimer {
  font-size: 13px; color: rgb(148, 163, 184); line-height: 1.65; font-style: italic;
  border-top: 1px solid rgb(226, 232, 240); padding-top: 24px;
}

/* --- Pull quote ------------------------------------------------------------- */
:is(.rox-post-body, .editor-styles-wrapper) .wp-block-quote:is(.is-style-rox-pull, .is-style-rox-pull-lg) {
  border-left: 4px solid rgb(24, 209, 237); padding: 0 0 0 28px;
  font-size: 19px; color: rgb(11, 19, 32); font-style: italic; line-height: 1.65; font-weight: 500;
}
:is(.rox-post-body, .editor-styles-wrapper) .wp-block-quote.is-style-rox-pull-lg { font-size: 20px; }
:is(.rox-post-body, .editor-styles-wrapper) .wp-block-quote:is(.is-style-rox-pull, .is-style-rox-pull-lg) p {
  font: inherit; color: inherit; letter-spacing: inherit; margin: 0;
}

/* --- Table ------------------------------------------------------------------ */
:is(.rox-post-body, .editor-styles-wrapper) .wp-block-table.is-style-rox-table { overflow-x: auto; }
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-table table { width: 100%; border-collapse: collapse; font-family: Inter, sans-serif; table-layout: auto; }
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-table thead { border-bottom: 0; }
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-table thead tr { background-color: rgb(11, 19, 32); }
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-table th {
  padding: 14px 18px; text-align: left; font-size: 12px; font-weight: 700; color: rgb(24, 209, 237);
  letter-spacing: 0.08em; text-transform: uppercase; border: 0;
}
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-table tbody tr { background-color: white; border-bottom: 1px solid rgb(226, 232, 240); }
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-table tbody tr:nth-child(odd) { background-color: rgb(248, 250, 252); }
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-table td {
  padding: 14px 18px; font-size: 14px; color: rgb(71, 85, 105); font-weight: 400; line-height: 1.55; border: 0;
}
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-table td:first-child { color: rgb(11, 19, 32); font-weight: 700; }

/* --- Labels (the small uppercase line that heads a component) -------------- */
:is(.rox-post-body, .editor-styles-wrapper) p.is-style-rox-label { text-transform: uppercase; color: rgb(24, 209, 237); }

/* --- Bottom line / Note callouts ------------------------------------------- */
:is(.rox-post-body, .editor-styles-wrapper) .wp-block-group.is-style-rox-bottom-line {
  background-color: rgb(240, 250, 251); border: 2px solid rgb(24, 209, 237); border-radius: 10px; padding: 28px 32px;
}
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-bottom-line > p.is-style-rox-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; margin: 0 0 14px;
}
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-bottom-line > p:not(.is-style-rox-label) {
  font-size: 16px; color: rgb(11, 19, 32); line-height: 1.7; margin: 0; font-weight: 500;
}
:is(.rox-post-body, .editor-styles-wrapper) .wp-block-group.is-style-rox-note {
  border-left: 4px solid rgb(24, 209, 237); background-color: rgb(248, 250, 252); padding: 24px 28px;
}
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-note > p.is-style-rox-label {
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em; margin: 0 0 10px;
}
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-note > p:not(.is-style-rox-label) {
  font-size: 17px; color: rgb(11, 19, 32); line-height: 1.85; margin: 0;
}

/* --- Card stack + checklist cards ------------------------------------------- */
:is(.rox-post-body, .editor-styles-wrapper) .wp-block-group.is-style-rox-stack { display: flex; flex-direction: column; gap: 16px; }
:is(.rox-post-body, .editor-styles-wrapper) .wp-block-group.is-style-rox-checklist {
  background-color: rgb(248, 250, 252); border-radius: 10px; border: 1px solid rgb(226, 232, 240); padding: 24px 28px; margin: 0;
}
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-checklist > p.is-style-rox-label {
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; margin: 0 0 14px;
}
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-checklist > ul { margin: 0; padding-left: 20px; }
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-checklist > ul > li {
  font-size: 15px; color: rgb(71, 85, 105); line-height: 1.7; margin-bottom: 6px;
}

/* --- Numbered steps (numbers are generated, so steps can be added/reordered) */
:is(.rox-post-body, .editor-styles-wrapper) .wp-block-group:is(.is-style-rox-steps, .is-style-rox-steps-muted) {
  display: flex; flex-direction: column; gap: 16px; counter-reset: rox-step;
}
:is(.rox-post-body, .editor-styles-wrapper) .wp-block-group.is-style-rox-steps-muted { gap: 20px; }
:is(.rox-post-body, .editor-styles-wrapper) :is(.is-style-rox-steps, .is-style-rox-steps-muted) > .wp-block-group {
  display: grid; grid-template-columns: auto 1fr; column-gap: 20px; align-items: start; margin: 0;
  padding: 24px; background-color: rgb(248, 250, 252); border-radius: 10px; border: 1px solid rgb(226, 232, 240);
  counter-increment: rox-step;
}
:is(.rox-post-body, .editor-styles-wrapper) :is(.is-style-rox-steps, .is-style-rox-steps-muted) > .wp-block-group::before {
  content: counter(rox-step, decimal-leading-zero); grid-row: 1 / span 2;
  font-size: 28px; font-weight: 900; color: rgba(24, 209, 237, 0.3); line-height: 1; letter-spacing: -0.04em; min-width: 48px;
}
:is(.rox-post-body, .editor-styles-wrapper) :is(.is-style-rox-steps, .is-style-rox-steps-muted) > .wp-block-group > p { grid-column: 2; margin: 0; }
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-steps > .wp-block-group > p:first-of-type {
  font-size: 15px; font-weight: 700; color: rgb(11, 19, 32); margin-bottom: 8px; line-height: 1.4;
}
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-steps > .wp-block-group > p:nth-of-type(2) {
  font-size: 14px; color: rgb(100, 116, 139); line-height: 1.65;
}
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-steps-muted > .wp-block-group { column-gap: 24px; }
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-steps-muted > .wp-block-group::before {
  font-size: 24px; color: rgb(226, 232, 240); min-width: 40px;
}
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-steps-muted > .wp-block-group > p:first-of-type {
  font-size: 16px; font-weight: 700; color: rgb(11, 19, 32); margin-bottom: 8px;
}
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-steps-muted > .wp-block-group > p:nth-of-type(2) {
  font-size: 15px; color: rgb(100, 116, 139); line-height: 1.7;
}

/* --- Columns: comparison + card grid ---------------------------------------- */
:is(.rox-post-body, .editor-styles-wrapper) .wp-block-columns:is(.is-style-rox-compare, .is-style-rox-cards) { display: grid; }
:is(.rox-post-body, .editor-styles-wrapper) .wp-block-columns.is-style-rox-compare { grid-template-columns: 1fr 1fr; gap: 24px; }
:is(.rox-post-body, .editor-styles-wrapper) .wp-block-columns.is-style-rox-cards { grid-template-columns: repeat(3, 1fr); gap: 20px; }
:is(.rox-post-body, .editor-styles-wrapper) :is(.is-style-rox-compare, .is-style-rox-cards) > .wp-block-column {
  margin: 0; min-width: 0; word-break: normal; overflow-wrap: normal;
}
:is(.rox-post-body, .editor-styles-wrapper) :is(.is-style-rox-compare, .is-style-rox-cards) > .wp-block-column > .wp-block-group { height: 100%; margin: 0; }

:is(.rox-post-body, .editor-styles-wrapper) .wp-block-group:is(.is-style-rox-changed, .is-style-rox-unchanged) { border-radius: 10px; padding: 28px; }
:is(.rox-post-body, .editor-styles-wrapper) .wp-block-group.is-style-rox-changed { background-color: rgb(255, 241, 242); }
:is(.rox-post-body, .editor-styles-wrapper) .wp-block-group.is-style-rox-unchanged { background-color: rgb(240, 253, 244); }
:is(.rox-post-body, .editor-styles-wrapper) :is(.is-style-rox-changed, .is-style-rox-unchanged) > p.is-style-rox-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em; margin: 0 0 16px;
}
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-changed > p.is-style-rox-label { color: rgb(220, 38, 38); }
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-unchanged > p.is-style-rox-label { color: rgb(22, 163, 74); }
:is(.rox-post-body, .editor-styles-wrapper) :is(.is-style-rox-changed, .is-style-rox-unchanged) > ul { margin: 0; padding: 0; list-style: none; }
:is(.rox-post-body, .editor-styles-wrapper) :is(.is-style-rox-changed, .is-style-rox-unchanged) > ul > li {
  display: flex; gap: 12px; margin-bottom: 12px; align-items: flex-start;
  font-size: 14px; color: rgb(71, 85, 105); line-height: 1.6;
}
:is(.rox-post-body, .editor-styles-wrapper) :is(.is-style-rox-changed, .is-style-rox-unchanged) > ul > li::before {
  font-weight: 700; font-size: 16px; flex-shrink: 0; line-height: 1.4;
}
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-changed > ul > li::before { content: "✕"; color: rgb(220, 38, 38); }
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-unchanged > ul > li::before { content: "✓"; color: rgb(22, 163, 74); }

:is(.rox-post-body, .editor-styles-wrapper) .wp-block-group.is-style-rox-card {
  background-color: rgb(248, 250, 252); border-radius: 10px; padding: 24px; border: 1px solid rgb(226, 232, 240);
}
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-card > p.is-style-rox-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em; margin: 0 0 16px;
}
:is(.rox-post-body, .editor-styles-wrapper) ul.is-style-rox-dots { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
:is(.rox-post-body, .editor-styles-wrapper) ul.is-style-rox-dots > li {
  display: flex; gap: 10px; align-items: flex-start; margin: 0;
  font-size: 13px; color: rgb(71, 85, 105); line-height: 1.55;
}
:is(.rox-post-body, .editor-styles-wrapper) ul.is-style-rox-dots > li::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background-color: rgb(24, 209, 237); flex-shrink: 0; margin-top: 7px;
}

/* --- Sources ---------------------------------------------------------------- */
:is(.rox-post-body, .editor-styles-wrapper) .wp-block-group.is-style-rox-sources { border-top: 1px solid rgb(226, 232, 240); padding-top: 28px; }
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-sources > h2 {
  font-size: 24px; font-weight: 800; color: rgb(11, 19, 32); letter-spacing: -0.03em; margin: 0 0 18px;
}
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-sources > ol { padding-left: 20px; margin: 0; }
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-sources > ol > li {
  font-size: 14px; color: rgb(71, 85, 105); line-height: 1.85; margin-bottom: 12px;
}
:is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-sources a {
  color: rgb(11, 19, 32); text-decoration: underline; text-underline-offset: 3px; font-weight: inherit;
}

/* --- Mobile: matches how the original articles adapted (mobile.css) -------- */
@media (max-width: 860px) {
  :is(.rox-post-body, .editor-styles-wrapper) .wp-block-columns.is-style-rox-compare { gap: 10px; }
  :is(.rox-post-body, .editor-styles-wrapper) .is-style-rox-compare .wp-block-group:is(.is-style-rox-changed, .is-style-rox-unchanged) { padding: 16px 14px; }
  :is(.rox-post-body, .editor-styles-wrapper) .wp-block-columns.is-style-rox-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  /* mobile.css tightened 20px column gaps (Montgomery's steps) to 12px. */
  :is(.rox-post-body, .editor-styles-wrapper) .wp-block-group.is-style-rox-steps-muted { gap: 12px; }
}
