/* ============================================================
   Insight Blog — public, SEO-facing blog section at /blog.
   Reuses the site design tokens (tokens.css: Lora/Inter, colors).
   Standalone from base.css so the blog module stays self-contained
   and easy for Tina + Claude to maintain.
   ============================================================ */

:root {
  --pod-radius: 20px;
  --card-radius: 14px;
  --blog-maxw: 1080px;
  --blog-readw: 720px;
  --pod-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 28px rgba(0,0,0,.06);
  --hairline: 1px solid var(--rule);
}

body { background: var(--white); color: var(--ink); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ---------- top bar ---------- */
.blog-topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 14px clamp(18px, 5vw, 44px);
  background: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.blog-topbar__brand { display: flex; align-items: center; }
.blog-topbar__logo { height: 30px; width: auto; }
.blog-topbar__sep {
  width: 1px; height: 22px; background: rgba(255,255,255,.22);
}
.blog-topbar__title {
  font-family: var(--font-head); font-weight: 600; font-size: 19px;
  color: #fff; letter-spacing: var(--track-head);
}
.blog-topbar__nav { margin-left: auto; display: flex; gap: 22px; align-items: center; }
.blog-topbar__nav a {
  color: rgba(255,255,255,.72); font-size: 15px; font-weight: 500; text-decoration: none;
}
.blog-topbar__nav a:hover { color: #fff; }
.blog-topbar__cta {
  background: var(--blue); color: #fff !important; padding: 9px 18px;
  border-radius: 22px; font-size: 14px;
}
.blog-topbar__cta:hover { background: var(--blue-dark); text-decoration: none; }
.blog-topbar__home {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: rgba(255,255,255,.78); transition: background .15s ease, color .15s ease;
}
.blog-topbar__home:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }

/* ---------- shared shell ---------- */
.blog-wrap { max-width: var(--blog-maxw); margin: 0 auto; padding: clamp(28px,5vw,56px) clamp(18px,5vw,44px) 72px; position: relative; }
.blog-read { max-width: var(--blog-readw); }

.blog-index { padding-top: clamp(18px, 2.5vw, 30px); }
/* Index / tag listing pages get a soft blue wash so the white cards lift off it */
.blog-index::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1100px 520px at 50% -140px, rgba(25,118,210,.10), transparent 70%),
    linear-gradient(180deg, #eef4fc 0%, #f7fafe 44%, var(--white) 100%);
}

