/* costsegroi.com — editorial pages (methodology + example) */

.editorial {
  padding: 64px 0 40px;
}
.editorial-hero {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 32px 56px;
  border-bottom: 1px solid var(--rule);
}
.editorial-hero .crumbs {
  font-family: var(--sans); font-size: 13px;
  color: var(--muted); margin-bottom: 20px;
  display: flex; gap: 8px; align-items: center;
}
.editorial-hero .crumbs a { border: none; color: var(--muted); }
.editorial-hero .crumbs a:hover { color: var(--accent); }
.editorial-hero .crumbs span.sep { color: var(--muted-2); }
.editorial-hero h1 {
  font-size: clamp(36px, 4.5vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.022em;
  font-weight: 400;
  margin: 16px 0 20px;
}
.editorial-hero .deck {
  font-family: var(--serif); font-weight: 300;
  font-size: 22px; line-height: 1.5;
  color: var(--muted);
  margin: 0 0 28px;
}
.editorial-hero .byline {
  display: flex; align-items: center; gap: 18px;
  font-family: var(--sans); font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.editorial-hero .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--navy));
  color: white;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.editorial-hero .byline-name {
  color: var(--ink); font-weight: 500;
}
.editorial-hero .byline-name div:last-child { color: var(--muted); font-weight: 400; }

.editorial-body {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 56px 32px 0;
  font-family: var(--serif);
  font-size: 19px; line-height: 1.7;
}
.editorial-body > h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: 32px; line-height: 1.18;
  letter-spacing: -0.018em;
  margin: 64px 0 16px;
  scroll-margin-top: 90px;
}
.editorial-body > h2:first-child { margin-top: 0; }
.editorial-body > h3 {
  font-family: var(--sans); font-weight: 600;
  font-size: 18px; letter-spacing: -0.01em;
  margin: 36px 0 10px;
  color: var(--ink);
}
.editorial-body > p {
  color: var(--ink-2);
  margin: 0 0 22px;
  max-width: 68ch;
}
.editorial-body > p > strong { color: var(--ink); font-weight: 500; }
.editorial-body a { color: var(--ink); border-bottom-color: var(--accent); }
.editorial-body a.btn { color: var(--bg); border-bottom: none; }
.editorial-body a.btn:hover { color: white; }

.editorial-body .pullquote {
  font-family: var(--serif); font-style: italic;
  font-weight: 300;
  font-size: 28px; line-height: 1.35;
  letter-spacing: -0.012em;
  color: var(--ink);
  border-left: 2px solid var(--accent);
  padding: 8px 0 8px 24px;
  margin: 36px 0 36px -8px;
  max-width: 32ch;
}
.editorial-body .pullquote cite {
  display: block;
  font-family: var(--sans); font-style: normal;
  font-size: 12px; font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 14px;
}

.editorial-body .formula {
  font-family: var(--mono);
  font-size: 14px; line-height: 1.7;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 18px 22px;
  margin: 28px 0;
  color: var(--ink);
  overflow-x: auto;
}
.editorial-body .formula em {
  color: var(--accent); font-style: normal;
}
.editorial-body .formula .lbl {
  color: var(--muted); font-style: normal;
}

.editorial-body .callout {
  background: var(--accent-tint);
  border: 1px solid color-mix(in oklab, var(--accent) 25%, transparent);
  border-radius: 10px;
  padding: 20px 24px;
  margin: 32px 0;
  font-family: var(--sans);
  font-size: 15px; line-height: 1.6;
  color: var(--ink-2);
  display: grid; gap: 8px;
}
.editorial-body .callout strong {
  font-family: var(--sans); font-weight: 600;
  color: var(--accent);
  font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase;
}

.editorial-body .citation {
  font-family: var(--mono); font-size: 12px;
  color: var(--muted);
  border-top: 1px dashed var(--rule);
  padding-top: 16px;
  margin: 24px 0;
}
.editorial-body .citation strong {
  color: var(--ink-2); font-family: var(--mono);
  font-weight: 600;
}

