/*
 * Stylesheet for /blog/ only. Deliberately separate from the Tailwind output
 * baked into site.css — that file's utility classes were purged to whatever
 * the captured pages actually used, so new markup can't safely reach for
 * classes like `p-8` or `gap-6` and expect them to exist. This file writes
 * plain CSS instead, consuming the same --ploy-* custom properties site.css
 * defines (custom properties survive purging), so new pages inherit the
 * real palette without gambling on which utilities happen to be present.
 *
 * Headings deliberately do NOT use var(--font-heading) — that resolves to
 * "Sangbleuempiretrial", a trial cut of a commercial typeface not licensed
 * for production use (see the repo README). Body copy already uses a safe
 * system stack; headings here get the same stack at a heavy weight instead
 * of inheriting the licensing problem onto new pages.
 */

.blog-main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 5rem;
  color: var(--ploy-text-primary);
  font-family: var(--font-body);
}

.blog-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ploy-text-secondary);
  margin: 0 0 0.75rem;
}

.blog-main h1 {
  font-family: system-ui, -apple-system, sans-serif;
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.01em;
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  margin: 0 0 0.9rem;
}

.blog-lede {
  font-size: 1.05rem;
  color: var(--ploy-text-secondary);
  max-width: 56ch;
  margin: 0 0 2.5rem;
}

.blog-post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--ploy-border-primary);
}
.blog-post-list li {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--ploy-border-primary);
}
.blog-post-list h2 {
  font-family: system-ui, -apple-system, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 0 0.4rem;
}
.blog-post-list h2 a {
  color: var(--ploy-text-primary);
  text-decoration: none;
}
.blog-post-list h2 a:hover {
  text-decoration: underline;
}
.blog-post-list .blog-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ploy-text-secondary);
  margin: 0 0 0.6rem;
}
.blog-source-tag {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--ploy-border-primary);
  border-radius: 0.3rem;
  font-size: 0.68rem;
}
.blog-post-list p {
  margin: 0;
  color: var(--ploy-text-secondary);
}

.blog-post-body {
  font-size: 1.05rem;
  line-height: 1.65;
}
.blog-post-body p {
  margin: 0 0 1.3rem;
}
.blog-post-body h3 {
  font-family: system-ui, -apple-system, sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  margin: 2rem 0 1rem;
}
.blog-post-body blockquote {
  margin: 0 0 1.3rem;
  padding: 0 0 0 1rem;
  border-left: 3px solid var(--ploy-border-primary);
  color: var(--ploy-text-secondary);
  font-style: italic;
}
.blog-post-body ol,
.blog-post-body ul {
  margin: 0 0 1.3rem;
  padding-left: 1.4rem;
  /* site.css's Tailwind reset zeroes list-style site-wide; restore it here
     rather than everywhere, since nothing else on the captured pages
     actually renders a real list. */
  list-style: revert;
}
.blog-post-body li {
  margin: 0 0 1rem;
}
.blog-post-body li p {
  margin: 0 0 0.3rem;
}
.blog-post-body figure {
  margin: 1.5rem 0;
}
.blog-post-body figcaption {
  font-size: 0.82rem;
  color: var(--ploy-text-secondary);
  text-align: center;
  margin-top: 0.5rem;
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.5rem;
}
.blog-tags a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--ploy-border-primary);
  border-radius: 999px;
  color: var(--ploy-text-secondary);
  text-decoration: none;
}

.blog-original-note {
  font-size: 0.85rem;
  color: var(--ploy-text-secondary);
  font-style: italic;
  margin: 0 0 2rem;
}

.blog-subscribe-cta {
  margin-top: 3rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--ploy-border-primary);
  border-radius: 0.75rem;
  background: var(--ploy-background-secondary);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.blog-subscribe-cta p {
  margin: 0;
  font-size: 0.95rem;
}
.blog-subscribe-cta strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

/* "Work with me" block. Kept separate from the subscribe CTA above it on
   purpose: one asks for an email address, the other asks for a project, and
   collapsing them into one box makes both easier to ignore. It's on every post
   and tag page because those are the pages search traffic actually lands on —
   the homepage footer used to be the only contact point on the whole site,
   which is no use to someone who arrived on an article from Google. */
