/* Insights listing + article detail (prefix: ed-) */

/* ---------- Listing ---------- */
/* The index shares the Solutions/Evidence masthead. The featured draft is a separate reading surface. */
.ed-feature .ed-lead-story { padding-block-start: 0; }
.ed-lead-story { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); grid-template-areas: "meta art" "title art" "foot art"; gap: var(--s-4) clamp(24px, 4vw, 64px); padding: var(--s-6) 0; border-bottom: 1px solid var(--line-2); }
.ed-lead-story__meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-3); }
.ed-lead-story__title { grid-area: title; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3.3rem); line-height: 1.06; letter-spacing: -.025em; text-wrap: balance; transition: color var(--dur-2); }
.ed-lead-story:hover .ed-lead-story__title { color: var(--accent); }
.ed-lead-story__foot { grid-area: foot; display: grid; gap: var(--s-4); }
.ed-lead-story__dek { color: var(--text-2); font-size: var(--fs-lead); max-width: 56ch; }
.ed-lead-story__art { grid-area: art; position: relative; min-height: 240px; border-radius: var(--radius-l); }
.ed-lead-story__art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-width: 860px) {
  .ed-lead-story { grid-template-columns: 1fr; grid-template-areas: "meta" "title" "foot"; }
  .ed-lead-story__art { display: none; }
}

/* Index rows */
.ed-index { border-top: 1px solid var(--line-2); }
.ed-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 210px 18px; gap: var(--s-5); align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--line); }
.ed-row__date { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-3); }
.ed-row__main { display: grid; gap: 6px; }
.ed-row__title { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; line-height: 1.3; letter-spacing: -.012em; transition: color var(--dur-1); }
.ed-row__title:dir(rtl) { font-family: var(--font-arabic); }
.ed-row__dek { color: var(--text-2); font-size: var(--fs-small); max-width: 70ch; }
.ed-row__meta { display: grid; gap: 4px; font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-3); }
.ed-row:hover .ed-row__title, .ed-row:hover .card__go { color: var(--accent); }
.ed-row .card__go:dir(rtl) { transform: scaleX(-1); }
@media (max-width: 860px) {
  .ed-row { grid-template-columns: 1fr 18px; gap: 6px 12px; }
  .ed-row__date { grid-column: 1; }
  .ed-row__main { grid-column: 1; }
  .ed-row__meta { grid-column: 1; grid-template-columns: auto auto; justify-content: start; gap: 12px; }
  .ed-row .card__go { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
}
.ed-related-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); margin-bottom: var(--s-4); }
.ed-inline-btn { display: inline; font-size: inherit; text-decoration: underline; text-underline-offset: 3px; }

.ed-explore { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-3); }
.ed-topic {
  text-align: start; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); transition: border-color var(--dur-1), background var(--dur-1);
}
.ed-topic:hover { border-color: var(--line-3); background: var(--surface-2); }
.ed-topic[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-soft); }
.ed-topic .mono { color: var(--accent); }
.ed-topic strong { font-size: .95rem; line-height: 1.3; }
.ed-topic span.faint { font-size: var(--fs-micro); }
@media (max-width: 1080px) { .ed-explore { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ed-explore { grid-template-columns: 1fr 1fr; } }

.ed-filters {
  position: sticky; top: var(--sticky-top); z-index: 5; margin-top: var(--s-7);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-4); align-items: center;
  padding: var(--s-4) 0; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.ed-filters__tools { display: flex; gap: var(--s-3); align-items: center; }
.ed-search { position: relative; }
.ed-search .ico { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.ed-search .input { padding-inline-start: 40px; min-height: 42px; width: 240px; }
.ed-filters .select { min-height: 42px; width: auto; min-width: 190px; }
@media (max-width: 1080px) {
  .ed-filters { grid-template-columns: 1fr; position: static; }
  .ed-filters__tools { flex-wrap: wrap; }
  .ed-search, .ed-search .input, .ed-filters .select { width: 100%; flex: 1 1 200px; }
}
.ed-resultbar { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); margin: var(--s-5) 0; font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-3); letter-spacing: .04em; }

.ed-card[hidden] { display: none; }
.ed-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-3); }
.ed-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }
.ed-avatar {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--surface-3); border: 1px solid var(--line-2); font-family: var(--font-mono); font-size: 10px; color: var(--accent);
}
.ed-byline { display: inline-flex; align-items: center; gap: 10px; }

.ed-empty { padding: var(--s-8) var(--s-5); text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius-l); }
.ed-empty[hidden] { display: none; }

