/* Blog: index, posts, sidebar. Loaded together with docs.css (prose + chips). */
.crumbs-hero { margin-bottom: 10px; color: #9fb3d9; }
.crumbs-hero a { color: #c3d0ea; }
.crumbs-hero a:hover { color: var(--teal); }
.crumbs-hero b { color: #fff; }
.crumbs-hero span { opacity: .6; }

/* filter bar */
.blog-bar { background: #fff; border-bottom: 1px solid var(--line); }
.blog-bar-inner { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; justify-content: space-between; padding-block: 18px; }
.blog-cats { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.blog-bar .chip { padding: 10px 20px; font-size: .9rem; }
.blog-search { position: relative; display: flex; align-items: center; gap: 10px; flex: 0 1 300px; min-width: 220px; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--muted); }
.blog-search:focus-within { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(18, 195, 170, .15); }
.blog-search .ic { flex: none; width: 18px; height: 18px; }
.blog-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: .92rem; color: var(--ink); }

/* layout */
.blog-section { background: #fbfcfe; padding-block: clamp(30px, 3.4vw, 48px) clamp(40px, 4vw, 64px); }
.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: clamp(22px, 2.6vw, 40px); align-items: start; }
.blog-h { font-size: clamp(1.3rem, 1.9vw, 1.7rem); margin-bottom: 18px; }
.blog-list-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 38px 0 18px; }
.blog-list-head .blog-h { margin: 0; }
.blog-sort select { height: 42px; padding: 0 36px 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; }
.blog-active { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; }
.blog-active .link-teal { margin-top: 0; }
.blog-none { padding: 28px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); background: #fff; }
.blog-none .link-teal { margin-top: 0; margin-left: 6px; }

/* post cards */
.post { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s; }
.post:hover { box-shadow: 0 14px 34px rgba(11, 27, 58, .11); }
.post-img { display: block; position: relative; overflow: hidden; background: #0b1b3a; }
.post-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* covers are shown whole (never cropped); any free space is filled with a blurred copy of the image */
.post-img::before { content: ""; position: absolute; inset: -24px; background: var(--img) center / cover; filter: blur(26px) saturate(1.15); }
.post-row .post-img, .post-main .post-img { display: flex; align-items: center; justify-content: center; }
.post-row .post-img img { position: relative; height: auto; max-height: 100%; object-fit: contain; }
.post-img-ph { display: grid; place-items: center; height: 100%; color: #8fa6d6; }
.post-img-ph .ic { width: 38px; height: 38px; }
.post-body { display: flex; flex-direction: column; gap: 9px; padding: clamp(14px, 1.6vw, 22px); }
.post-tag { display: inline-block; align-self: flex-start; margin: 0; padding: 4px 10px; border-radius: 7px; font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; background: #e3faf5; color: #0b7f6d; }
.cat-attacks .post-tag { background: #ffe9e9; color: #c0392b; }
.cat-product .post-tag { background: #fff1dc; color: #a65d00; }
.cat-operations .post-tag { background: #e5efff; color: #1f56c8; }
.post h3 { font-size: 1.12rem; line-height: 1.28; }
.post h3 a { color: var(--ink); }
.post h3 a:hover { color: var(--teal-700); }
.post-ex { font-size: .92rem; color: var(--muted); }
.post-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-top: 6px; }
.post-by { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); }
.post-by img { width: 22px; height: 22px; border-radius: 50%; background: #eaf2ff; padding: 3px; }
.post-by i { font-style: normal; opacity: .6; }
.post-more { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--ink); }
.post-more .ic { width: 15px; height: 15px; transition: transform .2s; }
.post-more:hover { color: var(--teal-700); }
.post-more:hover .ic { transform: translateX(3px); }

/* featured */
.feat-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 18px; }
.post-main { grid-row: 1 / span 2; display: flex; flex-direction: column; }
.post-main .post-img { flex: 1 1 auto; min-height: 240px; display: flex; align-items: center; justify-content: center; }
/* the cover is shown whole; the free space around it is filled with a blurred copy of itself */
.post-main .post-img::before { content: ""; position: absolute; inset: -24px; background: var(--img) center / cover; filter: blur(26px) saturate(1.15); }
.post-main .post-img img { position: relative; height: auto; max-height: 100%; object-fit: contain; }
.post-main .post-body { flex: 0 0 auto; }
.post-main h3 { font-size: clamp(1.3rem, 1.9vw, 1.65rem); }
.post-main .post-ex { font-size: .98rem; }
.post-main .post-foot { margin-top: auto; padding-top: 10px; }
.post-small { display: flex; flex-direction: column; }
.post-small .post-img { aspect-ratio: 1200 / 630; }
.post-small h3 { font-size: 1.02rem; }

/* list rows */
.post-list { display: grid; gap: 14px; }
.post-row { display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.post-row .post-img { height: 100%; min-height: 128px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 26px; }
.pg { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-weight: 600; font-size: .9rem; }
.pg:hover { border-color: var(--teal-500); }
.pg.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pg .ic { width: 15px; height: 15px; }
.pg[rel="prev"] .ic { transform: rotate(180deg); }

/* sidebar */
.blog-side { display: grid; gap: 18px; position: sticky; top: 96px; }
.side-card { padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.side-card h2 { font-size: 1.15rem; margin-bottom: 14px; }
.side-card .chips { margin-top: 0; gap: 10px; }
.side-card .chips li, .blog-tags li { padding: 0; background: none; border-radius: 0; }
.side-card .chip, .blog-tags .chip, .blog-tags a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: #2f4a8a; font-weight: 600; font-size: .84rem; display: inline-block; }
.side-card .chip:hover, .blog-tags a:hover { border-color: var(--teal-500); }
.side-card .chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.start-list { margin: 0; padding: 0; list-style: none; display: grid; }
.start-list li + li { border-top: 1px solid var(--line); }
.start-list a { display: grid; grid-template-columns: 34px minmax(0, 1fr) 18px; gap: 12px; align-items: center; padding: 13px 0; color: var(--ink); font-weight: 500; font-size: .93rem; }
.start-list a:hover { color: var(--teal-700); }
.start-list .num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--bg-soft); color: var(--ink); font-size: .78rem; font-weight: 700; }
.start-list .ic { width: 16px; height: 16px; color: var(--muted); }
.side-docs { background: linear-gradient(180deg, #effcf8, #e5f8f3); border-color: #bdeadf; }
.side-docs .round-box { width: 50px; height: 50px; border-radius: 14px; margin-bottom: 12px; }
.side-docs p { font-size: .9rem; color: var(--muted); margin-bottom: 16px; }
.side-docs .btn { width: 100%; justify-content: center; }
.side-api { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: .9rem; font-weight: 600; color: var(--ink); }
.side-api .ic { width: 17px; height: 17px; }
.side-api .ic:last-child { margin-left: auto; transform: rotate(-45deg); color: var(--muted); }

/* empty state + missing */
.blog-empty { display: grid; justify-items: start; gap: 14px; padding: clamp(28px, 4vw, 54px); border: 1px dashed var(--line); border-radius: var(--radius-lg); background: #fff; }
.blog-empty h2 { font-size: 1.5rem; }
.blog-empty p { color: var(--muted); max-width: 52ch; }
.blog-missing { text-align: center; padding-block: 60px; }

/* post page */
.blog-post-section { background: #fff; padding-block: clamp(26px, 3vw, 44px) clamp(30px, 3.4vw, 54px); }
.blog-article-wrap { display: flex; justify-content: center; }
.blog-article { width: 100%; max-width: 820px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 22px; font-size: .86rem; color: var(--muted); }
.article-meta span { display: inline-flex; align-items: center; gap: 8px; }
.article-meta img { width: 24px; height: 24px; border-radius: 50%; background: #eaf2ff; padding: 3px; }
.blog-cover { margin: 0 0 26px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: #0b1b3a; }
.blog-cover img { display: block; width: 100%; height: auto; }
.blog-article .prose { max-width: none; }
.blog-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; }
.blog-back { margin-top: 26px; }
.blog-back .link-teal { margin-top: 0; }
.blog-back .ic { transform: rotate(180deg); }
.blog-related { background: var(--bg-soft); padding-block: clamp(30px, 3.4vw, 52px); }
.blog-related h2 { font-size: 1.5rem; margin-bottom: 20px; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.related-grid .post-small .post-img { aspect-ratio: 1200 / 630; }

@media (max-width: 1100px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-docs { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .feat-grid { grid-template-columns: 1fr; }
  .post-main { grid-row: auto; }
  .related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .post-row { grid-template-columns: 1fr; }
  .post-row .post-img { aspect-ratio: 1200 / 630; height: auto; }
  .blog-side { grid-template-columns: 1fr; }
  .blog-search { flex-basis: 100%; }
  .blog-list-head { flex-wrap: wrap; }
}
.post-small .post-body { flex: 1; }

/* archive: every article as a plain link, so each post is within three clicks of the home page */
.blog-archive { margin-top: 38px; padding-top: 26px; border-top: 1px solid var(--line); }
.blog-archive h2 { font-size: 1.25rem; margin: 0 0 14px; }
.blog-archive ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; }
.blog-archive li { break-inside: avoid; padding: 7px 0; font-size: .92rem; line-height: 1.4; }
.blog-archive a { color: var(--ink); font-weight: 600; }
.blog-archive a:hover { color: var(--teal-700); }
.blog-archive time { display: block; color: var(--muted, #6b7a99); font-size: .78rem; font-weight: 400; margin-top: 2px; }
@media (max-width: 700px) { .blog-archive ul { columns: 1; } }
