/* ============================================================
   blog.css - the blog's own styles, on top of the main site's
   base / responsive / site layers (loaded last).
   Colours come only from the site's tokens, so light and dark both work.
   ============================================================ */

/* ---------- WordPress chrome ---------- */
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.admin-bar .nav { top: 32px; }
@media (max-width: 782px) { .admin-bar .nav { top: 46px; } }
@media (max-width: 600px) { .admin-bar .nav { top: 0; } }

/* ---------- Blog bar: the blog's sections and search, under the main menu ---------- */
.blog-bar { border-bottom: 1px solid var(--border); background: var(--bg-elev); }
.blog-bar-inner { display: flex; align-items: center; gap: 20px; min-height: 52px; }
.blog-bar-home {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); white-space: nowrap;
}
.blog-bar-links {
  display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.blog-bar-links::-webkit-scrollbar { display: none; }
.blog-bar-links a {
  padding: 6px 10px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-dim); white-space: nowrap;
}
.blog-bar-links a:hover { color: var(--text); background: var(--bg-elev-2); }
.blog-bar-links a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.search-form { position: relative; flex: 0 1 240px; min-width: 0; }
.search-form .search-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-mute); pointer-events: none; }
.search-form input[type="search"] {
  width: 100%; height: 36px; padding: 0 12px 0 32px; font: inherit; font-size: 14px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  -webkit-appearance: none; appearance: none;
}
.search-form input[type="search"]::placeholder { color: var(--text-mute); }
@media (max-width: 760px) {
  .blog-bar-inner { flex-wrap: wrap; gap: 6px 12px; padding-block: 10px; }
  .blog-bar-links { order: 3; flex-basis: 100%; margin: 0 -10px; }
  .blog-bar .search-form { flex: 1 1 160px; }
}

/* ---------- List pages ---------- */
.page-head .kicker { margin-bottom: 0; }
.page-num { font-family: var(--font-mono); font-size: .45em; font-weight: 500; color: var(--text-mute); letter-spacing: 0; vertical-align: middle; }
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: none; }
.post-grid > li { display: flex; min-width: 0; }
@media (max-width: 860px) { .post-grid { grid-template-columns: minmax(0, 1fr); } }
.post-card { display: flex; flex-direction: column; width: 100%; padding: 0; overflow: hidden; }
.post-card:hover { border-color: var(--accent-line); }
.post-card-img { display: block; aspect-ratio: 1200 / 630; background: var(--bg-inset); border-bottom: 1px solid var(--border); }
.post-card-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-card-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px; }
.post-card .excerpt { margin: 0 0 14px; color: var(--text-dim); font-size: 15px; line-height: 1.6; }
.post-card .chips { margin-top: auto; }
.post-card h2 { overflow-wrap: anywhere; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-block; padding: 3px 9px; border: 1px solid var(--border); border-radius: 100px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); background: var(--bg-elev); text-decoration: none;
}
a.chip:hover { color: var(--accent); border-color: var(--accent-line); }

.navigation.pagination { margin-top: 32px; }
.page-nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.page-nav .page-numbers {
  display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev);
  font-family: var(--font-mono); font-size: 13px; color: var(--text-dim);
}
.page-nav a.page-numbers:hover { color: var(--text); border-color: var(--border-strong); }
.page-nav .page-numbers.current { color: #fff; background: var(--accent); border-color: var(--accent); }
.page-nav .page-numbers.dots { border-color: transparent; background: none; }

.empty-state { max-width: 560px; color: var(--text-dim); }
.empty-state .search-form { max-width: 360px; margin-top: 14px; }
.section-h { font-size: 22px; letter-spacing: -0.015em; margin: 0 0 18px; }

/* ---------- One post ---------- */
.post-head .chips { margin-top: 14px; }
.post-head h1 { margin-top: 12px; }
.post-solo .post-main { max-width: 780px; }
.post-main { min-width: 0; }
.post-aside { position: sticky; top: 88px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; max-height: calc(100vh - 110px); overflow: auto; }
.post-aside .doc-toc { position: static; max-height: none; overflow: visible; }
.admin-bar .post-aside { top: 120px; }
@media (max-width: 1000px) {
  .post-aside { position: static; max-height: none; overflow: visible; }
  .post-aside .doc-toc { display: none; }
  .post-aside:not(:has(.widget)) { display: none; }
}
.post-hero-img { margin: 0 0 28px; }
.post-hero-img img { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }

.side-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; font-size: 14px; color: var(--text-dim); }
.side-card .side-head { margin: 0 0 10px; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-mute); }
.side-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.side-card a { color: var(--text-dim); }
.side-card a:hover { color: var(--accent); }

