/* =====================================================================
   CalnetCorp Blog — shared stylesheet for every /blog/** template.
   Depends on the same :root CSS vars declared in each HTML page's
   inline <style>. Loaded async via media=print onload from blog pages.
   ===================================================================== */

/* ---------- Layout shell ---------- */
.blog-shell { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 640px) { .blog-shell { padding: 0 20px; } }

.breadcrumbs {
  font-size: 13px; color: var(--mute); letter-spacing: .01em;
  padding: 20px 0 0; display: flex; flex-wrap: wrap; gap: 6px;
}
.breadcrumbs a { color: var(--mute); border-bottom: 1px solid transparent; }
.breadcrumbs a:hover { color: var(--purple); border-bottom-color: var(--purple-soft); }
.breadcrumbs span[aria-hidden] { color: var(--mute-2); }
.breadcrumbs [aria-current] { color: var(--ink); font-weight: 500; }

/* ---------- Post head ---------- */
.post-head { max-width: 760px; margin: 0 auto; padding: 48px 0 32px; text-align: left; }
@media (max-width: 640px) { .post-head { padding: 32px 0 24px; } }
.post-cluster {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: var(--purple-soft); color: var(--purple);
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  margin-bottom: 20px;
}
h1.post-h1 {
  font-family: 'Fraunces', serif; font-weight: 400;
  font-size: clamp(36px, 5vw, 56px); line-height: 1.04; letter-spacing: -0.035em;
  margin: 0 0 16px; color: var(--ink); text-wrap: balance;
}
.post-meta {
  display: flex; flex-wrap: wrap; gap: 18px; margin: 20px 0 0;
  font-size: 14px; color: var(--mute);
}
.post-meta .byline { display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
.post-meta .byline img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.post-meta .byline a { color: var(--ink); font-weight: 500; border-bottom: 1px dotted var(--line); }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--mute-2); align-self: center; }

/* Answer-first paragraph (under H1) */
.answer-first {
  max-width: 760px; margin: 28px auto 0;
  background: var(--purple-wash);
  border-left: 3px solid var(--purple);
  padding: 20px 24px;
  border-radius: 0 10px 10px 0;
  font-size: 17.5px; line-height: 1.55;
  color: var(--ink); font-weight: 500;
}
.answer-first strong { color: var(--purple-deep); }

/* Key takeaways */
.takeaways {
  max-width: 760px; margin: 32px auto 0;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 24px 28px;
}
.takeaways h2 {
  font-family: 'Inter', sans-serif; font-weight: 600;
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--purple); margin: 0 0 14px; display: inline-flex; align-items: center; gap: 8px;
}
.takeaways h2::before { content: ""; width: 20px; height: 1px; background: var(--purple); }
.takeaways ul { margin: 0; padding: 0; list-style: none; }
.takeaways li {
  padding: 8px 0 8px 28px; position: relative; color: var(--ink-2); font-size: 15.5px; line-height: 1.5;
}
.takeaways li::before {
  content: "→"; position: absolute; left: 0; top: 8px;
  color: var(--purple); font-weight: 600;
}

