/* Blog list and article pages */

/* ---- Search, topics ---- */
.blog-search { position: relative; display: flex; align-items: center; gap: 10px; max-width: 560px; margin-top: 26px; padding: 6px 6px 6px 16px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); }
.blog-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.blog-search__ico { color: var(--muted); display: grid; }
.blog-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font: 500 16px/1.2 var(--body, inherit); padding: 10px 0; }
.blog-search input::placeholder { color: var(--faint); }
.blog-search input::-webkit-search-cancel-button { display: none; }

.blog { padding-bottom: 24px; }
.blog-cats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.blog-cat { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong);
  color: var(--muted); font: 600 14px/1 var(--display); transition: border-color .2s, color .2s, background-color .2s; }
.blog-cat small { font: 600 12px/1 var(--display); opacity: .7; }
.blog-cat:hover { border-color: var(--accent); color: var(--text); }
.blog-cat.is-on { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); color: var(--text); }
.blog-found { color: var(--muted); margin: 0 0 22px; }
.blog-found strong { color: var(--text); }
.blog-found a { color: var(--accent); font-weight: 600; margin-left: 10px; }

/* ---- Featured ---- */
.feature { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(20px, 4vw, 48px); align-items: center; padding: clamp(14px, 2vw, 22px); border-radius: 32px; margin-bottom: 40px; }
.feature .ph { border-radius: 22px; transition: transform .5s var(--ease); }
.feature:hover .ph { transform: scale(1.015); }
.feature__body { display: grid; gap: 14px; align-content: center; padding: 6px clamp(4px, 2vw, 22px) 6px 0; }
.feature__body h2 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.12; letter-spacing: -.02em; }
.feature__body > p:not(.eyebrow):not(.post__foot) { color: var(--muted); line-height: 1.65; }

/* ---- Cards ---- */
.posts--grid { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 40px; }
.post__meta { display: flex; flex-wrap: wrap; gap: 8px; }
.post__excerpt { color: var(--muted); line-height: 1.6; font-size: 15px; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--faint); font: 500 13.5px/1.4 var(--body, inherit); margin-top: auto; }
.post:hover h3 { color: var(--accent); }
.post h3 { transition: color .2s; }
.tag--sample { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); }
a.tag { transition: background-color .2s; }
a.tag:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); }

.pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 48px; color: var(--muted); font-weight: 500; }
.blog-empty { display: grid; justify-items: start; gap: 12px; max-width: 560px; margin: 24px auto 0; }

/* ---- Article ---- */
.readbar { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; pointer-events: none; }
.readbar span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), #36F0EC); }
.post-head { padding: 140px 0 28px; }
.post-head__in { max-width: 820px; }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font: 600 14px/1 var(--display); margin-bottom: 24px; min-height: 44px; }
.back:hover { color: var(--accent); }
.post-head__meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.post-head h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.1; letter-spacing: -.025em; }
.post-head__lead { font-size: clamp(17px, 2vw, 20px); line-height: 1.6; color: var(--muted); margin: 18px 0 0; }
.byline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 22px 0 0; color: var(--faint); font-size: 14.5px; }
.byline__who { color: var(--text); font-weight: 600; }
.post-cover { margin-bottom: 44px; }
.post-cover .ph { border-radius: 28px; }

.post-layout { display: grid; grid-template-columns: minmax(0, 720px) minmax(0, 280px); gap: clamp(32px, 6vw, 84px); justify-content: center; align-items: start; }
.post-side { position: sticky; top: 110px; display: grid; gap: 16px; }
.post-side .panel { padding: 20px; border-radius: 20px; }
.post-side h2 { display: flex; align-items: center; gap: 8px; font-size: 14px; letter-spacing: .02em; color: var(--muted); }
.toc ol { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 2px; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a { display: block; padding: 8px 10px; border-radius: 10px; color: var(--muted); font-size: 14.5px; line-height: 1.4; border-left: 2px solid transparent; transition: color .2s, background-color .2s; }
.toc a::before { content: counter(t) ". "; opacity: .6; }
.toc a:hover { color: var(--text); background: var(--hover-weak); }
.toc a.is-on { color: var(--text); border-left-color: var(--accent); background: var(--hover-weak); }
.share__row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.share__btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--text); font: 600 13.5px/1 var(--display); cursor: pointer; transition: border-color .2s, background-color .2s; }
.share__btn:hover { border-color: var(--accent); background: var(--hover-weak); }

