/*!
 * Blog layer — loaded AFTER /assets/css/style.css, which supplies the tokens,
 * the reset, the header and the footer. This file styles only what is unique to
 * the blog: the post shell, the prose rhythm and the listing cards.
 */

.cms-post {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(34px, 5vw, 62px) var(--gutter) clamp(48px, 7vw, 90px);
}

/* The title token holds the BLOG'S name on the listing page and the POST'S
   title on a post. Showing it unconditionally duplicated the listing heading,
   so it is revealed only where the CMS marks the body as a post page. */
.post-title { display: none; }
.post-dek   { display: none; }
.cms-post-page .post-title {
  display: block;
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 900;
  letter-spacing: -0.4px;
  margin: 0 0 12px;
}
.cms-post-page .post-dek {
  display: block;
  color: var(--ink-3);
  font-size: clamp(16px, 2vw, 19px);
  margin: 0 0 34px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

/* ── Prose ── */
.cms-post h2 { font-size: clamp(22px, 3vw, 30px); margin: 40px 0 14px; }
.cms-post h3 { font-size: clamp(18px, 2.3vw, 22px); margin: 30px 0 10px; }
.cms-post h4 { font-size: 17px; margin: 24px 0 8px; }
.cms-post p  { color: var(--ink-2); font-size: 16.5px; margin-bottom: 17px; }
.cms-post ul, .cms-post ol { margin: 0 0 18px 22px; color: var(--ink-2); font-size: 16.5px; }
.cms-post ul { list-style: disc; }
.cms-post ol { list-style: decimal; }
.cms-post li { margin-bottom: 8px; }
.cms-post a  { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.cms-post a:hover { color: var(--ink); }
.cms-post strong { color: var(--ink); }

.cms-post img,
.cms-post video { border-radius: var(--r); border: 1px solid var(--line); margin: 26px 0; }
.cms-post figure { margin: 26px 0; }
.cms-post figcaption { font-size: 13.5px; color: var(--ink-3); margin-top: 9px; text-align: center; }

.cms-post blockquote {
  margin: 26px 0; padding: 18px 22px;
  border-left: 3px solid var(--accent);
  background: var(--bg-2); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--ink-2); font-style: italic;
}
.cms-post code {
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 5px; padding: 2px 6px; font-size: 0.92em;
}
/* Wide code must scroll inside its own box; the page body never scrolls
   sideways. */
.cms-post pre {
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 18px; margin: 24px 0;
  overflow-x: auto; font-size: 14px; line-height: 1.55;
}
.cms-post pre code { background: none; border: 0; padding: 0; }

.cms-post table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px; }
.cms-post thead th { text-align: left; border-bottom: 2px solid var(--line-2); padding: 11px 12px; }
.cms-post td { border-bottom: 1px solid var(--line); padding: 11px 12px; color: var(--ink-2); }
.cms-post .table-wrap { overflow-x: auto; }

.cms-post hr { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }

/* Heading permalinks the CMS injects. */
.cms-post .heading-anchor { opacity: 0; margin-left: 8px; text-decoration: none; color: var(--ink-3); }
.cms-post h2:hover .heading-anchor,
.cms-post h3:hover .heading-anchor,
.cms-post .heading-anchor:focus-visible { opacity: 1; }

/* ── Listing ── */
.cms-blog-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 30px; }
.cms-blog-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 24px; transition: transform .25s ease, border-color .25s ease;
}
.cms-blog-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.cms-blog-card h2, .cms-blog-card h3 { font-size: 19px; margin: 0 0 9px; }
.cms-blog-card a { color: inherit; text-decoration: none; }
.cms-blog-card a:hover { color: var(--accent-2); }
.cms-blog-card p { font-size: 14.5px; color: var(--ink-2); margin: 0; }
.cms-blog-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 12px; }

.cms-blog-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.cms-blog-tags a {
  padding: 6px 13px; border-radius: var(--r-pill); border: 1px solid var(--line-2);
  font-size: 13px; color: var(--ink-2); text-decoration: none;
}
.cms-blog-tags a:hover { border-color: var(--accent-2); color: var(--accent-2); }

.cms-pagination { display: flex; justify-content: center; gap: 10px; margin-top: 34px; }
.cms-pagination a, .cms-pagination span {
  padding: 9px 15px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  font-size: 14px; text-decoration: none;
}
.cms-pagination .is-current { background: var(--accent); border-color: var(--accent); color: #fff; }