/* Hero image */
.post-hero {
  max-width: 1120px; margin: 40px auto 0;
  border-radius: 16px; overflow: hidden;
  background: var(--cream-2);
  aspect-ratio: 16 / 9;
  box-shadow: 0 30px 60px -30px rgba(29,29,31,.2);
}
.post-hero img, .post-hero picture { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-hero-caption {
  max-width: 1120px; margin: 10px auto 0;
  font-size: 12.5px; color: var(--mute); padding: 0 8px;
}
.post-hero-caption em { font-style: normal; color: var(--ink-2); }

/* ---------- Body layout ---------- */
.post-body-wrap {
  max-width: 1100px; margin: 48px auto 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 240px;
  gap: 64px; align-items: start;
}
@media (max-width: 960px) {
  .post-body-wrap { grid-template-columns: 1fr; gap: 32px; }
}

.post-body {
  max-width: 720px; font-size: 17px; line-height: 1.7; color: var(--ink-2);
}
.post-body p { margin: 0 0 24px; }
.post-body h2 {
  font-family: 'Fraunces', serif; font-weight: 500;
  font-size: clamp(26px, 3.2vw, 34px); letter-spacing: -0.02em; line-height: 1.15;
  color: var(--ink); margin: 48px 0 16px; scroll-margin-top: 90px;
}
.post-body h2 a.anchor {
  color: var(--mute-2); margin-left: 8px; font-size: 0.7em;
  opacity: 0; transition: opacity .2s;
}
.post-body h2:hover a.anchor { opacity: 1; }
.post-body h3 {
  font-family: 'Inter', sans-serif; font-weight: 600;
  font-size: 20px; letter-spacing: -0.01em; color: var(--ink);
  margin: 36px 0 12px; scroll-margin-top: 90px;
}
.post-body a:not(.btn) { color: var(--purple); border-bottom: 1px solid var(--purple-soft); }
.post-body a:not(.btn):hover { border-bottom-color: var(--purple); }
.post-body ul, .post-body ol { margin: 0 0 24px; padding-left: 22px; }
.post-body ul li, .post-body ol li { margin-bottom: 10px; }
.post-body strong { color: var(--ink); font-weight: 600; }
.post-body code {
  background: var(--cream-2); padding: 2px 6px; border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.9em;
}
.post-body img, .post-body picture {
  display: block; max-width: 100%; height: auto;
  border-radius: 10px; margin: 32px 0; border: 1px solid var(--line);
}
.post-body figcaption { font-size: 13px; color: var(--mute); margin-top: -20px; margin-bottom: 32px; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }

/* Citation capsule */
.citation {
  margin: 32px 0; padding: 24px 28px;
  background: var(--purple-wash); border: 1px solid rgba(144,59,212,.18);
  border-left: 4px solid var(--purple); border-radius: 0 12px 12px 0;
  font-family: 'Fraunces', serif; font-weight: 400;
  font-size: 19px; line-height: 1.5; color: var(--ink);
  quotes: "\201C" "\201D";
  position: relative;
}
.citation::before {
  content: open-quote; position: absolute; left: 14px; top: 10px;
  font-size: 40px; color: var(--purple); line-height: 1; opacity: .4;
}
.citation p { margin: 0 0 8px; }
.citation footer { font-size: 13px; color: var(--mute); font-family: 'Inter', sans-serif; font-weight: 400; }

/* Sticky TOC (right column) */
.toc {
  position: sticky; top: 90px;
  font-size: 14px; line-height: 1.45;
  max-height: calc(100vh - 120px); overflow-y: auto;
  padding: 16px 0; border-top: 1px solid var(--line);
}
.toc h2 {
  font-family: 'Inter', sans-serif; font-weight: 600;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--purple); margin: 0 0 14px;
}
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; padding: 4px 0; position: relative; padding-left: 28px; }
.toc li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute; left: 0; top: 4px;
  font-family: 'Fraunces', serif; font-size: 12px; color: var(--mute-2);
}
.toc a { color: var(--ink-2); border-bottom: 1px solid transparent; }
.toc a:hover, .toc a.active { color: var(--purple); border-bottom-color: var(--purple-soft); }
.toc .toc-h3 { padding-left: 40px; font-size: 13px; color: var(--mute); }
@media (max-width: 960px) {
  .toc {
    position: static; max-height: none; padding: 18px 22px;
    background: var(--cream-2); border-radius: 12px; border: 1px solid var(--line-2); border-top: 0;
  }
}

/* Reading progress bar */
.read-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--purple); z-index: 60; transition: width .15s ease;
}

