/*
 * editorial.css
 *
 * Editorial typography and article shell. Extracted from blog_article_styles.inc.php.
 * Revert: remove this <link> and restore the inline <style> in the include.
 */

/* ─── Article / content shell ─────────────────────────────────────────────── */
body.editorial :is(article.content, div.intro, div.content) {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--step-0);
  line-height: 1.7;
  color: var(--ink);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern", "liga", "calt", "ss01", "cv11";
}

/* ─── Back link ─────────────────────────────────────────────────────────── */
body.editorial article.content > p:first-child {
  margin-bottom: var(--space-l);
}

body.editorial article.content > p:first-child a {
  font-size: var(--step--1);
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
}

body.editorial article.content > p:first-child a:hover {
  color: var(--accent);
}

body.editorial div.content > p:has(> a[href="/"]) a {
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: var(--step--1);
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
}

body.editorial div.content > p:has(> a[href="/"]) a:hover {
  color: var(--accent);
}

/* ─── Article header ────────────────────────────────────────────────────── */
body.editorial article.content header {
  margin-bottom: var(--space-l);
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

body.editorial article.content header h1 {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem);
  font-weight: 500;
  font-style: normal;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
  margin: 0 0 0.8rem 0;
}

body.editorial article.content .content-meta {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin: 0;
}

body.editorial article.content .content-meta .author::before {
  content: "·";
  margin-right: 0.6em;
  font-weight: 400;
  letter-spacing: 0;
}

/* ─── Banner image ──────────────────────────────────────────────────────── */
body.editorial .content-body > img:first-child,
body.editorial .content-body img[style*="width: 100%"],
body.editorial .content > img:first-child,
body.editorial .content img[style*="width: 100%"] {
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 48px -22px rgba(20, 20, 30, 0.38);
  margin-bottom: 2.4em !important;
}

/* ─── Body copy measure ─────────────────────────────────────────────────── */
body.editorial .content-body,
body.editorial div.intro div.copy-holder {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

body.editorial .content-body > img:first-child,
body.editorial .content-body img[style*="width: 100%"],
body.editorial .content-body ul,
body.editorial .content-body ol {
  max-width: none;
  width: 100%;
}

/* ─── Body paragraphs ───────────────────────────────────────────────────── */
body.editorial :is(.content-body, div.intro, div.content) p {
  font-size: var(--step-0);
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 var(--rhythm) 0;
  hyphens: auto;
  hanging-punctuation: first last;
  text-wrap: pretty;
}

/* ─── Lede paragraph ────────────────────────────────────────────────────── */
body.editorial .content-body p.lede,
body.editorial p.lede {
  font-size: clamp(1.13rem, 1.02rem + 0.42vw, 1.28rem);
  line-height: 1.56;
  color: var(--ink);
  font-weight: 400;
}

body.editorial .content-body p.lede::first-letter,
body.editorial p.lede::first-letter {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 3.6em;
  font-weight: 500;
  font-style: normal;
  color: var(--accent);
  float: left;
  line-height: 0.82;
  margin: 0.05em 0.55rem -0.05em 0;
}

/* ─── H2 headings ───────────────────────────────────────────────────────── */
body.editorial :is(.content-body, div.content) h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem);
  font-weight: 500;
  font-style: normal;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 3.2rem 0 0.8rem 0;
  padding-top: 0;
  scroll-margin-top: 5rem;
  text-wrap: balance;
}

body.editorial :is(.content-body, div.content) h2::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  background: var(--accent);
  margin-bottom: 0.85rem;
}

/* ─── H3 headings ───────────────────────────────────────────────────────── */
body.editorial :is(.content-body, div.content) h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.25;
  color: var(--ink-soft);
  margin: 2.2rem 0 0.6rem 0;
  scroll-margin-top: 5rem;
  text-wrap: balance;
}

/* ─── Lists ─────────────────────────────────────────────────────────────── */
body.editorial :is(.content-body, div.content) ul,
body.editorial :is(.content-body, div.content) ol {
  margin: 0 0 var(--rhythm) 0;
  padding-left: 1.6rem;
}

body.editorial :is(.content-body, div.content) ul {
  list-style: none;
  padding-left: 0;
}

body.editorial :is(.content-body, div.content) ul li {
  padding-left: 1.4rem;
  position: relative;
  line-height: 1.65;
}

body.editorial :is(.content-body, div.content) ul li::before {
  content: "▪";
  color: var(--accent);
  font-size: 0.6em;
  position: absolute;
  left: 0.1rem;
  top: 0.45em;
}

body.editorial :is(.content-body, div.content) ul li + li,
body.editorial :is(.content-body, div.content) ol li + li {
  margin-top: 0.55em;
}

body.editorial :is(.content-body, div.content) ol {
  counter-reset: ol-counter;
  list-style: none;
  padding-left: 0;
}

body.editorial :is(.content-body, div.content) ol li {
  counter-increment: ol-counter;
  padding-left: 2.4rem;
  position: relative;
  line-height: 1.65;
}

body.editorial :is(.content-body, div.content) ol li::before {
  content: counter(ol-counter, decimal-leading-zero) ".";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  top: 0.28em;
}

/* ─── List item strong terms ─────────────────────────────────────────────── */
body.editorial :is(.content-body, div.content) li strong {
  font-weight: 600;
  color: var(--ink);
}

/* ─── Inline strong ─────────────────────────────────────────────────────── */
body.editorial :is(.content-body, div.content) strong {
  font-weight: 600;
  color: var(--ink);
}

/* ─── Tip paragraphs ────────────────────────────────────────────────────── */
body.editorial :is(.content-body, div.content) p:has(> strong:first-child) {
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  background: linear-gradient(to right, var(--bg-card) 0%, transparent 100%);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding-top: 0.1em;
  padding-bottom: 0.1em;
}

/* ─── Links ─────────────────────────────────────────────────────────────── */
body.editorial :is(.content-body, div.content, div.intro) a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in oklab, var(--accent) 40%, transparent);
  text-underline-offset: 0.18em;
  transition: color 0.15s, text-decoration-color 0.15s, text-decoration-thickness 0.15s;
}

body.editorial :is(.content-body, div.content, div.intro) a:hover {
  color: var(--accent);
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
}

/* ─── Horizontal rule ────────────────────────────────────────────────────── */
body.editorial :is(.content-body, div.content) hr {
  border: none;
  width: 64px;
  height: 2px;
  background: var(--accent);
  margin: var(--space-xl) auto;
  display: block;
}

body.editorial :is(.content-body, div.content) hr + p {
  text-align: center;
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: var(--step--1);
  color: var(--ink-soft);
  margin-top: 0;
}

body.editorial :is(.content-body, div.content) hr + p:has(> strong:first-child) {
  border-left: none;
  padding-left: 0;
  background: none;
}

/* ─── Ad + newsletter separators ────────────────────────────────────────── */
body.editorial article.content .mashapp-responsive,
body.editorial article.content .newsletter-signup {
  margin-top: 2.5rem;
  padding-top: var(--space-l);
  border-top: 1px solid var(--rule);
}
