/* blog.codeverse.nl — additions on top of the main site's style.css.
   Copied to blog/assets/css/blog.css by tools/build-blog.py. Everything here
   uses the tokens defined in style.css, so light/dark comes for free. */

.brand-sub { color: var(--text-faint); font-weight: 500; }
.wrap-narrow { max-width: 46rem; }

/* header language switch */
.lang-switch {
  font-size: .85rem !important; font-weight: 600 !important;
  border: 1px solid var(--border-strong); border-radius: 100px;
  padding: .3rem .75rem; color: var(--text-muted) !important;
}
.lang-switch:hover { border-color: var(--accent); color: var(--accent-text) !important; }
.lang-switch.is-disabled { opacity: .45; cursor: default; }
@media (max-width: 860px) {
  .site-nav .lang-switch { border: 0; padding: .8rem 0; border-bottom: 1px solid var(--border); border-radius: 0; }
}

/* ---------- Index / tag pages ---------- */
.blog-head h1 { max-width: none; }
.blog-index { padding-top: 0; }
.blog-index-inner {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem); align-items: start;
}
@media (max-width: 820px) { .blog-index-inner { grid-template-columns: 1fr; } }

.post-list { list-style: none; display: grid; gap: 0; }
.post-card {
  display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: .3rem 1.5rem;
  padding: 1.6rem 0; border-top: 1px solid var(--border);
}
.post-card:first-child { border-top: 0; padding-top: 0; }
.post-card time { color: var(--text-faint); font-size: .9rem; font-variant-numeric: tabular-nums; padding-top: .35rem; }
.post-card h2 { font-size: 1.3rem; margin-bottom: .4rem; }
.post-card h2 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover { color: var(--accent-text); text-decoration: underline; }
.post-card p { color: var(--text-muted); margin-bottom: .6rem; }
.post-card-meta { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; font-size: .85rem; color: var(--text-faint); margin: 0 !important; }
@media (max-width: 640px) { .post-card { grid-template-columns: 1fr; } .post-card time { padding-top: 0; } }
.post-empty { color: var(--text-muted); padding: 2rem 0; }

.tags { display: inline-flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .02em;
  color: var(--accent-text); background: var(--accent-soft);
  border-radius: 100px; padding: .18rem .7rem; text-decoration: none;
}
.tag:hover { background: var(--accent); color: #fff; }
.tag.is-active { background: var(--accent); color: #fff; }
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-list .tag { font-size: .85rem; padding: .35rem .9rem; }
.side-feed { margin: 1.4rem 0 0; font-size: .9rem; }
.blog-side { position: sticky; top: 90px; }

/* ---------- Post ---------- */
.post-head h1 { max-width: 24ch; }
.post-meta { color: var(--text-faint); font-size: .92rem; margin: 1.2rem 0 .6rem; }
.post-meta a { color: var(--text-muted); text-decoration: none; }
.post-meta a:hover { color: var(--accent-text); text-decoration: underline; }
.post-tags { margin-bottom: 0; }
.post-alt { margin-top: 1rem; font-size: .92rem; }
.post-head { padding-bottom: 1.5rem; }
.post-body { padding-top: 1.5rem; }

.prose { font-size: 1.06rem; line-height: 1.7; }
.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3, .prose h4 { margin-top: 2.2em; position: relative; }
.prose h2 { font-size: 1.55rem; }
.prose h3 { font-size: 1.22rem; }
.prose h4 { font-size: 1.05rem; }
.prose .anchor { margin-left: .4em; color: var(--text-faint); text-decoration: none; opacity: 0; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor { opacity: 1; }
.prose p { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.4rem; display: grid; gap: .4rem; }
.prose li > ul, .prose li > ol { margin-top: .4rem; }
.prose li input[type="checkbox"] { margin-right: .35rem; vertical-align: middle; }
.prose strong { font-weight: 700; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }

.prose blockquote {
  margin: 1.4em 0; padding: .3rem 1.2rem; color: var(--text-muted);
  border-left: 3px solid var(--accent);
}
.prose blockquote > * + * { margin-top: .6em; }

.prose code {
  font-family: var(--font-mono); font-size: .9em;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 5px; padding: .1em .38em;
}
.prose pre {
  background: var(--ink-deep); color: #dbe6ef;
  border-radius: var(--radius-sm); padding: 1rem 1.2rem;
  overflow-x: auto; font-size: .88rem; line-height: 1.6;
  border: 1px solid var(--border-strong);
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }

.prose figure { margin: 1.8em 0; }
.prose figure img, .prose > p > img {
  border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); margin-inline: auto;
}
.prose figcaption { margin-top: .6rem; text-align: center; color: var(--text-faint); font-size: .88rem; }

.table-wrap { overflow-x: auto; margin: 1.4em 0; -webkit-overflow-scrolling: touch; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.prose tr:last-child td { border-bottom: 0; }

.prose details { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem 1rem; }
.prose summary { cursor: pointer; font-weight: 600; }
.prose details[open] summary { margin-bottom: .6rem; }

.post-foot { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.author-card p:not(.eyebrow) { color: var(--text-muted); max-width: 60ch; }
.author-card .hero-actions { margin-top: 1.4rem; }

/* the post header already carries the section padding */
.prose > :first-child { margin-top: 0; }
