/* ==========================================================================
   CST Solution blog. Tokens are copied from CST-Website/src/styles.css so the
   blog and cstsolution.com read as one site. Change them in both places.
   ========================================================================== */
:root {
  --bg: #ffffff; --bg-alt: #f5f7fa; --surface: #ffffff; --surface-2: #f0f3f7;
  --border: #e2e7ee; --border-strong: #cdd5e0;
  --text: #101828; --text-dim: #55607a; --text-faint: #7b869c;
  --accent: #0f7d8c; --accent-2: #1264c4; --accent-soft: rgba(15,125,140,.10); --on-accent: #ffffff;
  --wa: #1fa855; --wa-hover: #17904a;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px -12px rgba(16,24,40,.18);
  --shadow-lg: 0 2px 4px rgba(16,24,40,.05), 0 24px 48px -24px rgba(16,24,40,.28);
  --radius: 14px; --radius-lg: 22px; --wrap: 1140px; --narrow: 720px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  /* code */
  --code-bg: #f6f8fb; --code-border: #e2e7ee; --code-text: #1f2937; --inline-code-bg: #eef2f7;
  --tk: #8a3ffc; --ts: #0a7d45; --tn: #b54708; --tc: #7b869c; --tv: #1264c4; --tt: #0f7d8c;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --bg-alt: #0e1729; --surface: #121c30; --surface-2: #16223a;
    --border: #22304c; --border-strong: #33456a;
    --text: #eaf0fa; --text-dim: #a3b1c9; --text-faint: #7d8caa;
    --accent: #3ddbe6; --accent-2: #6aa8ff; --accent-soft: rgba(61,219,230,.12); --on-accent: #04121a;
    --wa: #2ac567; --wa-hover: #22ad59;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 48px -24px rgba(0,0,0,.75);
    --code-bg: #0e1729; --code-border: #22304c; --code-text: #dbe4f3; --inline-code-bg: #16223a;
    --tk: #c9a2ff; --ts: #7ee2a8; --tn: #f5b56b; --tc: #7d8caa; --tv: #8cc2ff; --tt: #5fe3ec;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --bg-alt: #0e1729; --surface: #121c30; --surface-2: #16223a;
  --border: #22304c; --border-strong: #33456a;
  --text: #eaf0fa; --text-dim: #a3b1c9; --text-faint: #7d8caa;
  --accent: #3ddbe6; --accent-2: #6aa8ff; --accent-soft: rgba(61,219,230,.12); --on-accent: #04121a;
  --wa: #2ac567; --wa-hover: #22ad59;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 48px -24px rgba(0,0,0,.75);
  --code-bg: #0e1729; --code-border: #22304c; --code-text: #dbe4f3; --inline-code-bg: #16223a;
  --tk: #c9a2ff; --ts: #7ee2a8; --tn: #f5b56b; --tc: #7d8caa; --tv: #8cc2ff; --tt: #5fe3ec;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
       font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { max-width: 100%; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); font-weight: 800; }
p { margin: 0 0 1rem; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 22px; }
.wrap-narrow { width: 100%; max-width: calc(var(--narrow) + 44px); margin-inline: auto; padding-inline: 22px; }
.wrap-wide { width: 100%; max-width: 1000px; margin-inline: auto; padding-inline: 22px; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.meta { color: var(--text-faint); font-size: .88rem; margin: 0; }
.eyebrow { font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 .7rem; }
.eyebrow a { color: inherit; }
.lede { font-size: clamp(1.02rem, 1.5vw, 1.14rem); color: var(--text-dim); max-width: 64ch; }

/* ---------- header (matches cstsolution.com) ---------- */
.site-header { position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 20px; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; letter-spacing: -.02em; }
.brand:hover, .footer-brand .brand-text:hover { text-decoration: none; }
.brand-mark { color: var(--accent); display: inline-flex; }
.brand-text { font-size: 1.06rem; color: var(--text); font-weight: 750; }
.brand-dim { color: var(--text-faint); font-weight: 500; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--text-dim); font-size: .93rem; font-weight: 550; padding: 8px 12px; border-radius: 9px; }
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
  background: transparent; color: var(--text-dim); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .i-sun { display: none; } :root:not([data-theme="light"]) .theme-toggle .i-moon { display: block; } }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: .93rem; font-weight: 600;
  padding: 10px 18px; border-radius: 11px; border: 1px solid transparent; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-hover); }

