/* Blog: /en/blog pages (site tokens) and /admin/blog (panel tokens as fallbacks). No inline styles (CSP). */

/* ---------- index ---------- */
.blog-sec { padding-top: 40px; }
/* topics: plain text links on one hairline (the current one underlined in blue); the long tail sits in <details> */
.blog-tags { margin: 0 0 32px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.blog-tags ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 22px; }
.blog-tags a { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 0; font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: none; transition: color var(--dur-1, .14s) var(--ease, ease); }
.blog-tags a:hover { color: var(--ink); }
.blog-tags a[aria-current] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--brand); }
.blog-tag-n { font-size: 12.5px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.blog-tags-more { margin-top: 4px; }
.blog-tags-more > summary { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 0; font-size: 15px; font-weight: 500; color: var(--brand-ink); cursor: pointer; list-style: none; }
.blog-tags-more > summary::-webkit-details-marker { display: none; }
.blog-tags-more > summary:hover { color: var(--ink); }
.blog-tags-more > ul { margin-top: 4px; }
.blog-tags-more a { font-size: 14.5px; font-weight: 400; }
.blog-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .blog-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .blog-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.blog-cards > li { display: flex; min-width: 0; }
.blog-card { position: relative; display: flex; flex-direction: column; width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; transition: border-color var(--dur-2, .2s) var(--ease, ease); }
.blog-card:hover { border-color: var(--line-3); }
.blog-card-cover { display: block; aspect-ratio: 16 / 9; background: var(--bg-2); overflow: hidden; }
.blog-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card-body { display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 20px; flex: 1; }
.blog-card h2, .blog-card h3 { font-size: 17.5px; line-height: 1.3; margin: 0; }
.blog-card h2 a, .blog-card h3 a { color: var(--ink); text-decoration: none; }
.blog-card h2 a::after, .blog-card h3 a::after { content: ""; position: absolute; inset: 0; }
.blog-card h2 a:hover, .blog-card h3 a:hover { color: var(--brand-ink); }
.blog-card-desc { margin: 0; font-size: 15px; color: var(--muted); }
.blog-card .blog-meta { margin-top: auto; padding-top: 8px; }
/* a post's topics: one muted line of text, not pills */
.blog-card-tags { display: flex; flex-wrap: wrap; gap: 0 6px; margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.blog-card-tags span + span::before { content: "·"; margin-inline-end: 6px; }
.blog-hero-tags a { font: 500 14px/1.3 var(--font-body); color: var(--muted); text-decoration: none; }
.blog-hero-tags a:hover { color: var(--brand-ink); text-decoration: underline; }
.blog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; font-size: 14px; color: var(--muted); }
.blog-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 40px; }
.blog-pager-n { font-size: 14px; color: var(--muted); }
.blog-empty { padding: 32px 0; color: var(--muted); }
.blog-rss { margin: 32px 0 0; font-size: 14px; }

