/* ============================================================
   webprojects55 — blog pages (timeline + permalinks)
   Loads on top of styles.css and reuses its tokens/classes.
   ============================================================ */

/* ---------- Blog timeline ---------- */

.blog-page {
  padding-block-start: clamp(var(--s9), 6vw, 4.5rem);
  padding-block-end: var(--s18);
}

.blog-page .section-head h1 {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.feed-link {
  color: var(--accent-text);
  font-weight: 500;
}

.micro-list {
  list-style: none;
  padding: 0;
}

.micro-entry {
  border-block-end: 1px solid var(--line);
  padding-block: var(--s9);
}

.micro-entry:first-child {
  border-block-start: 1px solid var(--line);
}

.micro-title {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-block-end: var(--s1);
}

.micro-title-link {
  color: inherit;
  text-decoration: none;
}

.micro-title-link:hover {
  color: var(--accent-text);
}

.micro-meta {
  font-size: var(--text-sm);
  color: var(--ink-mute);
  margin-block-end: var(--s4);
  font-variant-numeric: tabular-nums;
}

.micro-body {
  color: var(--ink-soft);
  font-size: var(--text-base);
  max-width: var(--measure);
  display: grid;
  gap: var(--s4);
}

.micro-body :is(h2, h3) {
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.micro-body h2 {
  font-size: var(--text-md);
  font-weight: 700;
}

.micro-body h3 {
  font-size: var(--text-base);
  font-weight: 700;
}

.micro-body ul,
.micro-body ol {
  padding-inline-start: 1.5rem;
  display: grid;
  gap: var(--s1);
}

.micro-body blockquote {
  border-inline-start: 3px solid var(--accent);
  padding-inline-start: var(--s4);
  color: var(--ink-soft);
}

.micro-body pre {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s4);
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.micro-body code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.875em;
}

.micro-body pre code {
  background: none;
  padding: 0;
}

.micro-body a {
  color: var(--accent-text);
  font-weight: 500;
  text-underline-offset: 3px;
}

/* Images from ![alt](url): rounded, full width within the measure, with a
   1px neutral outline for edge definition (pure black/white at 10%, never
   a tinted neutral — it reads as dirt on the image edge) */
.micro-body img {
  border-radius: var(--radius);
  height: auto;
  outline: 1px solid oklch(0 0 0 / 0.1);
}

:root[data-theme="dark"] .micro-body img {
  outline-color: oklch(1 0 0 / 0.1);
}

/* Responsive YouTube embed from a bare YouTube URL paragraph:
   16:9 box that scales with the column, iframe fills it absolutely */
.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-deep);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.micro-body :not(pre) > code {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  padding: 0.0625rem 0.375rem;
}

/* Tags sit inline in the meta line after the read time, styled as plain
   links — no pill chrome, weight matches the surrounding meta text */
.micro-tags {
  margin-inline-start: 0.375rem;
}

.tag-chip {
  color: var(--accent-text);
  text-decoration: none;
}

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

.tag-name {
  color: var(--accent-text);
}

/* ---------- Tag index ---------- */

.tag-index {
  list-style: none;
  padding: 0;
}

.tag-index-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s4);
  border-block-end: 1px solid var(--line);
  padding: var(--s4) 0.5rem;
}

.tag-index-row:first-child {
  border-block-start: 1px solid var(--line);
}

.tag-index-link {
  font-weight: 600;
  color: var(--accent-text);
  text-decoration: none;
}

.tag-index-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tag-index-count {
  font-size: var(--text-sm);
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

.micro-empty {
  color: var(--ink-mute);
  border-block: 1px solid var(--line);
  padding-block: var(--s9);
  text-align: center;
}

.back-home {
  margin-block-start: var(--s9);
  font-size: var(--text-sm);
}

.back-home a {
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 500;
}

.back-home a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Permalink page ---------- */

.blog-post {
  padding-block-start: clamp(var(--s9), 6vw, 4.5rem);
  padding-block-end: var(--s18);
}

/* Stacked header: title, then meta line left-aligned beneath it — matches
   the /blog/ timeline arrangement (not the right-aligned section-head) */
.post-header {
  border-block-start: 1px solid var(--line-strong);
  padding-block-start: var(--s9);
  margin-block-end: var(--s4);
}

.post-header .post-page-title {
  margin-block-end: var(--s1);
}

.post-header .section-note {
  margin-block-end: 0;
}

.post-page-title {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  text-wrap: balance;
}

.post-page-body {
  font-size: var(--text-md);
  line-height: 1.65;
}

/* ---------- Responsive ---------- */

@media (max-width: 800px) {
  .post-page-title {
    font-size: var(--text-lg);
  }
}
