/* Vector Political — Blog styles.
   Loaded after /styles/main.css, which supplies the :root tokens, the paper grain
   and vignette (body::before/::after), .cta and the .foot__* link/dot styling.
   Sibling of styles/press.css: same cream paper, same hairlines, same type.
   Keep visual values in sync with design-spec.md. No dark mode, by design. */

:root {
  --wrap: 52rem;        /* header, footer, hero figure, index */
  --measure: 40rem;     /* reading column: ~65 characters at 1.15rem */
  --terracotta: #BC6A4E; /* rare accent only */
}

html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.blog-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.blog-wrap {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4.5rem) var(--gutter) clamp(2rem, 5vh, 3.5rem);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 2px;
}
.skip-link:focus { top: 1rem; outline: 2px solid var(--green); outline-offset: 3px; }

/* ---------- Header row ---------- */
.blog-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  margin-bottom: clamp(2.2rem, 5vh, 3.6rem);
}
.blog-top__id { display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: wrap; }

/* small Playfair wordmark, links home (green draw-in underline) */
.blog__home {
  position: relative;
  display: inline-block;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  letter-spacing: -0.005em;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 2px;
}
.blog__home::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1.5px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s cubic-bezier(.2, .7, .2, 1);
}
.blog__home:hover { color: var(--green); }
.blog__home:hover::after { transform: scaleX(1); }
.blog__home:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; border-radius: 2px; }

.blog-top__label,
.blog-top__back {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate);
}
.blog-top__label { padding-left: 0.9rem; border-left: 1px solid var(--rule); }
.blog-top__label a,
.blog-top__back { color: inherit; text-decoration: none; transition: color .3s ease; }
.blog-top__label a:hover,
.blog-top__back:hover { color: var(--green); }
.blog-top__label a:focus-visible,
.blog-top__back:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; border-radius: 2px; }

/* ---------- Shared small type ---------- */
.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0 0 0.9rem;
}
.blog-meta {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--slate);
  margin: 0.8rem 0 0;
}
.sep {
  display: inline-block;
  width: 3px; height: 3px;
  margin: 0 0.6em;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--slate);
  opacity: 0.6;
}
.draft-tag {
  display: inline-block;
  margin-left: 0.7em;
  padding: 0.1em 0.55em;
  vertical-align: middle;
  border: 1px solid var(--terracotta);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8E4A33;
}

/* editorial text link (green, hairline underline that darkens on hover) */
.post-link,
.post__body a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid rgba(46, 75, 51, 0.35);
  transition: color .3s ease, border-color .3s ease;
}
.post-link:hover,
.post__body a:hover { color: var(--green-dark); border-bottom-color: var(--green-dark); }
.post-link:focus-visible,
.post__body a:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 2px; }

/* ---------- Blog home: masthead ---------- */
.blog-masthead { max-width: 40rem; }
/* the wordmark is the blog's logo; the dek sits right under it */
.blog-logo {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0;
}
.blog-logo__link {
  position: relative;
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 3px;
  transition: color .3s ease;
}
.blog-logo__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s cubic-bezier(.2, .7, .2, 1);
}
.blog-logo__link:hover { color: var(--green); }
.blog-logo__link:hover::after { transform: scaleX(1); }
.blog-logo__link:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; border-radius: 2px; }
.blog-logo + .blog-dek { margin-top: 0.9rem; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.blog-title {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 0;
}
.blog-dek {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.2rem, 2.1vw, 1.7rem);
  line-height: 1.3;
  color: var(--slate);
  margin: 1.5rem 0 0;
  max-width: 34rem;
}
/* double-hairline masthead rule (same as press page and the contact modal) */
.blog-rule {
  position: relative;
  height: 5px;
  margin: clamp(2.2rem, 5vh, 3.4rem) 0 clamp(2rem, 5vh, 3rem);
}
.blog-rule::before,
.blog-rule::after {
  content: "";
  position: absolute;
  left: 0; width: 100%;
  background: var(--rule);
}
.blog-rule::before { top: 0; height: 2px; }
.blog-rule::after  { top: 4px; height: 1px; }

.blog-empty {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.15rem, 1.9vw, 1.45rem);
  line-height: 1.4;
  color: var(--slate);
  margin: 0;
  max-width: 34rem;
}
.blog-empty .post-link { color: var(--green); }

/* ---------- Blog home: featured + list ---------- */
.blog-feature { max-width: 42rem; }
.blog-feature__title {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
}
.blog-feature__title a,
.blog-row__title a { color: var(--ink); text-decoration: none; transition: color .3s ease; }
.blog-feature__title a:hover,
.blog-row__title a:hover { color: var(--green); }
.blog-feature__title a:focus-visible,
.blog-row__title a:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; border-radius: 2px; }
.blog-feature__dek {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.15rem, 1.9vw, 1.5rem);
  line-height: 1.32;
  color: var(--slate);
  margin: 1.1rem 0 0;
}