.post-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 36px 0 0; max-width: 780px; }
.post-tags-label { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-mute); margin-right: 4px; }
.post-main .post-nav { max-width: 780px; }
.doc-layout .post-nav { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.page-links { margin-top: 24px; font-family: var(--font-mono); font-size: 13px; }

/* ---------- The text ---------- */
.post-body > :first-child { margin-top: 0; }
.prose h2:first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { color: var(--text); text-wrap: balance; }
.prose h2 code, .prose h3 code { font-size: .85em; }
.prose a code { color: inherit; }
.prose code { color: var(--text); overflow-wrap: anywhere; word-break: break-word; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.2em 0; }
.prose dl dt { font-weight: 600; color: var(--text); }
.prose dl dd { margin: 0 0 .6em 1.2em; color: var(--text-dim); }
.prose kbd { font-family: var(--font-mono); font-size: .85em; padding: .1em .4em; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--bg-elev); }
.prose mark { background: var(--accent-soft); color: var(--text); padding: 0 .15em; border-radius: 3px; }
.prose figure { margin: 1.6em 0; }
.prose figcaption, .prose .wp-caption-text, .prose .wp-element-caption { margin-top: 8px; font-size: 13.5px; color: var(--text-mute); text-align: center; }

/* Code blocks: the main site's block, sized for reading in the text column. */
.prose .code-wrap { margin: 1.6em 0; box-shadow: var(--shadow-sm); border-radius: var(--radius); }
.prose .code-wrap pre.code {
  margin: 0; border: 0; border-radius: 0; background: var(--bg-elev); padding: 16px 20px 20px;
  font-size: 13px; line-height: 1.65; tab-size: 4;
}
.prose .code-wrap + .code-wrap { margin-top: 1em; }
.code-single .code-toolbar { padding: 8px 12px 8px 16px; background: var(--bg-inset); }
.code-single .code-toolbar .file::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 2px;
  vertical-align: 0; background: var(--text-mute);
}
.code-single[data-lang="cs"] .file::before { background: #6f4cb8; }
.code-single[data-lang="vb"] .file::before { background: #2c7ad9; }
.code-single[data-lang="html"] .file::before { background: #16a34a; }
@media (max-width: 760px) {
  .prose .code-wrap { margin-left: -4px; margin-right: -4px; }
  .prose .code-wrap pre.code { padding: 14px 14px 18px; font-size: 12.5px; }
}

/* Tables scroll inside their own box. */
.table-scroll { overflow-x: auto; margin: 1.4em 0; border: 1px solid var(--border); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.table-scroll table { display: table; margin: 0; min-width: 100%; }
.table-scroll tr:last-child td { border-bottom: 0; }

/* Images and the editor's alignment classes */
.prose img { height: auto; }
.prose .alignleft { float: left; margin: .3em 1.4em 1em 0; }
.prose .alignright { float: right; margin: .3em 0 1em 1.4em; }
.prose .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.prose .wp-caption { max-width: 100%; }
.prose .wp-caption img { display: block; }
.post-body::after { content: ""; display: block; clear: both; }
@media (max-width: 600px) {
  .prose .alignleft, .prose .alignright { float: none; display: block; margin: 1em auto; }
}
.prose .gallery { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 10px; }
.prose .gallery-columns-2 { --cols: 2; }
.prose .gallery-columns-4 { --cols: 4; }
.prose .gallery-item { margin: 0; }
.prose .gallery-item img { width: 100%; }

/* Blocks that may appear in newer posts */
.prose .wp-block-image img { border-radius: var(--radius-sm); }
.prose .wp-block-quote, .prose .wp-block-pullquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent-line); color: var(--text-dim); }
.prose .wp-block-quote cite { display: block; margin-top: 6px; font-size: 13.5px; font-style: normal; color: var(--text-mute); }
.prose .wp-block-separator { border: 0; border-top: 1px solid var(--border); }
.prose .wp-block-button__link { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: var(--radius-sm); background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; }
.prose .wp-block-embed iframe, .prose iframe { max-width: 100%; }
.prose .wp-block-embed.wp-has-aspect-ratio .wp-block-embed__wrapper { position: relative; }
.prose .wp-block-embed.wp-embed-aspect-16-9 .wp-block-embed__wrapper::before { content: ""; display: block; padding-top: 56.25%; }
.prose .wp-block-embed.wp-has-aspect-ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.prose .has-text-align-center { text-align: center; }
.prose .has-text-align-right { text-align: right; }

/* ---------- Comments ---------- */
.comments { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); max-width: 780px; }
.comments-title, .comment-reply-title { font-size: 20px; letter-spacing: -0.01em; margin: 0 0 18px; }
.comment-reply-title small { margin-left: 8px; font-size: 13px; font-weight: 400; }
.comment-reply-title small a { color: var(--accent); }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { margin-left: 24px; padding-left: 16px; border-left: 1px solid var(--border); }
.comment-body { margin-bottom: 14px; padding: 16px 18px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13.5px; }
.comment-author { display: flex; align-items: center; gap: 10px; color: var(--text); }
.comment-author .avatar { border-radius: 50%; }
.comment-author .says { display: none; }
.comment-metadata a { font-family: var(--font-mono); font-size: 12px; color: var(--text-mute); }
.comment-content { margin-top: 10px; color: var(--text-dim); font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.comment-content code { font-family: var(--font-mono); font-size: .9em; background: var(--bg-inset); padding: .1em .35em; border-radius: 4px; }
.comment-awaiting-moderation { font-size: 13px; color: var(--text-mute); }
.reply a { font-size: 13px; color: var(--accent); font-weight: 600; }
.comment-respond { margin-top: 28px; }
.comment-form { display: grid; gap: 14px; }
.comment-form p { margin: 0; }
.comment-notes, .logged-in-as { font-size: 13.5px; color: var(--text-mute); }
.logged-in-as a { color: var(--accent); }
.comment-form label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 15px; color: var(--text);
  background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.comment-form textarea { min-height: 140px; resize: vertical; }
.comment-form .comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--text-dim); }
.comment-form .comment-form-cookies-consent label { display: inline; margin: 0; font-weight: 400; color: var(--text-dim); }
.comments-closed { color: var(--text-mute); font-size: 14px; }
.comment-navigation .page-nav { justify-content: space-between; }
.comment-navigation a { color: var(--accent); font-size: 14px; }

