/* SayShan blog (public) — theme tokens only, logical properties. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.blog-hero { padding: 150px 0 34px; text-align: center; background: radial-gradient(circle at 50% 20%, rgba(138, 43, 226, .16), transparent 60%); }
.blog-hero h1 { font-size: clamp(32px, 6vw, 54px); font-weight: 900; margin: 0 0 12px; }
.blog-hero p { max-width: 620px; margin: 0 auto; color: var(--text-secondary); font-size: 17px; line-height: 1.6; hyphens: manual; }
.blog-search { position: relative; display: flex; align-items: center; max-width: 520px; margin: 28px auto 0; border-radius: 50px; padding: 5px 5px 5px 20px;
    background: rgba(var(--ink-rgb), .07); border: 1px solid rgba(var(--ink-rgb), .15); transition: border-color .2s, box-shadow .2s; }
[dir="rtl"] .blog-search { padding: 5px 20px 5px 5px; }
.blog-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(var(--ink-rgb), .08); }
.blog-search > svg, .blog-search > i { color: var(--text-soft); width: 16px; height: 16px; margin-inline-end: 10px; flex: none; }
.blog-search input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; font: inherit; font-size: 16px; color: var(--text-primary); padding: 10px 0; }
.blog-search input::placeholder { color: var(--text-soft); }
.blog-search button { border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 15px; padding: 10px 22px; border-radius: 50px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--secondary)); }

.blog-wrap { padding-block-end: 20px; }
.blog-card, .blog-featured { text-decoration: none; color: inherit; }
.blog-card h2, .blog-card p, .blog-featured h2, .blog-featured p { hyphens: manual; }

/* featured (latest) article */
.blog-featured { display: grid; grid-template-columns: 1.15fr 1fr; margin-block: 34px 8px; border-radius: 26px; overflow: hidden;
    background: rgba(var(--ink-rgb), .05); border: 1px solid rgba(var(--ink-rgb), .1); transition: transform .3s, border-color .3s, box-shadow .3s; }
.blog-featured:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 24px 60px rgba(0, 0, 0, .18); }
.blog-featured-img { position: relative; min-height: 280px; background: linear-gradient(135deg, rgba(0, 194, 255, .25), rgba(138, 43, 226, .25)); overflow: hidden; }
.blog-featured-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.blog-featured:hover .blog-featured-img img { transform: scale(1.04); }
.blog-featured-body { padding: 36px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.blog-featured h2 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.25; margin: 0; color: var(--text-primary); }
.blog-featured p { margin: 0; font-size: 16px; line-height: 1.65; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.blog-badges { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.blog-pill { padding: 5px 13px; border-radius: 50px; font-size: 12px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--primary); background: rgba(var(--ink-rgb), .08); border: 1px solid rgba(var(--ink-rgb), .12); }

/* grid cards */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; padding: 28px 0 60px; }
.blog-card { display: flex; flex-direction: column; border-radius: 20px; overflow: hidden;
    background: rgba(var(--ink-rgb), .05); border: 1px solid rgba(var(--ink-rgb), .1); transition: transform .25s, border-color .25s, box-shadow .25s; }