/* ---------- post ---------- */
.blog-hero .blog-meta { margin-top: 18px; }
.blog-hero-tags { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 0 0 14px; }
.blog-article-sec { padding-top: 48px; }
.toc .toc-l3 a { padding-inline-start: 22px; font-size: 13.5px; }
.blog-body { max-width: 760px; padding-top: 0; }
.blog-body > :first-child { margin-top: 0; }
.blog-body h2, .blog-body h3, .blog-body h4 { scroll-margin-top: calc(var(--topbar-h, 64px) + 20px); }
.blog-body h4 { font-size: 16px; margin-top: 24px; }
.blog-body img { max-width: 100%; height: auto; border-radius: var(--r-lg, 12px); border: 1px solid var(--line, var(--c-border)); }
.blog-body hr { border: 0; border-top: 1px solid var(--line, var(--c-border)); margin: 36px 0; }
.blog-body blockquote { margin: 24px 0; padding: 4px 20px; border-inline-start: 3px solid var(--brand-line, var(--c-accent)); color: var(--muted, var(--c-fg-2)); }
.blog-body :not(pre) > code { font: 500 .9em/1.4 var(--font-mono, monospace); padding: 2px 6px; border-radius: 6px; background: var(--bg-2, var(--c-sunken)); border: 1px solid var(--line, var(--c-border)); }
.blog-body pre.code { overflow-x: auto; padding: 16px 18px; border-radius: var(--r-lg, 12px); background: var(--bg-3, var(--c-sunken)); border: 1px solid var(--line, var(--c-border)); font: 13.5px/1.6 var(--font-mono, monospace); }
.blog-body .table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--line, var(--c-border)); border-radius: var(--r-lg, 12px); }
.blog-body table { width: 100%; border-collapse: collapse; font-size: 15px; }
.blog-body th, .blog-body td { padding: 10px 14px; text-align: start; border-bottom: 1px solid var(--line, var(--c-border)); vertical-align: top; }
.blog-body thead th { background: var(--bg-2, var(--c-sunken)); font-weight: 500; }
.blog-body tbody tr:last-child td { border-bottom: 0; }
.blog-body .al-c { text-align: center; }
.blog-body .al-r { text-align: end; }
.callout { margin: 24px 0; padding: 16px 20px; border-radius: var(--r-lg, 12px); border: 1px solid var(--brand-line, var(--c-accent)); background: var(--brand-soft, var(--c-accent-soft)); }
.callout > :last-child { margin-bottom: 0; }
.callout-warning, .callout-caution { border-color: var(--warn, var(--c-warn)); background: var(--amber-bg, var(--c-bad-soft)); }
.blog-cover { margin: 0 0 32px; }
.blog-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.blog-faq { margin-top: 48px; }
.blog-faq .faq { margin: 0; max-width: none; }
.blog-cta { display: grid; grid-template-columns: 64px 1fr; gap: 20px; align-items: center; margin: 48px 0 0; padding: 22px 24px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--bg-2); }
.blog-cta h2 { font-size: 20px; margin: 0 0 6px; }
.blog-cta p { margin: 0 0 12px; }
.blog-cta p:last-child { margin: 0; }
@media (max-width: 520px) { .blog-cta { grid-template-columns: 1fr; } .blog-cta-mark { width: 48px; height: 48px; } }
.blog-related { margin-top: 48px; }
.blog-related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.blog-related li { margin: 0; }
.blog-related ul { gap: 0 !important; }
.blog-related a { display: flex; flex-direction: column; gap: 2px; padding: 14px 0; border-top: 1px solid var(--line-2); text-decoration: none; color: var(--text); }
.blog-related a:hover strong { color: var(--brand-ink); }
.blog-related strong { color: var(--ink); font-weight: 500; }
.blog-related span { font-size: 14px; color: var(--muted); }
.blog-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; }
.blog-pn a { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r-lg); text-decoration: none; color: var(--ink); background: var(--surface); transition: border-color var(--dur-1, .14s) var(--ease, ease); }
.blog-pn a:hover { border-color: var(--line-3); }
.blog-pn small { color: var(--muted); font-size: 13px; }
.blog-pn-next { text-align: end; grid-column: 2; }
.blog-more h2 { margin: 0 0 24px; }

/* ---------- admin (/admin/blog) ---------- */
.bcal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.bcal-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.bcal-head h2 svg { width: 20px; height: 20px; }
.bcal-wrap { overflow-x: auto; }
.bcal { width: 100%; min-width: 640px; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.bcal th { padding: 6px; text-align: start; color: var(--c-fg-3); font-weight: 500; }
.bcal td { height: 92px; padding: 6px; vertical-align: top; border: 1px solid var(--c-border); }
.bcal-out { background: var(--c-sunken); color: var(--c-fg-3); }
.bcal-today { box-shadow: inset 0 0 0 2px var(--c-accent); }
.bcal-day { display: block; font-weight: 600; margin-bottom: 4px; }
.bcal-post { display: block; margin-top: 3px; padding: 3px 6px; border-radius: 6px; font-size: 12px; line-height: 1.3; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-inline-start: 3px solid var(--c-fg-3); background: var(--c-surface-2); color: var(--c-fg); }
.bcal-published { border-inline-start-color: var(--c-ok); background: var(--c-ok-soft); }
.bcal-scheduled { border-inline-start-color: var(--c-accent); background: var(--c-accent-soft); }
.bfilter { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--c-fg-2); }
.blog-preview { max-height: 900px; overflow: auto; padding-inline-end: 8px; }
.blog-preview h1 { font-size: 26px; margin: 0 0 8px; }
.blog-fm-list { margin: 0; padding-inline-start: 18px; }