.blog-contact-cta {
  margin-top: 1.25rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--ploy-border-primary);
  border-radius: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.blog-contact-cta p {
  margin: 0;
  font-size: 0.95rem;
  max-width: 34ch;
}
.blog-contact-cta strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}
/* The two service links sit inside a paragraph, where nothing else marks them
   as clickable — without this they read as plain text and never get clicked. */
.blog-contact-cta p a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.blog-contact-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.blog-btn {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 0.65rem 1.3rem;
  border-radius: 999px;
  background: var(--ploy-button-primary-background);
  color: var(--ploy-button-primary-text);
  border: 1px solid var(--ploy-button-primary-border);
  font-family: var(--font-button);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
}
.blog-btn:hover {
  opacity: 0.9;
}
.blog-btn--ghost {
  background: transparent;
  color: var(--ploy-text-primary);
  border-color: var(--ploy-border-primary);
}

/* Syndicated posts (Medium/Substack, pulled in via RSS): the full text
   isn't reproduced, only a snippet + a clear link back to the original. */
.blog-syndication-notice {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px dashed var(--ploy-border-primary);
  border-radius: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.blog-syndication-notice p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ploy-text-secondary);
  max-width: 40ch;
}
.blog-syndication-notice .blog-btn {
  padding: 0.5rem 1.1rem;
  font-size: 0.82rem;
}

.blog-back-link {
  display: inline-block;
  margin-top: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* --- Notes: the microblog stream -----------------------------------------
 *
 * Two placements from one set of rules: the full feed at /blog/notes/, and a
 * narrow column beside the post list on /blog/ only.
 *
 * The sidebar is a grid track rather than a float so it cannot overlap the
 * list, and it collapses to a single column below 60rem — a quarter of a
 * phone screen is about 90px, which is not a column, it is a gutter. Below
 * that width the notes simply follow the posts.
 */
.blog-main--with-aside {
  max-width: 64rem;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}
/*
 * Placement is explicit, not automatic. Left to auto-flow, whichever element
 * happens to follow the post list in the DOM is dropped into column 2 — which
 * put the subscribe box in the sidebar slot and pushed the notes hundreds of
 * pixels down the page. Everything is pinned to column 1 except the aside.
 */
.blog-main--with-aside > * {
  grid-column: 1;
}
.blog-main--with-aside > .blog-aside {
  grid-column: 2;
  /*
   * Spans rather than sits in one row, so its height is distributed instead
   * of forcing a single row as tall as the whole sidebar — which pushed the
   * heading and the entire post list below the fold.
   *
   * "span 99" and not "1 / -1": negative row lines resolve against the
   * EXPLICIT grid, and this grid declares only columns, so -1 collapses back
   * to line 1 and silently spans nothing. Every row here is implicit, so the
   * span has to be counted.
   */
  grid-row: 1 / span 99;
}

.blog-aside {
  position: sticky;
  top: 4.5rem;
  border-left: 1px solid var(--ploy-border-primary);
  padding-left: 1.25rem;
}
.blog-aside__title {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
}
.blog-aside__sub {
  font-size: 0.8rem;
  color: var(--ploy-text-secondary);
  margin: 0 0 1.1rem;
}
.blog-aside__all {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ploy-text-primary);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.blog-note-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.blog-note {
  padding: 0 0 1.4rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--ploy-border-primary);
}
.blog-note:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}
.blog-note__meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ploy-text-secondary);
  margin: 0 0 0.45rem;
}
.blog-note__src {
  font-weight: 600;
  color: var(--ploy-text-primary);
}
.blog-note__body p {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  line-height: 1.55;
  /* Notes arrive as typed — URLs and long Russian compounds included — and a
     fixed-width sidebar is exactly where an unbroken string escapes its box. */
  overflow-wrap: anywhere;
}
.blog-note__body p:last-child {
  margin-bottom: 0;
}
.blog-note__link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ploy-text-secondary);
  text-decoration: none;
}
.blog-note__link:hover {
  color: var(--ploy-text-primary);
  text-decoration: underline;
}

.blog-note-list--compact .blog-note {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}
.blog-note-list--compact .blog-note__body p {
  font-size: 0.85rem;
  line-height: 1.5;
}

@media (max-width: 60rem) {
  .blog-main--with-aside {
    display: block;
    max-width: 42rem;
  }
  .blog-aside {
    position: static;
    border-left: 0;
    padding-left: 0;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--ploy-border-primary);
  }
}
