/* Article media and tables share one recipe in the writer, preview and public reader. */
:is(.editorial-body, .admin-rich-text-body) img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-block: 20px;
  border-radius: var(--ec-radius-control);
}
.editorial-image {
  display: block;
  margin-block: 24px;
}
.editorial-image img {
  margin-block: 0;
}
.editorial-image-caption {
  display: block;
  margin-top: 10px;
  color: var(--ec-muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}
.editorial-table-scroll,
.admin-rich-text-body .tableWrapper {
  max-width: 100%;
  overflow-x: auto;
  margin-block: 24px;
}
.editorial-table-scroll:focus-visible {
  outline: 2px solid var(--ec-plum);
  outline-offset: 3px;
}
.editorial-body .editorial-table-scroll > table {
  display: table;
  overflow: visible;
}
:is(.editorial-body, .admin-rich-text-body) table {
  width: 100%;
  min-width: 320px;
  border-collapse: collapse;
  margin-block: 20px;
  font-size: 14px;
}
:is(.editorial-body, .admin-rich-text-body) :is(th, td) {
  position: relative;
  min-width: 100px;
  padding: 12px 16px;
  border: 1px solid var(--ec-border);
  text-align: left;
  vertical-align: top;
  white-space: normal;
}
:is(.editorial-body, .admin-rich-text-body) th {
  background: var(--ec-cream);
  font-weight: 700;
  color: var(--ec-plum);
}
:is(.editorial-body, .admin-rich-text-body) :is(th, td) p {
  margin: 0;
}
:is(.editorial-body, .admin-rich-text-body) :is(th, td) p + p {
  margin-top: 8px;
}
:is(.editorial-body, .admin-rich-text-body) hr {
  margin-block: 28px;
  border: 0;
  border-top: 1px solid var(--ec-border);
}
:is(.editorial-body, .admin-rich-text-body) :not(pre) > code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--ec-subtle);
  font-size: 0.9em;
}
.admin-rich-text-body img.ProseMirror-selectednode {
  outline: 3px solid var(--ec-plum);
  outline-offset: 3px;
}
.admin-rich-text-body .selectedCell::after {
  position: absolute;
  inset: 0;
  content: '';
  pointer-events: none;
  background: color-mix(in srgb, var(--ec-lilac) 35%, transparent);
}

.editorial-direct-answer,
.editorial-takeaways {
  padding: 24px;
  border: 1px solid var(--ec-border);
  background: var(--ec-cream);
  border-radius: 12px;
  margin-bottom: 28px;
}
.editorial-direct-answer h2,
.editorial-takeaways h2 {
  font-size: 18px;
  font-weight: 650;
  margin-bottom: 12px;
}
.editorial-hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px;
  background: linear-gradient(130deg, var(--ec-cream), var(--ec-white));
  border: 1px solid var(--ec-border);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 28px;
}
.editorial-hero-stats div {
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
}
.editorial-hero-stats dd {
  font-size: 30px;
  font-weight: 650;
}
.editorial-hero-stats dt {
  font-size: 13px;
  color: var(--ec-muted);
}
.editorial-steps,
.editorial-references,
.editorial-faq {
  margin-top: 36px;
}
.editorial-steps h2,
.editorial-references h2,
.editorial-faq h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 16px;
}
.editorial-steps ol,
.editorial-references ul {
  padding-inline-start: 24px;
  list-style: decimal;
}
.editorial-steps li {
  margin: 18px 0;
}
.editorial-steps h3 {
  font-weight: 600;
}
.editorial-references ul {
  list-style: disc;
}
.editorial-references a {
  text-decoration: underline;
}
.editorial-faq details {
  border-bottom: 1px solid var(--ec-border);
  padding: 18px 0;
}
.editorial-faq summary {
  font-weight: 600;
  cursor: pointer;
}
.editorial-faq .editorial-body {
  padding-top: 14px;
}