/* ---------- flowing swirl motif (hero + article header) ---------- */
.blog-swirl {
  position: absolute; z-index: 0; pointer-events: none; opacity: .35;
  -webkit-mask-image: radial-gradient(ellipse 78% 92% at 50% 34%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 78% 92% at 50% 34%, #000 20%, transparent 78%);
}

/* ---------- index hero ---------- */
.blog-hero { position: relative; text-align: center; padding: 4px 0 46px; }
.blog-hero > *:not(.blog-swirl) { position: relative; z-index: 1; }
.blog-hero .blog-swirl {
  top: -46px; left: 50%; transform: translateX(-50%);
  width: 100vw; max-width: 1500px; height: 400px;
}
/* soft color glow behind the wordmark */
.blog-hero::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  top: 30px; left: 50%; transform: translateX(-50%);
  width: 560px; height: 260px; filter: blur(52px); opacity: .5;
  background:
    radial-gradient(circle at 32% 45%, rgba(0,179,255,.4), transparent 60%),
    radial-gradient(circle at 72% 40%, rgba(25,118,210,.34), transparent 62%);
}
.blog-hero__eyebrow {
  display: inline-block; margin-bottom: 18px;
  padding: 6px 16px; border-radius: 20px;
  background: rgba(25,118,210,.1); border: 1px solid rgba(25,118,210,.2);
  color: var(--blue); font-family: var(--font-sans); font-weight: 600;
  font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
}
.blog-hero h1 {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(38px, 5.4vw, 58px); letter-spacing: var(--track-head); line-height: 1.04;
}
.blog-hero .accent {
  background: linear-gradient(100deg, var(--blue) 0%, #00b3ff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--blue);
}
.blog-hero p {
  max-width: 640px; margin: 18px auto 0; color: var(--mid);
  font-size: var(--fs-deck); line-height: 1.5;
}

/* ---------- year picker ----------
   Default: a centered, wrapping row of year chips above the posts (all widths),
   so the grid stays centered under the title. On wide screens the picker becomes
   a vertical rail floated into the LEFT GUTTER (absolute) — the grid keeps its
   full centered width and isn't pushed right. */
.blog-layout { position: relative; }
.blog-main { width: 100%; }

.blog-years {
  display: flex; flex-flow: row wrap; justify-content: center; align-items: center;
  gap: 6px 7px; margin: -14px 0 22px;
}
.blog-year { display: flex; align-items: center; text-decoration: none; }
.blog-year:hover { text-decoration: none; }
.blog-year__track { display: none; }   /* bars only appear in rail mode */
.blog-year__label {
  padding: 4px 11px; border-radius: 16px; background: var(--surface);
  font-size: 12px; color: var(--mid); font-variant-numeric: tabular-nums;
  transition: color .15s ease, background .15s ease;
}
.blog-year:hover .blog-year__label { color: var(--ink); background: #e7e7ec; }
.blog-year--active .blog-year__label { background: rgba(25,118,210,.12); color: var(--blue); font-weight: 700; }
.blog-years:not(.blog-years--expanded) .blog-year--extra { display: none; }
.blog-years__toggle {
  border: none; cursor: pointer; background: var(--surface); color: var(--mid);
  font-size: 14px; line-height: 1; padding: 5px 12px; border-radius: 16px;
  letter-spacing: 1px; transition: color .15s ease, background .15s ease;
}
.blog-years__toggle:hover { color: var(--blue); background: #e7e7ec; }

@media (min-width: 1200px) {
  .blog-years {
    position: absolute; top: 2px; right: 100%; margin: 0 26px 0 0;
    flex-flow: column nowrap; align-items: stretch; justify-content: flex-start;
    gap: 2px; width: 82px;
  }
  .blog-year { height: 20px; gap: 8px; }
  .blog-year__track { display: flex; flex: 1; height: 7px; align-items: center; }
  .blog-year__bar {
    height: 7px; border-radius: 4px; background: #cfe0f5;
    transition: width .2s ease, background .15s ease;
  }
  .blog-year:hover .blog-year__bar { background: #9bc0ee; }
  .blog-year--active .blog-year__bar {
    background: linear-gradient(90deg, var(--blue) 0%, #00b3ff 100%);
    box-shadow: 0 2px 8px rgba(25,118,210,.3);
  }
  .blog-year__label {
    flex: 0 0 26px; text-align: right; padding: 0; background: none;
    border-radius: 0; font-size: 11px;
  }
  .blog-year:hover .blog-year__label { background: none; }
  .blog-year--active .blog-year__label { background: none; }
  .blog-years__toggle {
    align-self: center; background: transparent; font-size: 16px;
    padding: 3px 8px 4px; letter-spacing: 2px;
  }
  .blog-years__toggle:hover { background: rgba(25,118,210,.08); }
}

/* ---------- post grid (index / tag) ---------- */
.blog-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 26px;
}
.blog-card {
  position: relative;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
  border: 1px solid #e2ebf6; border-radius: var(--pod-radius);
  box-shadow: 0 1px 2px rgba(16,42,80,.05), 0 12px 30px rgba(16,42,80,.08);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
/* blue accent strip along the top edge, brightens on hover */
.blog-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--blue) 0%, #00b3ff 100%);
  opacity: .85; transition: opacity .2s ease, height .2s ease;
}
.blog-card:hover {
  transform: translateY(-4px); border-color: #c4d8f2;
  box-shadow: 0 4px 8px rgba(16,42,80,.06), 0 22px 48px rgba(16,42,80,.16);
  text-decoration: none;
}
.blog-card:hover::before { opacity: 1; height: 5px; }
.blog-card__media { aspect-ratio: 16/9; background: var(--surface); overflow: hidden; }
.blog-card__media img { width: 100%; height: 100%; object-fit: cover; }
.blog-card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.blog-card__meta { font-size: 13px; color: var(--mid); margin-bottom: 8px; letter-spacing: .01em; }
.blog-card__title {
  font-family: var(--font-head); font-weight: 600; font-size: 22px;
  line-height: 1.2; letter-spacing: var(--track-head); color: var(--ink); margin-bottom: 10px;
}
.blog-card__excerpt { color: var(--ink-soft); font-size: 15.5px; line-height: 1.55; flex: 1; }
.blog-card__more { margin-top: 14px; color: var(--blue); font-weight: 600; font-size: 14.5px; }

/* ---------- tag pills ---------- */
.blog-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.blog-tag {
  display: inline-block; padding: 5px 12px; border-radius: 20px;
  background: var(--surface); color: var(--ink-soft);
  font-size: 13px; font-weight: 500; font-family: var(--font-sans);
}
.blog-tag:hover { background: #e7e7ec; text-decoration: none; }

/* ---------- article ---------- */
.blog-article { padding-top: 10px; }
/* header band: full-bleed soft blue wash + swirl motif, gradient divider below */
.blog-article__head {
  position: relative; overflow: hidden;
  width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
  margin-top: -10px; margin-bottom: 42px;
  padding: 34px 0 36px;
  background:
    radial-gradient(900px 300px at 50% -70px, rgba(0,179,255,.14), transparent 72%),
    linear-gradient(180deg, #eef4fc 0%, #f6fafe 74%, var(--white) 100%);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, var(--blue) 30%, #00b3ff 65%, transparent) 1;
}
.blog-article__head .blog-swirl { inset: 0; width: 100%; height: 100%; }
.blog-article__head-inner {
  position: relative; z-index: 1;
  max-width: var(--blog-readw); margin: 0 auto; padding: 0 clamp(18px,5vw,44px);
}
.blog-article__eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--blue); font-weight: 600; font-size: 13px;
  letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
}
.blog-article__eyebrow:hover { color: var(--blue-dark); text-decoration: none; }
.blog-article__arrow { display: inline-block; transition: transform .22s ease; }
.blog-article__eyebrow:hover .blog-article__arrow { transform: translateX(-5px); }
.blog-article__title {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(28px, 3.4vw, 39px); line-height: 1.12; letter-spacing: var(--track-head);
  margin: 14px 0 20px;
}
.blog-article__meta { color: var(--mid); font-size: 15px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.blog-article__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--mid); opacity: .6; }
.blog-article__author {
  font-weight: 700;
  background: linear-gradient(100deg, var(--blue) 0%, #00b3ff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--blue);
}
.blog-article__hero { margin: 0 0 8px; border-radius: var(--pod-radius); overflow: hidden; box-shadow: var(--pod-shadow); }
.blog-article__hero img { width: 100%; }

.blog-body { font-size: 16.5px; line-height: 1.68; color: var(--ink-soft); margin-top: 4px; }
.blog-body > * + * { margin-top: 1.1em; }
.blog-body h2 { font-family: var(--font-head); font-weight: 600; font-size: 25px; color: var(--ink); letter-spacing: var(--track-head); margin-top: 1.7em; line-height: 1.22; }
.blog-body h3 { font-family: var(--font-head); font-weight: 600; font-size: 20px; color: var(--ink); margin-top: 1.4em; }
.blog-body a { text-decoration: underline; text-underline-offset: 2px; }
.blog-body ul, .blog-body ol { padding-left: 1.4em; }
.blog-body li + li { margin-top: .4em; }
.blog-body img { border-radius: var(--card-radius); margin: 1.4em 0; box-shadow: var(--pod-shadow); }
.blog-body blockquote {
  border-left: 3px solid var(--blue); padding: 4px 0 4px 20px; margin-left: 0;
  color: var(--ink); font-family: var(--font-head); font-style: italic; font-size: 19px;
}
.blog-body code { background: var(--surface); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
/* legacy hashtag footer → small pills */
.blog-body .post-hashtags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 1.8em; }
.blog-body .post-hashtag {
  display: inline-block; padding: 3px 11px; border-radius: 20px;
  background: rgba(25,118,210,.08); color: var(--blue);
  font-family: var(--font-sans); font-weight: 600; font-size: 12.5px; line-height: 1.5;
}

/* internal-link / CTA slot inside articles */
.blog-cta {
  margin: 40px 0 8px; padding: 26px 28px; background: var(--surface);
  border-radius: var(--pod-radius); border: var(--hairline);
}
.blog-cta__title { font-family: var(--font-head); font-weight: 600; font-size: 20px; color: var(--ink); }
.blog-cta__links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px 20px; }
.blog-cta__links a { font-weight: 600; }

/* related / footer of article */
.blog-related { margin-top: 44px; padding-top: 26px; border-top: var(--hairline); }
.blog-related__head { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--mid); margin-bottom: 16px; }

/* ---------- pagination ---------- */
.blog-pager { display: flex; justify-content: center; gap: 14px; margin-top: 48px; align-items: center; }
.blog-pager a, .blog-pager span {
  padding: 9px 18px; border-radius: 22px; font-size: 15px; font-weight: 500;
}
.blog-pager a { background: var(--surface); color: var(--ink); }
.blog-pager a:hover { background: #e7e7ec; text-decoration: none; }
.blog-pager .current { color: var(--mid); }

/* ---------- footer (mirrors the main site footer) ---------- */
.blog-footer { background: var(--ink); color: rgba(255,255,255,.7); padding: 54px clamp(18px,5vw,44px) 28px; }
.blog-footer__inner { max-width: var(--blog-maxw); margin: 0 auto; }
.blog-footer__top { display: flex; flex-wrap: wrap; gap: 40px 56px; justify-content: space-between; }
.blog-footer__brand { max-width: 240px; }
.blog-footer__logo img { height: 30px; }
.blog-footer__social { display: flex; gap: 16px; margin-top: 20px; }
.blog-footer__social a { color: rgba(255,255,255,.55); display: inline-flex; }
.blog-footer__social a:hover { color: #fff; }
.blog-footer__cols { display: flex; gap: 24px 56px; flex-wrap: wrap; }
.blog-footer__col { display: flex; flex-direction: column; gap: 11px; }
.blog-footer__head { color: #fff; font-family: var(--font-sans); font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.blog-footer__col a { color: rgba(255,255,255,.6); font-size: 14px; }
.blog-footer__col a:hover { color: #fff; }
.blog-footer__bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.1);
  font-size: 13px; color: rgba(255,255,255,.45);
}
.blog-footer__tagline { font-family: var(--font-head); }

@media (max-width: 640px) {
  .blog-topbar__title { display: none; }
  .blog-topbar__nav { gap: 14px; }
}
