/* Reading surfaces and lists. Calculator templates do not load this sheet. */
.r8-editorial #main > .r8-content { margin-block: clamp(15px, 3vw, 34px) clamp(30px, 5vw, 64px); }
.r8-editorial .r8-editorial-prose {
  --reading: 49rem;
  box-sizing: border-box;
  width: min(57rem, calc(100% - 2rem));
  padding: clamp(16px, 4vw, 48px);
  border: 1px solid var(--tool-line);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--tool-shadow);
  font-size: clamp(1rem, 1.5vw, 1.075rem);
  line-height: 1.85;
}
.r8-editorial .r8-editorial-heading { padding-block-end: 16px; border-bottom: 1px solid var(--tool-line); }
.r8-editorial .r8-content h1 {
  color: var(--tool-green);
  font-size: clamp(1.65rem, 3.15vw, 2.65rem);
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: auto-phrase;
  text-wrap: balance;
}
.r8-editorial .r8-editorial-heading h1 { margin-block: 8px 12px; }
.r8-editorial #main > .r8-content > h1 {
  padding-block-end: 12px;
  border-color: var(--tool-line);
  background: none;
}
.r8-editorial #main > .r8-editorial-prose h2 {
  border-inline-start-color: var(--tool-green);
  background: var(--tool-soft);
  color: var(--tool-green);
}
.r8-editorial #main > .r8-editorial-prose h3 { border-color: var(--tool-line); color: var(--tool-ink); }
.r8-editorial .r8-content a:not(.r8-action) { color: var(--tool-green); }
.r8-editorial .r8-content :focus-visible { outline: 2px solid var(--tool-green); outline-offset: 3px; }
.r8-editorial .r8-editorial-prose :is(blockquote, .wp-block-pullquote, .r8-equation) {
  background: var(--tool-soft);
  border-color: var(--tool-green);
}
.r8-editorial .r8-editorial-prose :is(p, li, code, th, td) { overflow-wrap: anywhere; }
.r8-editorial .r8-editorial-prose :is(img, video, iframe, figure, pre, .scroll) { max-width: 100%; }
.r8-editorial .r8-editorial-prose :is(pre, .wp-block-table, .scroll) { overflow-x: auto; }
.r8-editorial .r8-editorial-prose table { width: 100%; max-width: 100%; }
.r8-editorial .r8-editorial-prose :is(table, .wp-block-table, .scroll) { border-color: var(--tool-line); }
.r8-editorial .r8-editorial-prose table thead th { background: var(--tool-soft); color: var(--tool-ink); }
.r8-editorial .r8-editorial-prose > .r8-column-cover img { aspect-ratio: auto; }
.r8-editorial .r8-content .r8-post-meta { color: var(--tool-muted); }
.r8-editorial .r8-column-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; color: var(--tool-muted); font-size: .8rem; }
.r8-editorial .r8-column-category { padding: 2px 9px; border-radius: 20px; background: var(--tool-soft); color: var(--tool-green); font-weight: 700; }
.r8-editorial .r8-editorial-heading > .r8-column-meta { margin-block: 0; }

.r8-editorial .r8-editorial-list > .r8-column-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 22px);
}
.r8-editorial .r8-column-grid .r8-column-card,
.r8-editorial .r8-adjacent-posts .r8-link-card,
.r8-editorial .r8-editorial-empty {
  padding: clamp(13px, 2vw, 22px);
  border: 1px solid var(--tool-line);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--tool-shadow);
}
.r8-editorial .r8-column-card .r8-column-meta { margin: 0 0 7px; }
.r8-editorial .r8-column-card h2 { overflow-wrap: anywhere; }
.r8-editorial :is(.r8-column-card, .r8-adjacent-posts) .r8-column-cover img { aspect-ratio: 16 / 9; border-radius: 8px; }
.r8-editorial .r8-adjacent-posts .r8-link-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.r8-editorial .r8-adjacent-posts .r8-column-cover { grid-column: 1 / -1; margin: 0; }
.r8-editorial .r8-column-navigation .r8-link-row { margin-top: 12px; }
.r8-editorial .r8-content :is(.r8-link-card, .r8-related) { border-color: var(--tool-line); }
.r8-editorial .r8-link-card:hover { background: var(--tool-soft); }
.r8-editorial .r8-link-card small { color: var(--tool-muted); }
.r8-editorial .r8-content .r8-action { background: #08744e; color: white; }
.r8-editorial .r8-content .r8-action:hover { background: var(--tool-green); }
.r8-editorial .r8-editorial-list .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: 3px;
  padding-inline: 8px;
  border: 1px solid var(--tool-line);
  border-radius: 9px;
  background: #fff;
  text-decoration: none;
}
.r8-editorial .r8-editorial-list .page-numbers.current { background: var(--tool-green); color: #fff; }
.r8-editorial .r8-editorial-list a.page-numbers:hover { background: var(--tool-soft); }
.r8-editorial .r8-editorial-empty p { margin-block: 5px; }

.r8-editorial #main > .r8-editorial-missing {
  box-sizing: border-box;
  width: min(44rem, calc(100% - 2rem));
  padding: clamp(20px, 5vw, 58px);
  border: 1px solid var(--tool-line);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--tool-shadow);
}
.r8-editorial .r8-editorial-missing .r8-editorial-status {
  margin: 0;
  color: var(--tool-green);
  font-size: clamp(2.65rem, 7vw, 5rem);
  font-weight: 850;
  line-height: 1.12;
}