/* ---------- Charts ---------- */
.chart { margin: 36px 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.chart .chart-title { font-family: 'Fraunces', serif; font-weight: 500; font-size: 18px; letter-spacing: -0.01em; margin: 0 0 4px; color: var(--ink); }
.chart .chart-sub { font-size: 13px; color: var(--mute); margin: 0 0 18px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart-source { font-size: 12px; color: var(--mute); margin-top: 12px; }
.chart-source a { color: var(--mute); border-bottom: 1px dotted var(--line); }

/* ---------- FAQ ---------- */
.post-faq { max-width: 760px; margin: 64px auto 0; }
.post-faq h2 {
  font-family: 'Fraunces', serif; font-weight: 400;
  font-size: clamp(28px, 3.5vw, 40px); letter-spacing: -0.025em;
  margin: 0 0 24px; color: var(--ink);
}
.post-faq .faq-list { border-top: 1px solid var(--line); }
.post-faq .faq-item { border-bottom: 1px solid var(--line); }
.post-faq .faq-q {
  width: 100%; text-align: left; background: transparent; border: 0;
  padding: 20px 0; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 17px;
  color: var(--ink); cursor: pointer; line-height: 1.4;
}
.post-faq .faq-q .ic {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line); display: grid; place-items: center;
  flex-shrink: 0; transition: all .2s ease; color: var(--ink-2);
}
.post-faq .faq-item.open .faq-q .ic { background: var(--purple); border-color: var(--purple); color: #fff; transform: rotate(45deg); }
.post-faq .faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.post-faq .faq-a-inner { padding: 0 0 20px; color: var(--ink-2); font-size: 16px; line-height: 1.6; max-width: 680px; }

/* ---------- Inline email capture ---------- */
.email-cap {
  max-width: 760px; margin: 56px auto;
  background: var(--ink); color: #fff; border-radius: 16px;
  padding: 32px; position: relative; overflow: hidden;
}
.email-cap::before {
  content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px;
  border-radius: 50%; background: radial-gradient(circle, rgba(144,59,212,.4) 0%, rgba(144,59,212,0) 60%);
}
.email-cap h3 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 24px; letter-spacing: -0.02em; margin: 0 0 6px; color: #fff; }
.email-cap p { color: #c7c7ca; font-size: 14.5px; margin: 0 0 18px; max-width: 440px; }
.email-cap form { display: flex; gap: 10px; flex-wrap: wrap; position: relative; }
.email-cap input {
  flex: 1 1 240px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  color: #fff; padding: 12px 14px; border-radius: 999px; font-family: inherit; font-size: 14.5px;
}
.email-cap input::placeholder { color: #9a9aa0; }
.email-cap input:focus { outline: none; border-color: var(--purple); background: rgba(0,0,0,.4); }
.email-cap button {
  background: var(--purple); color: #fff; border: 0; border-radius: 999px;
  padding: 12px 22px; font-weight: 500; font-size: 14.5px; cursor: pointer;
}

/* ---------- Related posts ---------- */
.related {
  max-width: 1120px; margin: 64px auto 0; padding-top: 32px;
  border-top: 1px solid var(--line);
}
.related h2 {
  font-family: 'Fraunces', serif; font-weight: 400;
  font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.02em;
  margin: 0 0 24px; color: var(--ink);
}
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 820px) { .related-grid { grid-template-columns: 1fr; } }
.related-card {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; transition: border-color .2s, transform .2s;
}
.related-card:hover { border-color: var(--purple); transform: translateY(-2px); }
.related-card .cl { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--purple); margin-bottom: 8px; }
.related-card h3 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 18px; letter-spacing: -0.015em; line-height: 1.25; margin: 0 0 8px; color: var(--ink); }
.related-card p { font-size: 13.5px; color: var(--mute); margin: 0; line-height: 1.5; }

/* ---------- End CTA ---------- */
.post-cta {
  max-width: 1120px; margin: 48px auto 40px;
  background: var(--ink); color: #fff; border-radius: 24px;
  padding: 56px; position: relative; overflow: hidden;
}
@media (max-width: 640px) { .post-cta { padding: 40px 28px; } }
.post-cta::before {
  content: ""; position: absolute; right: -80px; bottom: -80px; width: 360px; height: 360px;
  border-radius: 50%; background: radial-gradient(circle, rgba(144,59,212,.5) 0%, rgba(144,59,212,0) 60%);
}
.post-cta h2 { font-family: 'Fraunces', serif; font-weight: 400; font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.025em; margin: 0 0 14px; color: #fff; max-width: 600px; position: relative; }
.post-cta h2 em { color: #d9b6f7; font-style: italic; }
.post-cta p { color: #c7c7ca; max-width: 500px; margin: 0 0 24px; font-size: 16px; position: relative; }
.post-cta .btn-purple { position: relative; }

/* ---------- Blog index / Category pages ---------- */
.blog-hero {
  max-width: 1120px; margin: 0 auto; padding: 72px 28px 40px;
  text-align: center;
}
@media (max-width: 640px) { .blog-hero { padding: 48px 20px 28px; } }
.blog-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 10px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2);
}
.blog-hero .eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--purple); }
.blog-hero h1 {
  font-family: 'Fraunces', serif; font-weight: 400;
  font-size: clamp(40px, 5.4vw, 68px); line-height: 0.98; letter-spacing: -0.035em;
  margin: 22px 0 18px; color: var(--ink); text-wrap: balance;
}
.blog-hero h1 em { color: var(--purple); font-style: italic; }
.blog-hero p { color: var(--ink-2); font-size: 17px; max-width: 600px; margin: 0 auto; line-height: 1.55; }