.blog-list {
  list-style: none;
  margin: clamp(2.4rem, 5vh, 3.6rem) 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.blog-row {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 0.4rem 2rem;
  padding: 1.7rem 0;
  border-bottom: 1px solid var(--rule);
}
.blog-row__date {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--slate);
  padding-top: 0.45rem;
}
.blog-row__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  line-height: 1.15;
  margin: 0;
}
.blog-row__dek {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0.55rem 0 0;
  max-width: 36rem;
}
.blog-row .blog-meta { margin-top: 0.5rem; }
.blog-rss { margin: clamp(2rem, 5vh, 3rem) 0 0; font-family: var(--sans); font-size: 0.85rem; }

/* ---------- Post: head ---------- */
.post__head { max-width: 44rem; }
.post__title {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.post__dek {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.15rem, 1.9vw, 1.5rem);
  line-height: 1.32;
  color: var(--slate);
  margin: 1.2rem 0 0;
  max-width: 38rem;
}
.post__byline {
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--slate);
  margin: 1.6rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  max-width: var(--measure);
}
.post__author { color: var(--ink); font-weight: 600; }

.post-hero { margin: clamp(2rem, 4vh, 3rem) 0 0; }
.post-hero img { display: block; width: 100%; height: auto; border-radius: 2px; }

/* ---------- Post: body (reading column) ---------- */
.post__body {
  margin-top: clamp(2rem, 4.5vh, 3rem);
  max-width: var(--measure);
  font-family: var(--sans);
  font-size: clamp(1.1rem, 0.35vw + 1.02rem, 1.2rem);
  line-height: 1.65;
  color: var(--ink-soft);
  overflow-wrap: break-word;
}
.post__body > :first-child { margin-top: 0; }
.post__body p { margin: 1.25rem 0 0; }
.post__body strong { color: var(--ink); font-weight: 600; }

.post__body h2,
.post__body h3,
.post__body h4 {
  position: relative;
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.008em;
  margin: 2.6rem 0 0;
  text-wrap: balance;
}
.post__body h2 { font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.1rem); }
.post__body h3 { font-weight: 700; font-size: clamp(1.3rem, 2.2vw, 1.6rem); margin-top: 2.1rem; }
.post__body h4 { font-weight: 600; font-size: 1.15rem; margin-top: 1.8rem; }
.post__body h2 + p, .post__body h3 + p, .post__body h4 + p { margin-top: 0.9rem; }

.post__body .anchor {
  margin-left: 0.4em;
  border-bottom: 0;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.7em;
  color: var(--slate);
  opacity: 0;
  transition: opacity .2s ease, color .2s ease;
}
.post__body h2:hover .anchor, .post__body h3:hover .anchor, .post__body h4:hover .anchor,
.post__body .anchor:focus-visible { opacity: 1; }
.post__body .anchor:hover { color: var(--green); border-bottom: 0; }
@media (hover: none) { .post__body .anchor { display: none; } }

.post__body ul, .post__body ol { margin: 1.25rem 0 0; padding-left: 1.4rem; }
.post__body li { margin-top: 0.5rem; padding-left: 0.2rem; }
.post__body li::marker { color: var(--green); }

/* blockquote: the press quote language */
.post__body blockquote {
  margin: 1.9rem 0 0;
  padding-left: 1.4rem;
  border-left: 2px solid var(--green);
}
.post__body blockquote p {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.2rem, 1.8vw, 1.4rem);
  line-height: 1.42;
  color: var(--ink);
  margin: 0.8rem 0 0;
}
.post__body blockquote p:first-child { margin-top: 0; }
.post__body blockquote cite,
.post__body blockquote p > em:only-child {
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
}

/* hr: a small centered mark */
.post__body hr {
  border: 0;
  height: 1px;
  width: 3.5rem;
  margin: 2.8rem auto;
  background: var(--slate);
  opacity: 0.55;
}

.post__body code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: var(--ink);
  background: rgba(21, 33, 51, 0.06);
  padding: 0.12em 0.4em;
  border-radius: 3px;
}
.post__body pre {
  margin: 1.6rem 0 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  background: rgba(21, 33, 51, 0.05);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-size: 0.9rem;
  line-height: 1.55;
}
.post__body pre code { background: none; padding: 0; font-size: inherit; }