/* Practical guides: a navigable plan, numbered instructions and working checklists. */
.guide-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 760px);
  justify-content: center;
  align-items: start;
  gap: clamp(24px, 5vw, 72px);
  overflow-wrap: anywhere;
}
.guide-contents {
  position: sticky;
  top: 110px;
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-control);
  background: var(--ec-cream);
  max-height: calc(100dvh - 140px);
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
}
.guide-contents h2 {
  font-size: 16px;
  font-weight: 650;
  color: var(--ec-plum);
}
.guide-contents ol {
  display: grid;
  gap: 12px;
  list-style: decimal;
  padding-left: 20px;
}
.guide-contents a:hover {
  text-decoration: underline;
}
.guide-layout a:focus-visible,
.guide-checklist input:focus-visible {
  outline: 2px solid var(--ec-plum);
  outline-offset: 4px;
}
.guide-reading {
  min-width: 0;
}
.guide-reading > section,
.guide-step,
#guide-resources {
  scroll-margin-top: 110px;
}
.guide-overview {
  padding: clamp(22px, 4vw, 36px);
  background: var(--ec-cream);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-control);
  margin-bottom: 32px;
}
.guide-eyebrow {
  display: block;
  color: var(--ec-plum);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}
.guide-reading h2 {
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.3;
  font-weight: 600;
  color: var(--ec-plum);
  margin: 0 0 16px;
}
.guide-outcome {
  font-size: 18px;
  line-height: 1.7;
}
.guide-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  border-top: 1px solid var(--ec-border);
  padding-top: 24px;
  margin-top: 24px;
}
.guide-facts dt {
  color: var(--ec-muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.guide-facts dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 600;
}
.guide-preparation {
  padding-block: 24px;
  line-height: 1.8;
}
.guide-preparation ul {
  list-style: disc;
  padding-left: 24px;
  margin-top: 16px;
}
.guide-step {
  padding-block: 36px;
  border-top: 1px solid var(--ec-border);
}
.guide-step-heading {
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.guide-step-heading > span {
  color: var(--ec-plum);
  background: var(--ec-subtle);
  border-radius: var(--ec-radius-control);
  padding: 8px 12px;
  font-size: 18px;
  font-weight: 600;
}
.guide-tip {
  padding: 20px 24px;
  margin-block: 24px;
  border-left: 3px solid var(--ec-plum);
  background: var(--ec-cream);
  line-height: 1.7;
  font-size: 14px;
}
.guide-tip strong {
  color: var(--ec-plum);
}
.guide-tip p {
  margin-top: 6px;
}
.guide-checklist {
  border: 0;
  min-width: 0;
  margin-top: 24px;
}
.guide-checklist legend {
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 12px;
}
.guide-checklist label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ec-border);
  font-size: 14px;
  line-height: 1.7;
  cursor: pointer;
}
.guide-checklist input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  flex: 0 0 auto;
  accent-color: var(--ec-plum);
}
.guide-checklist input:checked + span {
  text-decoration: line-through;
  color: var(--ec-muted);
}
.guide-completion {
  padding: 28px;
  background: var(--ec-cream);
  border-radius: var(--ec-radius-control);
}
.guide-completion > p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ec-muted);
}
.admin-guide-fields {
  display: grid;
  gap: 24px;
}
.admin-guide-fields .admin-repeat-block {
  min-width: 0;
}
:is(.admin-editorial-preview, .admin-article-preview) .guide-layout {
  grid-template-columns: minmax(0, 1fr);
}
:is(.admin-editorial-preview, .admin-article-preview) .guide-contents {
  position: static;
  max-height: none;
}
@media (max-width: 760px) {
  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .guide-contents {
    position: static;
    max-height: none;
  }
  .guide-facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

.guide-reading .editorial-body {
  font-size: 16px;
  line-height: 1.9;
}
.guide-reading .editorial-body p {
  margin-block: 16px;
}
.guide-reading .editorial-body :is(h3, h4) {
  color: var(--ec-plum);
  font-size: 20px;
  margin-block: 24px 12px;
}
.guide-reading .editorial-body :is(ul, ol) {
  padding-left: 24px;
  list-style: revert;
  margin-block: 20px;
}
.guide-reading .editorial-body blockquote {
  padding: 20px;
  margin-block: 24px;
  border-left: 3px solid var(--ec-plum);
  background: var(--ec-cream);
}
.guide-reading .editorial-body a {
  color: var(--ec-plum);
  text-decoration: underline;
}
.guide-reading .editorial-body strong {
  font-weight: 700;
}
.guide-reading .editorial-body pre {
  overflow-x: auto;
  padding: 20px;
  margin-block: 20px;
  border-radius: var(--ec-radius-control);
  background: var(--ec-subtle);
}