/* Cluster filter chips */
.cluster-filter { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 32px 0 0; }
.cluster-filter a {
  display: inline-block; padding: 8px 16px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  font-size: 13.5px; color: var(--ink-2); transition: all .2s;
}
.cluster-filter a:hover { border-color: var(--purple); color: var(--purple); }
.cluster-filter a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Featured pillar */
.pillar-feature {
  max-width: 1120px; margin: 56px auto 0;
  background: linear-gradient(135deg, var(--purple-wash) 0%, #fff 100%);
  border: 1px solid var(--line); border-radius: 20px; padding: 40px;
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
}
@media (max-width: 820px) { .pillar-feature { grid-template-columns: 1fr; } }
.pillar-feature .lbl { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--purple); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; }
.pillar-feature h2 { font-family: 'Fraunces', serif; font-weight: 400; font-size: clamp(28px, 3.5vw, 40px); letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 12px; color: var(--ink); }
.pillar-feature p { color: var(--ink-2); font-size: 16px; margin: 0 0 20px; max-width: 560px; }

/* Post grid */
.post-grid { max-width: 1120px; margin: 48px auto 0; padding: 0 28px; }
.post-grid-title {
  font-family: 'Inter', sans-serif; font-weight: 600;
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--purple); margin: 0 0 20px;
}
.post-grid .grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
@media (max-width: 900px) { .post-grid .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .post-grid .grid { grid-template-columns: 1fr; } }
.post-card {
  display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.post-card:hover { border-color: var(--purple); transform: translateY(-3px); box-shadow: 0 24px 52px -30px rgba(29,29,31,.25); }
.post-card .thumb { aspect-ratio: 16/9; background: var(--cream-2); overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .meta { padding: 20px 22px 22px; }
.post-card .cluster { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--purple); margin-bottom: 10px; }
.post-card h3 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 19px; letter-spacing: -0.015em; line-height: 1.25; margin: 0 0 10px; color: var(--ink); }
.post-card p { color: var(--mute); font-size: 13.5px; margin: 0 0 14px; line-height: 1.5; }
.post-card .rt { font-size: 12px; color: var(--mute-2); }

/* ---------- Author byline card (post bottom) ---------- */
.author-card {
  max-width: 760px; margin: 56px auto 0;
  background: var(--cream-2); border: 1px solid var(--line-2); border-radius: 16px;
  padding: 24px 28px;
  display: grid; grid-template-columns: 72px 1fr; gap: 20px; align-items: center;
}
.author-card img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.author-card .n { font-family: 'Fraunces', serif; font-weight: 500; font-size: 20px; letter-spacing: -0.015em; margin: 0 0 4px; color: var(--ink); }
.author-card .r { font-size: 13px; color: var(--mute); margin: 0 0 8px; }
.author-card .bio { font-size: 14.5px; color: var(--ink-2); line-height: 1.55; margin: 0; }
.author-card a { color: var(--purple); border-bottom: 1px solid var(--purple-soft); }

/* "Back to pillar" link on spoke posts */
.back-to-pillar {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 40px 0;
  padding: 14px 20px; border-radius: 10px;
  background: var(--purple-wash); border: 1px solid rgba(144,59,212,.2);
  color: var(--purple-deep); font-size: 14.5px;
}
.back-to-pillar:hover { background: var(--purple-soft); border-color: var(--purple); }
.back-to-pillar strong { color: var(--ink); font-weight: 500; }