@media (max-width: 900px) {
  .r8-editorial .r8-editorial-list > .r8-column-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
  .r8-editorial .r8-editorial-list > .r8-column-grid,
  .r8-editorial .r8-column-navigation :is(.r8-adjacent-posts, .r8-link-row) { grid-template-columns: minmax(0, 1fr); }
}

/* Full-width column articles; only the heading is split. */
.r8-editorial .r8-column-single { width: min(1180px, calc(100% - 48px)); --reading: 100%; padding: clamp(16px, 3vw, 32px); }
.r8-editorial .r8-column-single > * { min-width: 0; }
.r8-editorial .r8-column-heading-text { min-width: 0; }
.r8-editorial .r8-column-heading .r8-column-meta { margin-block: 0; }
.r8-editorial .r8-column-heading .r8-column-cover { margin: 0; min-width: 0; }
.r8-editorial .r8-column-heading .r8-column-cover img { width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; }
@media (min-width: 801px) {
  .r8-editorial .r8-column-heading.has-cover { display: grid; grid-template-columns: minmax(0, 65fr) minmax(0, 35fr); align-items: center; gap: 32px; }
}
@media (max-width: 800px) {
  .r8-editorial .r8-column-heading .r8-column-cover { margin-top: 16px; max-width: 480px; }
}
@media (max-width: 650px) {
   .r8-editorial #main > .r8-column-single {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding-inline: 16px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }
}

/* Article-only headings and compact navigation. */
.r8-editorial #main > .r8-column-single h2 { display:flex; align-items:baseline; gap:.65em; border:0; border-radius:0; background:none; padding:.25em 0 .55em; border-bottom:1px solid var(--tool-line); }
.r8-editorial #main > .r8-column-single h2::before { content:""; flex:0 0 .55em; height:.55em; background:var(--tool-green); border-radius:2px; transform:rotate(45deg); align-self:center; }
.r8-editorial .r8-column-navigation .r8-adjacent-posts { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.r8-editorial .r8-adjacent-posts .r8-link-card, .r8-editorial .r8-column-related .r8-link-card { display:flex; justify-content:flex-start; align-items:center; padding:12px; gap:12px; min-width:0; font-size:.95rem; line-height:1.55; box-shadow:none; }
.r8-editorial .r8-adjacent-posts .r8-column-cover, .r8-editorial .r8-column-related .r8-column-cover { flex:0 0 100px; width:100px; margin:0; }
.r8-editorial .r8-column-navigation .r8-column-cover img { display:block; width:100%; height:auto; aspect-ratio:3/2; object-fit:cover; border-radius:6px; }
.r8-editorial .r8-column-navigation .r8-link-card > span { flex:1; min-width:0; overflow-wrap:anywhere; }
.r8-editorial .r8-adjacent-next { grid-column:2; }
.r8-editorial .r8-column-related-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
@media(max-width:900px){.r8-editorial .r8-column-related-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:650px){.r8-editorial .r8-column-navigation .r8-adjacent-posts,.r8-editorial .r8-column-related-grid{grid-template-columns:minmax(0,1fr);} .r8-editorial .r8-adjacent-next{grid-column:auto;} .r8-editorial .r8-column-navigation .r8-column-cover{flex-basis:76px;width:76px;}}

/* Previous article points left, without changing other link cards. */
.r8-editorial .r8-adjacent-posts .r8-adjacent-previous::after { order:-1; transform:rotate(-135deg); margin-inline:2px 0; }

/* Category navigation uses the existing editorial palette. */
.r8-column-category-nav { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0 24px; }
.r8-column-category-nav a { display:inline-flex; align-items:center; min-height:44px; padding:6px 14px; border:1px solid var(--tool-line); border-radius:8px; background:#fff; text-decoration:none; }
.r8-column-category-nav a[aria-current="page"] { background:var(--tool-soft); border-color:var(--tool-green); font-weight:700; }
.r8-column-category-tools { margin-top:32px; }

/* Shared list width, including the fixed-page shortcode surface. */
.r8-editorial #main > article.r8-editorial-list > :not(.r8-column-grid) { max-width: none; margin-inline: 0; }
.r8-editorial #main > .r8-editorial-list > h1 { text-align: left; }