.blog-card:hover { transform: translateY(-6px); border-color: var(--primary); box-shadow: 0 18px 44px rgba(0, 0, 0, .16); }
.blog-card-img { position: relative; aspect-ratio: 16/9; overflow: hidden; background: linear-gradient(135deg, rgba(0, 194, 255, .25), rgba(138, 43, 226, .25)); }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.blog-card:hover .blog-card-img img { transform: scale(1.05); }
.blog-card-body { padding: 20px 22px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.blog-card h2 { font-size: 18px; margin: 0; line-height: 1.35; color: var(--text-primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.blog-card p { margin: 0; font-size: 14.5px; color: var(--text-secondary); line-height: 1.6; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-start: auto; padding-block-start: 12px; border-block-start: 1px solid rgba(var(--ink-rgb), .09); }
.blog-meta { font-size: 13px; color: var(--text-soft); }
.blog-more { color: var(--primary); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.blog-more svg, .blog-more i { width: 14px; height: 14px; transition: transform .25s; }
.blog-card:hover .blog-more svg, .blog-featured:hover .blog-more svg, .blog-card:hover .blog-more i, .blog-featured:hover .blog-more i { transform: translateX(4px); }
[dir="rtl"] .blog-more svg, [dir="rtl"] .blog-more i { transform: scaleX(-1); }
[dir="rtl"] .blog-card:hover .blog-more svg, [dir="rtl"] .blog-featured:hover .blog-more svg { transform: scaleX(-1) translateX(4px); }
.blog-empty { text-align: center; padding: 70px 0 120px; color: var(--text-secondary); }
.blog-pager { display: flex; justify-content: center; padding-block-end: 60px; }

@media (max-width: 860px) {
    .blog-featured { grid-template-columns: 1fr; }
    .blog-featured-img { min-height: 0; aspect-ratio: 16/9; }
    .blog-featured-body { padding: 24px; }
}
@media (max-width: 600px) {
    .blog-hero { padding-top: 120px; }
    .blog-grid { grid-template-columns: 1fr; }
}

.post-hero { padding: 140px 0 30px; text-align: center; }
.post-hero h1 { font-size: clamp(30px, 5vw, 48px); font-weight: 900; margin: 12px auto 14px; max-width: 880px; line-height: 1.2; }
.post-lead { max-width: 720px; margin: 0 auto 14px; font-size: 19px; line-height: 1.6; color: var(--text-secondary); }
.post-crumbs { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; font-size: 14px; margin-block-end: 18px; color: var(--text-soft); }
.post-crumbs a { color: var(--text-secondary); text-decoration: none; }
.post-crumbs a:hover { color: var(--primary); }
.post-cover { max-width: 960px; margin: 10px auto 0; padding-inline: 20px; }
.post-cover img { width: 100%; height: auto; border-radius: 22px; display: block; box-shadow: 0 24px 60px rgba(0, 0, 0, .22); animation: coverIn .9s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes coverIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

.read-progress { position: fixed; inset-block-start: 0; inset-inline: 0; height: 4px; z-index: 1200; background: transparent; pointer-events: none; }
.read-progress span { display: block; height: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--primary), var(--secondary)); }
[dir="rtl"] .read-progress span { transform-origin: right; }

.post-layout { max-width: 1120px; margin: 40px auto 20px; padding-inline: 20px; display: grid; grid-template-columns: 250px minmax(0, 760px); gap: 48px; justify-content: center; }
.post-layout:not(:has(.post-toc)) { grid-template-columns: minmax(0, 760px); }
.post-toc { position: sticky; inset-block-start: 110px; align-self: start; max-height: calc(100vh - 140px); overflow-y: auto; padding: 18px 18px 14px; border-radius: 16px;
    background: rgba(var(--ink-rgb), .05); border: 1px solid rgba(var(--ink-rgb), .1); font-size: 14px; }
.post-toc strong { display: block; margin-block-end: 8px; color: var(--text-primary); }
.post-toc ol { list-style: none; margin: 0; padding: 0; }
.post-toc li { margin: 2px 0; }
.post-toc li.l3 { padding-inline-start: 14px; font-size: 13px; }
.post-toc a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text-secondary); text-decoration: none; border-inline-start: 2px solid transparent; line-height: 1.4; transition: background .2s, color .2s; }
.post-toc a:hover { color: var(--text-primary); background: rgba(var(--ink-rgb), .06); }
.post-toc a.active { color: var(--primary); border-inline-start-color: var(--primary); background: rgba(var(--ink-rgb), .07); font-weight: 600; }
.post-main { min-width: 0; }

.post-body { font-size: 18px; line-height: 1.85; color: var(--text-body); overflow-wrap: anywhere; }
.post-body > * { margin-block: 0 1.1em; }
.post-body h2, .post-body h3 { color: var(--text-primary); margin: 2em 0 .6em; line-height: 1.3; scroll-margin-top: 100px; }
.post-body h2 { font-size: 28px; padding-inline-start: 16px; border-inline-start: 4px solid var(--primary); }
.post-body h3 { font-size: 22px; }
.post-body ul, .post-body ol { padding-inline-start: 1.4em; }
.post-body li { margin-block: .45em; }
.post-body li::marker { color: var(--primary); font-weight: 700; }
.post-body a { color: var(--primary); }
.post-body img { max-width: 100%; height: auto; border-radius: 12px; }
.post-body pre { overflow-x: auto; padding: 16px; border-radius: 12px; background: rgba(var(--ink-rgb), .08); font-size: 15px; line-height: 1.6; }
.post-body code { background: rgba(var(--ink-rgb), .08); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.post-body pre code { background: none; padding: 0; }
.post-body blockquote { margin-inline: 0; padding: 14px 20px; border-inline-start: 4px solid var(--secondary); background: rgba(var(--ink-rgb), .05); border-radius: 0 12px 12px 0; color: var(--text-secondary); }
[dir="rtl"] .post-body blockquote { border-radius: 12px 0 0 12px; }
.post-body table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.post-body th, .post-body td { padding: 10px 14px; border: 1px solid rgba(var(--ink-rgb), .14); text-align: start; }
.post-body th { background: rgba(var(--ink-rgb), .07); color: var(--text-primary); }
.post-body hr { border: 0; height: 1px; background: rgba(var(--ink-rgb), .15); margin-block: 2em; }
.post-fig { margin: 2em 0 !important; }
.post-fig img { width: 100%; border-radius: 16px; display: block; box-shadow: 0 14px 40px rgba(0, 0, 0, .18); }
.post-fig figcaption { margin-block-start: 10px; text-align: center; font-size: 14px; color: var(--text-soft); }

.post-share { display: flex; align-items: center; gap: 10px; margin-block: 36px 0; padding-block-start: 24px; border-block-start: 1px solid rgba(var(--ink-rgb), .12); color: var(--text-secondary); font-weight: 600; }
.post-share span { margin-inline-end: 6px; }
.post-share a { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--text-primary); background: rgba(var(--ink-rgb), .08); text-decoration: none; transition: transform .2s, background .2s, color .2s; }
.post-share a:hover { transform: translateY(-3px); background: var(--primary); color: #fff; }
.post-cta { margin-block-start: 36px; padding: 32px; border-radius: 22px; text-align: center; background: linear-gradient(135deg, rgba(0, 194, 255, .14), rgba(138, 43, 226, .14)); border: 1px solid rgba(var(--ink-rgb), .12); }
.post-cta h2 { margin: 0 0 8px; font-size: 24px; }
.post-cta p { margin: 0 auto 20px; max-width: 520px; color: var(--text-secondary); }
.post-back { max-width: 1120px; margin: 20px auto 60px; padding-inline: 20px; }
.post-back a { color: var(--primary); text-decoration: none; font-weight: 600; }
.post-related { max-width: 1200px; margin: 0 auto; padding: 0 20px 80px; }

/* ---------- pagination ---------- */
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pager .pg { min-width: 42px; height: 42px; padding-inline: 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; font-weight: 600; text-decoration: none;
    color: var(--text-primary); background: rgba(var(--ink-rgb), .06); border: 1px solid rgba(var(--ink-rgb), .12); transition: transform .2s, border-color .2s; }
.pager a.pg:hover { transform: translateY(-2px); border-color: var(--primary); }
.pager .pg.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.pager .pg.disabled { opacity: .45; }
.pager .pg.dots { background: none; border: 0; }

@media (max-width: 960px) {
    .post-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .post-toc { position: static; max-height: none; }
}
@media (max-width: 600px) { .post-body { font-size: 17px; } .post-body h2 { font-size: 24px; } .post-hero { padding-top: 120px; } }
@media (prefers-reduced-motion: reduce) { .post-cover img { animation: none; } .read-progress span { transition: none; } }

/* ---------- categories ---------- */
.blog-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 4px; }
.blog-filter .chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 50px; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap;
    color: var(--text-secondary); background: rgba(var(--ink-rgb), .06); border: 1px solid rgba(var(--ink-rgb), .12); transition: transform .2s, border-color .2s, color .2s; }
.blog-filter .chip span { font-size: 12px; padding: 1px 8px; border-radius: 50px; background: rgba(var(--ink-rgb), .1); }
.blog-filter .chip:hover { transform: translateY(-2px); border-color: var(--primary); color: var(--text-primary); }
.blog-filter .chip.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.blog-filter .chip.active span { background: rgba(255, 255, 255, .25); }
.blog-tag { --tag: var(--primary); position: absolute; inset-block-start: 14px; inset-inline-start: 14px; padding: 5px 13px; border-radius: 50px; font-size: 12px; font-weight: 700;
    color: #fff; background: var(--tag); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); text-decoration: none; }
.blog-tag.static { position: static; display: inline-block; margin-block-end: 6px; }
[data-accent="cyan"] { --tag: #0891b2; }
[data-accent="violet"] { --tag: #7c3aed; }
[data-accent="pink"] { --tag: #db2777; }
[data-accent="green"] { --tag: #059669; }
[data-accent="amber"] { --tag: #d97706; }
[data-accent="indigo"] { --tag: #4f46e5; }

@media (max-width: 700px) {
    .blog-filter { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; margin-inline: -20px; padding-inline: 20px; }
    .blog-filter::-webkit-scrollbar { display: none; }
}