.ed-subscribe { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.ed-subscribe form { display: grid; gap: var(--s-4); }
@media (max-width: 860px) { .ed-subscribe { grid-template-columns: 1fr; } }

/* ---------- Article ---------- */
.ed-progress { position: fixed; top: var(--header-h); inset-inline-start: 0; height: 2px; width: 0; background: var(--accent); z-index: calc(var(--z-header) - 1); }

.ed-title { margin-top: var(--s-3); font-family: var(--font-display); font-weight: 700; font-size: clamp(2.3rem, 1.2rem + 4.2vw, 5.2rem); line-height: 1.02; letter-spacing: -.012em; max-width: 22ch; text-wrap: balance; }
.ed-rule { margin-top: var(--s-6); padding-block: 14px; border-block: 1px solid var(--line-2); display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; }
.ed-rule__tags { display: flex; gap: 14px; font-family: var(--font-mono); font-size: var(--fs-micro); }
.ed-rule__tags a { color: var(--accent); }
.ed-rule__tags a:hover { text-decoration: underline; }
.ed-rule .sim-label { margin-inline-start: auto; }
.ed-dek { margin-top: var(--s-5); font-size: clamp(1.15rem, 1rem + .5vw, 1.45rem); line-height: 1.45; color: var(--text-2); max-width: 54ch; }
/* Publication masthead: section flag above the headline, dek, then the byline rule. */
.ed-flag { display: flex; gap: 12px; align-items: baseline; margin-top: var(--s-6); padding-top: 10px; border-top: 2px solid var(--text); font-size: var(--fs-small); color: var(--text-2); }
.ed-flag a { color: var(--accent); font-weight: 600; }
@media (max-width: 640px) { .ed-rule .sim-label { margin-inline-start: 0; } }

.ed-layout { display: grid; grid-template-columns: 230px minmax(0, 720px); gap: clamp(32px, 6vw, 96px); justify-content: center; align-items: start; }
.ed-toc { position: sticky; top: calc(var(--sticky-top) + 32px); font-size: var(--fs-small); }
.ed-toc h2 { font-size: var(--fs-small); font-weight: 600; color: var(--text-3); margin-bottom: var(--s-3); }
.ed-toc ol { list-style: none; padding: 0; margin: 0; border-inline-start: 1px solid var(--line); }
.ed-toc a { display: block; padding: 7px 0 7px 16px; padding-inline: 16px 0; margin-inline-start: -1px; border-inline-start: 1px solid transparent; color: var(--text-3); line-height: 1.4; transition: color var(--dur-1), border-color var(--dur-1); }
.ed-toc a:hover { color: var(--text); }
.ed-toc a.is-active { color: var(--accent); border-inline-start-color: var(--accent); }
.ed-toc__actions { margin-top: var(--s-5); display: grid; gap: 8px; }
.ed-toc details summary { display: none; }
@media (max-width: 1000px) {
  .ed-layout { grid-template-columns: minmax(0, 1fr); }
  .ed-toc { position: static; }
  .ed-toc details { border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; background: var(--surface); }
  .ed-toc details summary { display: flex; justify-content: space-between; cursor: pointer; list-style: none; padding: 14px 0; font-weight: 600; }
  .ed-toc details summary::-webkit-details-marker { display: none; }
  .ed-toc details summary::after { content: "+"; color: var(--accent); font-family: var(--font-mono); }
  .ed-toc details[open] summary::after { content: "–"; }
  .ed-toc details h2 { display: none; }
  .ed-toc details ol { margin-bottom: 14px; }
  .ed-toc__actions { display: none; }
}

/* Prose */
.ed-prose { font-size: 1.075rem; line-height: 1.75; color: var(--text-2); counter-reset: edsec; }
.ed-prose > * + * { margin-top: 1.15em; }
.ed-prose p strong, .ed-prose li strong { color: var(--text); font-weight: 600; }
.ed-prose h2 {
  counter-increment: edsec; margin-top: 2.6em; scroll-margin-top: calc(var(--header-h) + 24px);
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.45rem, 1.2rem + .9vw, 1.9rem); line-height: 1.2; letter-spacing: -.008em; color: var(--text);
}
.ed-prose h2::before { content: "0" counter(edsec); display: block; font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--accent); letter-spacing: .08em; margin-bottom: 10px; }
.ed-prose h3 { margin-top: 1.8em; font-size: 1.15rem; font-weight: 600; color: var(--text); }
.ed-prose ul:not([class]), .ed-prose ol:not([class]) { padding-inline-start: 1.3em; }
.ed-prose li + li { margin-top: .45em; }
.ed-prose li::marker { color: var(--accent); }
.ed-prose a:not(.btn) { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.ed-prose .ed-lede { font-size: 1.22rem; line-height: 1.6; color: var(--text); }
.ed-prose .ed-lede::first-letter { font-family: var(--font-display); font-weight: 600; float: inline-start; font-size: 3.6em; line-height: .9; margin-inline-end: 10px; margin-top: 4px; color: var(--accent); }

.ed-pull { margin: 2.2em 0; padding: 4px 0 4px clamp(20px, 3vw, 32px); padding-inline: clamp(20px, 3vw, 32px) 0; border-inline-start: 2px solid var(--accent); }
.ed-pull p { font-family: var(--font-display); font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); line-height: 1.3; letter-spacing: -.008em; color: var(--text); font-weight: 500; }