/* The article text. Everything a CMS editor can produce is styled here. */
.prose { font-size: 18px; line-height: 1.8; color: var(--text); min-width: 0; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: clamp(24px, 3vw, 30px); line-height: 1.2; letter-spacing: -.02em; margin-top: 2.2em; scroll-margin-top: 110px; }
.prose h3 { font-size: 21px; margin-top: 1.8em; scroll-margin-top: 110px; }
.prose p, .prose li { color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose ul, .prose ol { padding-left: 1.4em; display: grid; gap: .5em; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--text); }
.prose blockquote { margin-inline: 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--accent); color: var(--muted); font-size: 1.05em; }
.prose img, .prose figure { max-width: 100%; border-radius: 18px; }
.prose figcaption { color: var(--faint); font-size: 14px; margin-top: 8px; }
.prose code { padding: 2px 7px; border-radius: 7px; background: var(--hover-weak); font-size: .9em; }
.prose pre { overflow-x: auto; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

/* ---- Author, closing ---- */
.authorbox-wrap { margin-top: clamp(48px, 7vw, 88px); }
.authorbox { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; padding: clamp(20px, 3vw, 32px); border-radius: 28px; max-width: 820px; margin-inline: auto; }
.authorbox h2 { font-size: 22px; letter-spacing: -.01em; margin-top: 4px; }
.authorbox__role { color: var(--accent); font: 600 14px/1.4 var(--display); margin: 2px 0 8px; }
.authorbox p:not(.eyebrow):not(.authorbox__role) { color: var(--muted); line-height: 1.65; margin: 0; }
.authorbox .authorbox__ph { width: 96px; border-radius: 50%; overflow: hidden; }
.authorbox .authorbox__ph .ph__cap span { display: none; }
.authorbox .authorbox__ph .ph__cap strong { font-size: 10px; }

@media (max-width: 1000px) {
  .posts--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature { grid-template-columns: 1fr; }
  .post-layout { grid-template-columns: minmax(0, 720px); }
  .post-side { position: static; order: -1; }
  .post-side .toc { display: none; }
}
@media (max-width: 640px) {
  .posts--grid { grid-template-columns: 1fr; }
  .post-head { padding-top: 112px; }
  .prose { font-size: 17px; }
  .authorbox { grid-template-columns: 1fr; }
  .blog-cats { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter, 20px) * -1); padding-inline: var(--gutter, 20px); scrollbar-width: none; }
  .blog-cats::-webkit-scrollbar { display: none; }
  .blog-cat { flex: none; }
}
@media (prefers-reduced-motion: reduce) { .feature .ph, .post h3, .readbar span { transition: none; } }