/* ---------- 404 ---------- */
.notfound-search { max-width: 360px; margin: 18px auto 0; text-align: left; }
.notfound-search .search-form { flex: none; }
.notfound-recent { border-top: 1px solid var(--border); }

/* ---------- Sidebar widgets (classic and block widgets) ---------- */
.side-card h2, .side-card .wp-block-heading, .side-card .widget-title {
  margin: 0 0 10px; font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .1em; color: var(--text-mute);
}
.side-card .wp-block-group, .side-card .wp-block-group__inner-container { margin: 0; }
.side-card .wp-block-latest-posts, .side-card .wp-block-latest-comments, .side-card .wp-block-categories, .side-card .wp-block-archives {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 6px;
}
.side-card .wp-block-latest-comments__comment { margin: 0; }
.side-card .no-comments { margin: 0; color: var(--text-mute); }
.side-card .wp-block-search__label { display: block; margin-bottom: 8px; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-mute); }
.side-card .wp-block-search__inside-wrapper { display: flex; gap: 6px; }
.side-card .wp-block-search__input {
  flex: 1; min-width: 0; height: 36px; padding: 0 10px; font: inherit; font-size: 14px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.side-card .wp-block-search__button {
  height: 36px; padding: 0 12px; border: 1px solid var(--accent); border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font: inherit; font-size: 13px; font-weight: 600;
}