.ed-figure { margin: 2.2em 0; }
.ed-figure .diagram { padding: 0; }
.ed-figure__scroll { overflow-x: auto; }
.ed-figure__scroll svg { min-width: 640px; width: 100%; height: auto; }
.ed-figure figcaption { margin-top: 12px; font-size: var(--fs-small); color: var(--text-3); }
.ed-figure figcaption b { font-family: var(--font-mono); font-weight: 500; color: var(--accent); font-size: var(--fs-micro); letter-spacing: .06em; margin-inline-end: 8px; }
.ed-svg-box { fill: var(--surface); stroke: var(--line-2); }
.ed-svg-box--accent { fill: var(--accent-soft); stroke: var(--accent); }
.ed-svg-num { fill: var(--accent); font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; }
.ed-svg-title { fill: var(--text); font-family: var(--font-body); font-size: 14px; font-weight: 600; }
.ed-svg-text { fill: var(--text-2); font-family: var(--font-body); font-size: 12px; }
.ed-svg-faint { fill: var(--text-3); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; }
.ed-svg-line { stroke: var(--line-3); fill: none; stroke-width: 1.3; }
.ed-svg-flow { stroke: var(--accent); fill: none; stroke-width: 1.5; stroke-dasharray: 4 6; animation: ed-dash 1.6s linear infinite; }
@keyframes ed-dash { to { stroke-dashoffset: -20; } }

.ed-table-wrap { overflow-x: auto; margin: 2em 0; border: 1px solid var(--line); border-radius: var(--radius); }
.ed-table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: var(--fs-small); line-height: 1.5; }
.ed-table caption { text-align: start; padding: 14px 16px; font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.ed-table th, .ed-table td { padding: 12px 16px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.ed-table thead th { color: var(--text); font-weight: 600; background: var(--surface); }
.ed-table tbody th { color: var(--text); font-weight: 600; white-space: nowrap; }
.ed-table tbody tr:last-child > * { border-bottom: 0; }
.ed-table td { color: var(--text-2); }

.ed-example { padding: clamp(20px, 3vw, 32px); border-radius: var(--radius-l); background: var(--surface); border: 1px dashed var(--line-3); }
.ed-example > * + * { margin-top: .9em; }

.ed-checklist { border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); padding: clamp(20px, 3vw, 32px); }
.ed-checklist ul { list-style: none; padding: 0; margin: var(--s-4) 0 0; display: grid; gap: 4px; }
.ed-checklist label { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 1rem; line-height: 1.5; }
.ed-checklist li:last-child label { border-bottom: 0; }
.ed-checklist input { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--accent); }
.ed-checklist input:checked + span { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--line-3); }
.ed-checklist__foot { margin-top: var(--s-4); display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: space-between; align-items: center; }

.ed-refs { font-size: var(--fs-small); line-height: 1.6; }
.ed-refs ol { padding-inline-start: 1.4em; }
.ed-refs li + li { margin-top: .6em; }
.ed-refs .todo { color: var(--signal); font-family: var(--font-mono); font-size: var(--fs-micro); }

.ed-author { display: grid; grid-template-columns: 64px 1fr; gap: var(--s-5); padding: clamp(20px, 3vw, 32px); border-radius: var(--radius-l); border: 1px solid var(--line); background: var(--surface); margin-top: var(--s-8); }
.ed-author .ed-avatar { width: 64px; height: 64px; font-size: 16px; }
@media (max-width: 520px) { .ed-author { grid-template-columns: 1fr; } }

.ed-outline { counter-reset: edo; list-style: none; padding: 0; margin: var(--s-5) 0 0; border-top: 1px solid var(--line); }
.ed-outline li { counter-increment: edo; display: grid; grid-template-columns: 48px 1fr; gap: var(--s-4); padding: var(--s-5) 0; border-bottom: 1px solid var(--line); }
.ed-outline li::before { content: "0" counter(edo); font-family: var(--font-mono); font-size: var(--fs-small); color: var(--accent); padding-top: 2px; }
.ed-outline strong { display: block; color: var(--text); font-size: 1.08rem; margin-bottom: 4px; }
.ed-outline p { color: var(--text-2); font-size: .97rem; }


@media (prefers-reduced-motion: reduce) { .ed-svg-flow { animation: none; } }
html.reduce-motion .ed-svg-flow { animation: none; }

/* Featured decision table (Insights lead story) */
.ed-fig { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: clamp(16px, 2vw, 28px); font-size: 13px; color: var(--text-2); }
.ed-fig__h, .ed-fig__r { display: grid; grid-template-columns: minmax(0, 1fr) 88px 104px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ed-fig__h { font-size: 12px; color: var(--text-3); border-bottom-color: var(--line-2); }
.ed-fig__h span + span, .ed-fig__r span + span { text-align: center; }
.ed-fig__r span + span { color: var(--accent); font-size: 18px; line-height: 1; }
.ed-fig__r span:first-child { color: var(--text); }
.ed-fig__note { margin-top: 12px; font-size: 12px; color: var(--text-3); }

.ed-photo { margin-top: var(--s-6); }
/* Keep the decision table's note clear of the plate edge */
.ed-lead-story__art:has(.ed-fig) { min-height: 320px; }
.ed-fig { padding-bottom: clamp(20px, 2.4vw, 32px); }
/* Article lead photo as a shallow band so the text starts sooner */
.ed-photo .photo img { --ar: 21 / 9; }

.ed-progress { transition: top 240ms var(--ease); }
