/* ===========================================================================
   Denote — blog (landing-styled: Söhne display, Roboto body, light/dark)
   Loads AFTER landing.css and leans on its tokens, nav, and fineprint.
   Covers only what the blog adds: the archive list and post prose.
   =========================================================================== */

/* ---------- Page scaffolding ---------- */
/* Blog pages can run short (the archive, a brief post); pin the footer to
   the viewport bottom instead of letting it float mid-page. */
body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.blog-main {
  flex: 1;
  padding-block: clamp(2.5rem, 6vw, 4.5rem) var(--section-y);
}

/* Reading column: .wrap supplies gutters + centering, this narrows the cap. */
.blog-index,
.post {
  max-width: var(--measure);
}

.blog-footer {
  text-align: center;
  padding-bottom: 2.5rem;
}

/* ---------- Archive (blog index) ---------- */
.blog-index__head {
  margin-bottom: clamp(2.25rem, 4vw, 3rem);
}

/* Blog pages mark the nav's Blog button as the current page. */
.nav__btn[aria-current="page"] {
  color: hsl(var(--fg));
  background: hsl(var(--fg) / 0.05);
}

.blog-index__title {
  /* Same scale step as the landing's .section-title — no third display size. */
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.blog-index__lead {
  margin-top: 0.9rem;
  font-size: 1.0625rem;
  color: hsl(var(--fg-soft));
}

.post-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding-block: 1.1rem;
  border-top: 1px solid hsl(var(--hairline));
  text-decoration: none;
}

.post-list .post-row:last-child {
  border-bottom: 1px solid hsl(var(--hairline));
}

.post-row__date {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0.02em;
  color: hsl(var(--fg-muted));
}

.post-row__title {
  font-weight: 500;
  color: hsl(var(--fg));
  transition: color 0.15s ease;
}

.post-row:hover .post-row__title {
  color: hsl(var(--accent-strong));
}

.blog-index__empty {
  padding-block: 1.25rem;
  border-top: 1px solid hsl(var(--hairline));
  color: hsl(var(--fg-muted));
}

/* ---------- Post header ---------- */
.post__head {
  margin-bottom: clamp(2rem, 4vw, 2.75rem);
}

.post__title {
  /* Same scale step as the landing's .section-title — no third display size. */
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.post__date {
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: hsl(var(--fg-muted));
}

/* ---------- Post prose ---------- */
.post__body {
  color: hsl(var(--fg-soft));
  line-height: 1.7;
}

.post__body > * + * {
  margin-top: 1.25rem;
}

.post__body h2 {
  margin-top: 2.5rem;
  font-size: 1.625rem;
  line-height: 1.2;
}

.post__body h3 {
  margin-top: 2rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.post__body a {
  color: hsl(var(--accent-strong));
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: hsl(var(--accent) / 0.4);
}

.post__body a:hover {
  text-decoration-color: currentColor;
}

/* Roboto 700 is loaded by the blog layout specifically for this. */
.post__body strong {
  font-weight: 700;
  color: hsl(var(--fg));
}

.post__body ul,
.post__body ol {
  padding-left: 1.4rem;
}

.post__body li + li {
  margin-top: 0.5rem;
}

.post__body blockquote {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid hsl(var(--accent) / 0.4);
  color: hsl(var(--fg-muted));
}

.post__body img {
  border-radius: 12px;
  border: 1px solid hsl(var(--hairline));
}

.post__body table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.post__body th,
.post__body td {
  padding: 0.6rem 0.9rem 0.6rem 0;
  text-align: left;
  border-bottom: 1px solid hsl(var(--hairline));
}

.post__body th {
  font-weight: 500;
  color: hsl(var(--fg));
}

.post__body hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid hsl(var(--hairline));
}

/* ---------- Code blocks ---------- */
.post__body pre {
  margin: 1.5rem 0;
  padding: 1.1rem 1.25rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
}

.post__body pre code {
  background: none;
  color: hsl(var(--fg));
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* Minimal Prism token palette on the theme tokens. */
.post__body .token.comment,
.post__body .token.prolog,
.post__body .token.cdata,
.post__body .token.punctuation,
.post__body .token.operator {
  color: hsl(var(--fg-muted));
}

.post__body .token.keyword,
.post__body .token.tag,
.post__body .token.boolean,
.post__body .token.number,
.post__body .token.important {
  color: hsl(var(--accent-strong));
}

.post__body .token.string,
.post__body .token.char,
.post__body .token.attr-value {
  color: hsl(150 55% 32%);
}

.dark .post__body .token.string,
.dark .post__body .token.char,
.dark .post__body .token.attr-value {
  color: hsl(150 55% 62%);
}

.post__body .token.function,
.post__body .token.selector,
.post__body .token.attr-name,
.post__body .token.property {
  color: hsl(var(--fg));
}

/* ---------- Post footer ---------- */
.post__footer {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--hairline));
}

.post__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: hsl(var(--accent-strong));
  text-decoration: none;
}

.post__back svg {
  width: 0.95rem;
  height: 0.95rem;
  transition: transform 0.15s ease;
}

.post__back:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post__back:hover svg {
  transform: translateX(-2px);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .post-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}