.mnav { display: none; }
.mnav > summary { list-style: none; }
.mnav > summary::-webkit-details-marker { display: none; }
.menu-toggle { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 38px; height: 36px; padding: 0 9px;
  cursor: pointer; border: 1px solid var(--border); border-radius: 10px; }
.menu-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.mnav[open] .menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mnav[open] .menu-toggle span:nth-child(2) { opacity: 0; }
.mnav[open] .menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.mobile-nav { position: absolute; left: 0; right: 0; top: 66px; display: flex; flex-direction: column;
  border-block: 1px solid var(--border); background: var(--bg); padding: 8px 22px 16px; box-shadow: var(--shadow); }
.mobile-nav a { padding: 12px 4px; color: var(--text); font-weight: 550; border-bottom: 1px solid var(--border); }
.mobile-nav a:last-child { border-bottom: 0; }

.subnav { border-top: 1px solid var(--border); }
.subnav-inner { display: flex; gap: 4px 6px; overflow-x: auto; scrollbar-width: none; padding-block: 6px; }
.subnav-inner::-webkit-scrollbar { display: none; }
.subnav a { flex: none; color: var(--text-dim); font-size: .88rem; font-weight: 600; padding: 6px 11px; border-radius: 8px; }
.subnav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.subnav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* ---------- hero / list pages ---------- */
.hero { padding: clamp(40px, 7vw, 76px) 0 clamp(26px, 4vw, 40px); }
.hero-sm { padding-bottom: 20px; }
.hero h1 { max-width: 22ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.4rem; }
.chip { font-size: .84rem; font-weight: 600; color: var(--text-dim); background: var(--surface); border: 1px solid var(--border);
  padding: 6px 13px; border-radius: 999px; }
.chip:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.author-hero { display: flex; gap: 22px; align-items: flex-start; }
.author-role { color: var(--text-dim); font-weight: 600; margin: -.2rem 0 .6rem; }