/* figures + images */
.post__body img { max-width: 100%; height: auto; }
.post-figure { margin: 2.2rem 0 0; }
.post-figure img { display: block; width: 100%; border-radius: 2px; }
.post-figure figcaption {
  margin-top: 0.7rem;
  font-family: var(--sans);
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--slate);
}

/* tables: hairline rules, tabular numerals, scrolls inside its own wrapper */
.table-wrap {
  margin: 1.9rem 0 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 2px; }
.post__body table {
  width: 100%;
  min-width: 28rem;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.post__body th,
.post__body td {
  padding: 0.7rem 1rem 0.7rem 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}
.post__body th {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
  border-bottom: 1px solid var(--ink);
}
.post__body td[align="right"], .post__body th[align="right"] { text-align: right; }

/* end mark (the press page's ###) */
.post__endmark {
  margin: 2.6rem 0 0;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0.4em;
  color: var(--slate);
  opacity: 0.55;
}

/* ---------- Post: end matter ---------- */
.post__foot {
  max-width: var(--measure);
  margin-top: 2.4rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--rule);
}
.post__note {
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--slate);
  margin: 0;
}
.post__note strong { color: var(--ink); font-weight: 600; }
.post-cta { margin-top: 1.8rem; }

.post-share {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.4rem;
  margin-top: 2.2rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--slate);
}
.post-share__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.post-share a,
.post-share__copy {
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(94, 112, 136, 0.45);
  background: none;
  font: inherit;
  color: var(--slate);
  text-decoration: none;
  cursor: pointer;
  transition: color .3s ease, border-color .3s ease;
}
.post-share a:hover,
.post-share__copy:hover { color: var(--green); border-bottom-color: var(--green); }
.post-share a:focus-visible,
.post-share__copy:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 2px; }
.post-share__copy[hidden] { display: none; }

.post-more {
  max-width: var(--measure);
  margin-top: clamp(2.6rem, 6vh, 4rem);
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
}
.post-more ul { list-style: none; margin: 0; padding: 0; }
.post-more li { margin-top: 1.2rem; }
.post-more li:first-child { margin-top: 0.3rem; }
.post-more__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  transition: color .3s ease;
}
.post-more__title:hover { color: var(--green); }
.post-more__title:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; border-radius: 2px; }
.post-more .blog-meta { display: block; margin-top: 0.35rem; }

/* ---------- Footer ---------- */
.blog-foot {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.7rem;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(1.6rem, 4vh, 2.4rem) var(--gutter);
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--slate);
}
.blog-foot .foot__copy { margin: 0; }
.blog-foot .foot__current { color: var(--ink-soft); }

/* ---------- Draft ribbon (preview server only) ---------- */
.draft-ribbon {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.55rem var(--gutter);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
}
.draft-ribbon__dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--terracotta); }

/* ---------- Reading progress (CSS-only; nothing where unsupported) ---------- */
.read-progress { display: none; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .read-progress {
      display: block;
      position: fixed;
      top: 0; left: 0;
      z-index: 90;
      width: 100%;
      height: 2px;
      background: var(--green);
      transform: scaleX(0);
      transform-origin: left;
      animation: read-progress linear both;
      animation-timeline: scroll(root block);
    }
  }
}
@keyframes read-progress { to { transform: scaleX(1); } }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .blog-row { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; padding: 1.4rem 0; }
  .blog-row__date { padding-top: 0; }
  .post__body blockquote { padding-left: 1rem; }
  .post-cta { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .blog__home::after, .post-link, .post__body a, .post-share a, .post-share__copy,
  .blog-top__label a, .blog-top__back, .post__body .anchor { transition: none; }
}

/* ---------- Print: black on white, no chrome ---------- */
@media print {
  body::before, body::after,
  .skip-link, .blog-top, .blog-foot, .draft-ribbon, .read-progress,
  .post-share, .post-cta, .post-more, .post__body .anchor, .blog-rss { display: none !important; }
  html, body { background: #fff !important; color: #000 !important; }
  .blog-wrap { max-width: none; padding: 0; }
  .post__title, .post__dek, .post__byline, .post__author, .post__body, .post__body p, .post__body h2,
  .post__body h3, .post__body h4, .post__body blockquote p, .post__body strong, .post__note { color: #000 !important; }
  .post__body, .post__head, .post__byline, .post__foot { max-width: none; }
  .post__body { font-size: 11.5pt; }
  .post__body a { color: #000; border-bottom: 1px solid #000; }
  .post__body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; word-break: break-all; }
  .post__body h2, .post__body h3, .post__body h4 { break-after: avoid; }
  .post__body blockquote, .post-figure, .table-wrap { break-inside: avoid; }
  .reveal { opacity: 1 !important; animation: none !important; }
}