/* Inputs table for example */
.inputs-table {
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  margin: 32px 0;
  font-family: var(--sans);
  font-size: 14px;
}
.inputs-table .row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  border-bottom: 1px solid var(--rule);
}
.inputs-table .row:last-child { border-bottom: none; }
.inputs-table .row.header {
  background: var(--bg-2);
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted);
}
.inputs-table .cell {
  padding: 12px 16px;
  border-right: 1px solid var(--rule);
  color: var(--ink-2);
}
.inputs-table .cell:last-child { border-right: none; }
.inputs-table .cell.num {
  font-variant-numeric: tabular-nums;
  font-weight: 500; color: var(--ink);
}
.inputs-table .cell.note { color: var(--muted); font-size: 13px; }

/* Math walkthrough */
.math-walk {
  display: grid; gap: 0;
  margin: 32px 0;
  font-family: var(--sans);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
}
.math-walk .step {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: baseline;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.math-walk .step:last-child { border-bottom: none; }
.math-walk .step.total {
  background: var(--accent-tint);
}
.math-walk .step.total .val { color: var(--accent); font-size: 28px; font-weight: 600; }
.math-walk .num-cell {
  font-family: var(--sans); font-variant-numeric: tabular-nums;
  font-size: 12px; font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.math-walk .desc { color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.math-walk .desc small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.math-walk .val {
  font-family: var(--sans); font-variant-numeric: tabular-nums;
  font-size: 22px; font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Example: alternative scenarios */
.alt-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin: 24px 0;
  font-family: var(--sans);
}
.alt-card {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 18px 20px;
  display: grid; gap: 6px;
}
.alt-card .alt-tag {
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
}
.alt-card .alt-mult {
  font-size: 36px; font-weight: 500; letter-spacing: -0.03em;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.alt-card .alt-meta { font-size: 13px; color: var(--muted); }
.alt-card .alt-meta strong { color: var(--ink); font-weight: 500; }

/* TOC */
.toc {
  position: sticky; top: 100px;
  font-family: var(--sans); font-size: 13px;
  padding: 8px 0 0;
}
.toc-label {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); margin-bottom: 14px;
}
.toc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.toc-list a {
  border: none; color: var(--muted);
  display: block; padding-left: 12px;
  border-left: 1px solid var(--rule);
  line-height: 1.4;
}
.toc-list a:hover { color: var(--ink); border-left-color: var(--accent); }

.editorial-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 60px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 32px 0;
}
.editorial-layout .editorial-body { padding: 0; max-width: var(--measure); margin: 0; }

/* End-of-article CTA */
.end-cta {
  margin: 64px 0 0;
  padding: 36px 36px 32px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 12px;
  display: grid; gap: 14px;
  font-family: var(--serif);
}
.end-cta h3 {
  font-family: var(--serif); font-weight: 400;
  font-size: 26px; letter-spacing: -0.018em;
  line-height: 1.2;
  margin: 0;
}
.end-cta p {
  font-size: 16px; color: var(--muted);
  margin: 0; max-width: 56ch;
}
.end-cta .btn { margin-top: 8px; justify-self: start; }

/* Related links */
.related {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin: 48px 0 0;
}
.related a {
  border: 1px solid var(--rule); border-radius: 10px;
  padding: 20px 22px;
  display: grid; gap: 6px;
  font-family: var(--sans);
  text-decoration: none;
}
.related a .rel-tag {
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent);
}
.related a .rel-title {
  font-family: var(--serif); font-weight: 400;
  font-size: 18px; line-height: 1.3;
  color: var(--ink);
}
.related a:hover { border-color: var(--accent); }

@media (max-width: 900px) {
  .editorial-layout { grid-template-columns: 1fr; gap: 0; padding: 32px 20px 0; }
  .toc { position: static; margin-bottom: 24px; }
  .alt-grid { grid-template-columns: 1fr; }
  .related { grid-template-columns: 1fr; }
  .math-walk .step { grid-template-columns: 24px 1fr; }
  .math-walk .val { grid-column: 1 / -1; padding-top: 4px; }
  .inputs-table .row { grid-template-columns: 1fr 1fr; }
  .inputs-table .row > .cell:nth-child(3) { display: none; }
}
