/* ─── Blog post ─────────────────────────────────────── */

body:has(.post) main { display: flex; flex-direction: column; }

.post {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 70ch;
  width: 100%;
  margin: 0 auto;
}

/* Header */

.post header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: 0.5rem;
  margin-bottom: 2.5rem;
}
.post h1 { grid-column: 1; margin: 0; font-size: 2rem; line-height: 1.15; }
.post-date {
  grid-column: 2;
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}
.post-subtitle {
  grid-column: 1 / -1;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

/* Body */

.post-body { line-height: 1.7; }
.post-body h2 { margin-top: 2.5rem; }
.post-body h3 { margin-top: 2rem; }
.post-body p { margin: 1rem 0; }
.post-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  overflow-x: auto;
  font-size: 0.9rem;
}
.post-body code { font-size: 0.9em; }
.post-body blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
}
.post-body img { max-width: 100%; height: auto; }

/* Footnotes */

.post-footnotes {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
}
.post-footnotes:empty { display: none; }

/* Tags */

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2rem 0;
}
.post-tags:empty { display: none; }
.tag {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Prev / next — icon + title, pinned to bottom of article */

.post-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
  padding-top: 3rem;
}

.post-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  max-width: 45%;
  text-decoration: none;
  color: inherit;
}
.post-nav-item.next { margin-left: auto; }

.post-nav-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: no-repeat center / 18px 18px url("/static/icons/prev.svg");
}
.post-nav-item.next .post-nav-icon { background-image: url("/static/icons/next.svg"); }
html.dark .post-nav-icon { background-image: url("/static/icons/prev-light.svg"); }
html.dark .post-nav-item.next .post-nav-icon { background-image: url("/static/icons/next-light.svg"); }

.post-nav-label {
  min-width: 0;
  font-size: 0.9rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-nav-item.disabled { visibility: hidden; }

/* Blog index */

.blog-index { max-width: 70ch; width: 100%; margin: 0 auto; }
.blog-index h1 { margin: 0 0 1.5rem; }

.post-list {
  width: 100%;
  border-collapse: collapse;
}
.post-list th,
.post-list td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.post-list th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: normal;
}
.post-list td:last-child { white-space: nowrap; color: var(--muted); font-size: 0.85rem; }
.post-list td:nth-child(2) { display: flex; flex-wrap: wrap; gap: 6px; }


.video-container {
  width: min(100%, 900px);
  aspect-ratio: 16 / 9;
  margin: 2rem auto;
}

.video-container iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}