/* ---- Skeleton loading ---- */
.skel { display: none; }
html.skel-on .skel, .is-loading > .skel { display: block; }
html.skel-on .blog-real, .is-loading > .blog-real { display: none; }
.sk { position: relative; overflow: hidden; border-radius: 12px; background: var(--hover-weak, rgba(127,170,190,.14)); border: 1px solid var(--line); }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--accent) 16%, transparent) 50%, transparent 80%); animation: sk-shimmer 1.5s ease-in-out infinite; }
@keyframes sk-shimmer { to { transform: translateX(100%); } }
.sk--img { aspect-ratio: 16/10; border-radius: 22px; }
.sk--wide { aspect-ratio: 21/9; border-radius: 28px; margin-bottom: 44px; }
.sk--line { height: 14px; margin-top: 12px; }
.sk--title { height: 26px; margin-top: 14px; border-radius: 10px; }
.sk--pill { height: 26px; width: 110px; margin-top: 14px; border-radius: 999px; }
.sk--box { height: 190px; border-radius: 20px; }
.sk--short { height: 90px; margin-top: 16px; }
.sk--w30 { width: 30%; } .sk--w40 { width: 40%; } .sk--w50 { width: 50%; } .sk--w60 { width: 60%; } .sk--w70 { width: 70%; } .sk--w80 { width: 80%; } .sk--w90 { width: 90%; }
.skel-feature { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(20px, 4vw, 48px); align-items: center; padding: clamp(14px, 2vw, 22px); border-radius: 32px; margin-bottom: 40px; }
.skel-feature__txt { padding-right: 20px; }
.skel-card .sk--img { margin-bottom: 4px; }
.skel-article { display: grid; grid-template-columns: minmax(0, 720px) minmax(0, 280px); gap: clamp(32px, 6vw, 84px); justify-content: center; align-items: start; }
.skel .posts { margin-bottom: 0; }
.blog-real.is-in > * { animation: blog-in .5s var(--ease) both; }
@keyframes blog-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (max-width: 1000px) { .skel-feature, .skel-article { grid-template-columns: 1fr; } .skel-side { display: none; } }
@media (prefers-reduced-motion: reduce) { .sk::after { animation: none; } .blog-real.is-in > * { animation: none; } }
.newsbox, .newsbox > *, .newsbox__text { min-width: 0; }
.newsbox__text { overflow-wrap: anywhere; }

.blog-search__btn { flex: none; width: auto; }
.blog-search__go { display: none; }
.blog-search input { min-width: 0; width: 100%; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .blog-search { max-width: 100%; gap: 8px; padding: 4px 4px 4px 14px; }
  .blog-search .blog-search__btn { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; border-radius: 50%; }
  .blog-search__txt { display: none; }
  .blog-search__go { display: grid; place-items: center; }
}

/* ---- Comments ---- */
.comments-wrap { margin-top: clamp(28px, 5vw, 56px); }
.comments { padding: clamp(20px, 4vw, 36px); border-radius: 32px; display: grid; gap: 22px; max-width: 860px; margin-inline: auto; }
.comments__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.comments__head h2 { font-size: clamp(22px, 3vw, 28px); }
.comments__n { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; margin-left: 6px; border-radius: 999px; font: 700 14px/1 var(--display); background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); vertical-align: middle; }
.comments__mine { color: var(--accent); font-weight: 600; font-size: 15px; }
.comments__empty { margin: 0; color: var(--muted); }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.comment { display: flex; gap: 14px; padding: 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--hover-weak); }
.comment--wait { border-style: dashed; border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.comment__av { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font: 700 17px/1 var(--display); background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); }
.comment__body { min-width: 0; display: grid; gap: 6px; }
.comment__body p { margin: 0; }
.comment__who { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.comment__who time { color: var(--faint); font-size: 13px; }
.comment__you { font: 700 11px/1 var(--display); padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.comment__text { line-height: 1.65; overflow-wrap: anywhere; }
.comment__wait { color: var(--muted); font-size: 14px; }
.cstate { display: inline-block; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; }
.cstate--ok { border-color: var(--accent); color: var(--accent); }
.cstate--wait { border-style: dashed; color: var(--muted); }
.cstate--off { color: var(--faint); }
.comment-form { display: grid; gap: 16px; padding-top: 22px; border-top: 1px solid var(--line); }
.comment-form h3 { font-size: 20px; }
.comment-form__row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.comment-form__foot { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.comment-form__foot .field__hint { margin: 0; flex: 1 1 240px; }
.comment-form textarea { min-height: 120px; }
@media (max-width: 560px) { .comment-form__foot .btn { width: 100%; } .comment { padding: 14px; } }