.post-feed { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); padding-block: 12px 8px; }
.post-feed-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card-img { display: block; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { display: flex; flex-direction: column; padding: 18px 20px 20px; flex: 1; }
.card-body .eyebrow { margin-bottom: .45rem; font-size: .7rem; }
.card-title { font-size: 1.14rem; font-weight: 700; line-height: 1.3; margin: 0 0 .5rem; }
.card-title a { color: var(--text); }
.card-excerpt { color: var(--text-dim); font-size: .93rem; line-height: 1.55; margin-bottom: .9rem;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .meta { margin-top: auto; font-size: .82rem; }

.pager { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; margin: 34px 0 56px; }
.pager a, .pager span { padding: 7px 12px; border-radius: 9px; border: 1px solid var(--border); color: var(--text-dim); font-size: .92rem; line-height: 1.2; }
.pager a:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.pager .current { color: var(--on-accent); background: var(--accent); border-color: var(--accent); font-weight: 700; }
.pager .gap { border: 0; }

/* ---------- post ---------- */
.post { padding-top: clamp(32px, 6vw, 64px); }
.post-head h1 { font-size: clamp(1.85rem, 4.4vw, 2.7rem); }
.post-head .lede { margin-bottom: 1.4rem; }
.byline { display: flex; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.byline-name { margin: 0; font-weight: 600; font-size: .95rem; }
.byline-name a { color: var(--text); }
.byline-avatar:hover { text-decoration: none; }
.avatar { flex: none; border-radius: 50%; object-fit: cover; }
.avatar-initials { width: var(--s); height: var(--s); display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 750; font-size: calc(var(--s) * .38); letter-spacing: .02em;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.feature { margin: 30px auto 6px; }
.feature img { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface-2); }

.content { font-size: 1.07rem; line-height: 1.75; padding-top: 26px; overflow-wrap: break-word; }
.content > * { margin-top: 0; }
.content p, .content ul, .content ol, .content blockquote, .content .table-wrap, .content .codeblock { margin-bottom: 1.35rem; }
.content h2 { font-size: clamp(1.4rem, 3vw, 1.75rem); font-weight: 750; margin: 2.4rem 0 .8rem; scroll-margin-top: 130px; }
.content h3 { font-size: 1.22rem; font-weight: 700; margin: 2rem 0 .6rem; scroll-margin-top: 130px; }
.content h4 { font-size: 1.05rem; font-weight: 700; margin: 1.6rem 0 .5rem; }
.content a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.content ul, .content ol { padding-left: 1.4rem; }
.content li { margin-bottom: .4rem; }
.content li > ul, .content li > ol { margin: .4rem 0 0; }
.content strong { font-weight: 700; }
.content hr { border: 0; border-top: 1px solid var(--border); margin: 2.4rem 0; }
.content img { display: block; height: auto; margin: 1.6rem auto; border-radius: 12px; }
.content blockquote { margin-left: 0; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--accent-soft);
  border-radius: 0 10px 10px 0; color: var(--text); }
.content blockquote > :last-child { margin-bottom: 0; }
.content :not(pre) > code { font-family: var(--mono); font-size: .88em; background: var(--inline-code-bg); padding: .12em .38em;
  border-radius: 6px; overflow-wrap: anywhere; }

.codeblock { position: relative; }
.codeblock pre { margin: 0; background: var(--code-bg); border: 1px solid var(--code-border); border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: .86rem; line-height: 1.6; color: var(--code-text);
  -moz-tab-size: 2; tab-size: 2; }
.codeblock pre code { font: inherit; background: none; padding: 0; white-space: pre; }
.codeblock[data-lang]::before { content: attr(data-lang); position: absolute; top: 0; right: 14px; transform: translateY(-50%);
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint);
  background: var(--bg); border: 1px solid var(--code-border); border-radius: 6px; padding: 1px 7px; }
.codeblock .copy { position: absolute; top: 8px; right: 8px; font-size: .74rem; font-weight: 600; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 3px 9px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.codeblock:hover .copy, .codeblock .copy:focus-visible { opacity: 1; }
@media (hover: none) { .codeblock .copy { display: none; } }
.tk { color: var(--tk); } .ts { color: var(--ts); } .tn { color: var(--tn); } .tc { color: var(--tc); font-style: italic; }
.tv { color: var(--tv); } .tt { color: var(--tt); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.content table { border-collapse: collapse; width: 100%; font-size: .93rem; line-height: 1.5; }
.content th, .content td { padding: 9px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.content th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
.content tr:last-child td { border-bottom: 0; }
.content td code { white-space: nowrap; overflow-wrap: normal; }

.post-foot { padding-top: 10px; padding-bottom: 20px; }
.post-foot .chips { margin: 8px 0 26px; }
.author-box { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg-alt); }
.author-box p { margin: 0; color: var(--text-dim); font-size: .93rem; }
.author-box .author-role { margin: 0 0 .4rem; font-size: .88rem; }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 26px; }
.pn { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); }
.pn:hover { border-color: var(--border-strong); text-decoration: none; background: var(--surface-2); }
.pn span { font-size: .8rem; color: var(--text-faint); font-weight: 600; }
.pn strong { font-size: .95rem; line-height: 1.35; }
.pn-next { text-align: right; }
.related { padding: 40px 0 60px; margin-top: 30px; border-top: 1px solid var(--border); }
.related h2 { font-size: 1.35rem; }
.page .content { padding-bottom: 10px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 40px 0 34px; margin-top: 30px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 22px 40px; align-items: flex-start; }
.footer-brand { flex: 1 1 260px; }
.footer-brand p { color: var(--text-faint); font-size: .9rem; margin: .4rem 0 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-nav a { color: var(--text-dim); font-size: .9rem; }
.footer-nav a:hover { color: var(--text); }
.copyright { flex-basis: 100%; color: var(--text-faint); font-size: .84rem; margin: 8px 0 0; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .nav { display: none; }
  .mnav { display: block; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 560px) {
  .wrap, .wrap-narrow, .wrap-wide { padding-inline: 16px; }
  .header-inner { gap: 12px; }
  .btn-wa { padding: 9px 11px; }
  .btn-wa span { display: none; }
  .content { font-size: 1.02rem; }
  .codeblock pre { font-size: .8rem; padding: 14px; border-radius: 10px; }
  .prevnext { grid-template-columns: 1fr; }
  .pn-next { text-align: left; }
  .author-hero { flex-direction: column; gap: 14px; }
  .feature { padding-inline: 0; }
  .feature img { border-radius: 0; border-inline: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition-duration: .001ms !important; } }
@media print {
  .site-header, .site-footer, .related, .prevnext, .copy { display: none !important; }
  .codeblock pre { white-space: pre-wrap; }
}
