/* ============================================================
   DIGITAL WITH THEJAS — Blog Styles
   blog.css — loaded AFTER main.css
   Same tokens: Manrope headings / Inter body / #6C3BFF purple
   ============================================================ */

/* ============================================================
   SHARED
   ============================================================ */
.nav-active {
  color: var(--color-dark) !important;
  font-weight: 600 !important;
}

.blog-cover--violet { background: linear-gradient(150deg, #3d1eb5 0%, #6C3BFF 100%); color: #fff; }
.blog-cover--navy   { background: linear-gradient(150deg, #0f1f3d 0%, #1a3160 100%); color: #fff; }
.blog-cover--teal   { background: linear-gradient(150deg, #0d4f52 0%, #0a8c8f 100%); color: #fff; }
.blog-cover--amber  { background: linear-gradient(150deg, #92500e 0%, #d4820a 100%); color: #fff; }
.blog-cover--slate  { background: linear-gradient(150deg, #1e293b 0%, #334155 100%); color: #fff; }
.blog-cover--rose   { background: linear-gradient(150deg, #7c1d3e 0%, #c2355a 100%); color: #fff; }

/* ============================================================
   READING PROGRESS BAR
   ============================================================ */
.read-progress {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  height: 3px;
  width: 0;
  background: var(--color-purple);
  z-index: 1001;
  transition: width 80ms linear;
}

/* ============================================================
   BLOG INDEX — HERO
   ============================================================ */
.blog-hero {
  padding-top: calc(var(--navbar-height) + var(--space-20));
  padding-bottom: var(--space-16);
  background: var(--color-bg);
  position: relative;
  overflow: hidden;
}

.blog-hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -160px;
  width: 640px;
  height: 640px;
  background: radial-gradient(circle, rgba(108,59,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.blog-hero__inner { max-width: 760px; position: relative; }

.blog-hero__heading {
  font-size: clamp(2.25rem, 4.5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-5);
}

.blog-hero__sub {
  font-size: var(--text-lg);
  color: var(--color-muted);
  line-height: 1.75;
  margin-bottom: var(--space-6);
  max-width: 640px;
}

.blog-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

/* ============================================================
   BLOG INDEX — FILTERS
   ============================================================ */
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-10);
}

.blog-filter {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.5rem 1.1rem;
  transition: all var(--transition-fast);
}

.blog-filter:hover { border-color: var(--color-purple); color: var(--color-purple); }

.blog-filter.active {
  background: var(--color-purple);
  border-color: var(--color-purple);
  color: var(--color-white);
  font-weight: 600;
}

/* ============================================================
   BLOG INDEX — GRID
   ============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: var(--space-8);
}

/* A class-level display beats the UA [hidden] rule, so restate it —
   the category filters hide cards via card.hidden and rely on this. */
.blog-card[hidden] { display: none; }

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-border);
}

.blog-card__cover {
  position: relative;
  padding: var(--space-6);
  min-height: 172px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-2);
}

.blog-card__cover-eyebrow {
  position: absolute;
  top: var(--space-5);
  left: var(--space-6);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.72;
}

.blog-card__cover-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.blog-card__cover-lines { display: flex; flex-direction: column; gap: 5px; margin-top: var(--space-2); }

.blog-card__cover-lines span {
  display: block;
  height: 3px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.28);
}

.blog-card__cover-lines span:nth-child(1) { width: 62%; }
.blog-card__cover-lines span:nth-child(2) { width: 40%; }

.blog-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-6);
  gap: var(--space-3);
}

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.blog-card__title {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.blog-card__title a { color: inherit; }
.blog-card__title a:hover { color: var(--color-purple); }

.blog-card__desc {
  font-size: var(--text-sm);
  color: var(--color-muted);
  line-height: 1.7;
  flex: 1;
}

.blog-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-purple);
  transition: gap var(--transition-fast);
}

.blog-card__link:hover { gap: var(--space-3); }

.blog-card--featured { grid-column: 1 / -1; }

@media (min-width: 860px) {
  .blog-card--featured { flex-direction: row; }
  .blog-card--featured .blog-card__cover { flex: 0 0 42%; min-height: 264px; }
  .blog-card--featured .blog-card__body { padding: var(--space-10); justify-content: center; }
  .blog-card--featured .blog-card__title { font-size: var(--text-3xl); }
  .blog-card--featured .blog-card__desc { font-size: var(--text-base); }
  .blog-card--featured .blog-card__cover-title { font-size: var(--text-2xl); }
}

.blog-empty {
  text-align: center;
  padding: var(--space-16) 0;
  color: var(--color-muted);
}

/* ============================================================
   ARTICLE — HEADER
   ============================================================ */
.post-header {
  padding-top: calc(var(--navbar-height) + var(--space-16));
  padding-bottom: var(--space-10);
  background: var(--color-bg);
  position: relative;
  overflow: hidden;
}

.post-header::before {
  content: '';
  position: absolute;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 640px;
  background: radial-gradient(circle, rgba(108,59,255,0.07) 0%, transparent 68%);
  pointer-events: none;
}

.post-header__inner { max-width: 760px; margin-inline: auto; position: relative; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-bottom: var(--space-5);
}

.breadcrumb a { color: var(--color-muted); }
.breadcrumb a:hover { color: var(--color-purple); }
.breadcrumb .sep { opacity: 0.45; }

.post-title {
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin-bottom: var(--space-5);
}

.post-standfirst {
  font-size: var(--text-lg);
  line-height: 1.75;
  color: var(--color-muted);
  margin-bottom: var(--space-6);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.post-meta__author {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 600;
  color: var(--color-dark);
}

.post-meta__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--color-purple-mid);
}

.post-meta__dot { opacity: 0.4; }

/* ============================================================
   ARTICLE — BODY
   ============================================================ */
.post-body-wrap { padding-bottom: var(--space-20); }

.post-body {
  max-width: 760px;
  margin-inline: auto;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: #2a2a2a;
}

.post-body > * + * { margin-top: var(--space-5); }

.post-body h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.2;
  margin-top: var(--space-16);
  margin-bottom: var(--space-4);
  scroll-margin-top: calc(var(--navbar-height) + 24px);
}

.post-body h3 {
  font-size: clamp(1.15rem, 2vw, 1.375rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: var(--space-10);
  margin-bottom: var(--space-3);
  scroll-margin-top: calc(var(--navbar-height) + 24px);
}

.post-body h4 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-top: var(--space-8);
  margin-bottom: var(--space-2);
}

.post-body strong { font-weight: 600; color: var(--color-dark); }

.post-body a:not(.btn) {
  color: var(--color-purple);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.post-body a:not(.btn):hover { color: var(--color-purple-dark); }

.post-body ul, .post-body ol {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.post-body ul { list-style: none; padding-left: 0; }

.post-body ul > li { position: relative; padding-left: 1.6rem; }

.post-body ul > li::before {
  content: '';
  position: absolute;
  left: 0.35rem;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-purple);
}

.post-body ol { list-style: decimal; padding-left: 1.4rem; }
.post-body ol > li { padding-left: 0.35rem; }
.post-body ol > li::marker { color: var(--color-purple); font-weight: 700; }

.post-body li > ul, .post-body li > ol { margin-top: var(--space-3); }

.post-body blockquote {
  border-left: 3px solid var(--color-purple);
  background: var(--color-purple-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-5) var(--space-6);
  font-size: var(--text-lg);
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.55;
  color: var(--color-dark);
}

.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: #F4F1FF;
  color: #4A21C7;
  border: 1px solid var(--color-purple-mid);
  border-radius: 6px;
  padding: 0.12em 0.42em;
  word-break: break-word;
}

.post-body pre {
  background: #12121A;
  color: #E7E4F5;
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.7;
  box-shadow: var(--shadow-md);
}

.post-body pre code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  word-break: normal;
}

.post-body hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin-block: var(--space-12);
}

.post-body img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }

/* Tables scroll horizontally inside their own container */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-white);
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  min-width: 560px;
}

.post-body thead th {
  background: var(--color-purple-light);
  font-family: var(--font-heading);
  font-weight: 700;
  text-align: left;
  color: var(--color-dark);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-purple-mid);
  white-space: nowrap;
}

.post-body tbody td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: top;
  color: var(--color-muted);
}

.post-body tbody tr:last-child td { border-bottom: none; }
.post-body tbody td:first-child { color: var(--color-dark); font-weight: 600; }

/* ============================================================
   TAKEAWAYS / CALLOUTS / TOC
   ============================================================ */
.takeaways {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-purple);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-7);
  box-shadow: var(--shadow-sm);
}

.takeaways__label,
.callout__label,
.post-toc__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-purple);
  margin-bottom: var(--space-4);
}

.takeaways ul { gap: var(--space-2) !important; }
.takeaways li { font-size: var(--text-sm); line-height: 1.7; }

.callout {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.callout__label { margin-bottom: var(--space-3); }

.callout--warn { border-left: 3px solid #d4820a; }
.callout--warn .callout__label { color: #a4620a; }

.callout--geo { border-left: 3px solid #0a8c8f; }
.callout--geo .callout__label { color: #0a7376; }

.callout p, .callout li { font-size: var(--text-sm); line-height: 1.75; }

.post-toc {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-7);
}

.post-toc ol {
  list-style: none;
  padding: 0;
  counter-reset: toc;
  gap: var(--space-2) !important;
}

.post-toc li { counter-increment: toc; padding-left: 0 !important; }

.post-toc a {
  display: flex;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted) !important;
  text-decoration: none !important;
  transition: color var(--transition-fast);
}

.post-toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-purple);
  opacity: 0.6;
  flex-shrink: 0;
}

.post-toc a:hover { color: var(--color-dark) !important; }

/* ============================================================
   INLINE CTA — mid-article
   ============================================================ */
.cta-inline {
  background: linear-gradient(140deg, #1a1030 0%, #2b1560 55%, #3d1eb5 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  color: #fff;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.cta-inline::after {
  content: '';
  position: absolute;
  top: -120px;
  right: -100px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(108,59,255,0.45) 0%, transparent 70%);
  pointer-events: none;
}

.cta-inline__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #C9B6FF;
  margin-bottom: var(--space-3);
  position: relative;
}

.cta-inline h3 {
  color: #fff !important;
  font-size: var(--text-2xl) !important;
  margin: 0 0 var(--space-3) !important;
  letter-spacing: -0.025em;
  position: relative;
}

.cta-inline p {
  color: rgba(255,255,255,0.78) !important;
  font-size: var(--text-sm);
  line-height: 1.75;
  margin-bottom: var(--space-6);
  position: relative;
  max-width: 52ch;
}

.cta-inline__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  position: relative;
}

.btn--ghost-light {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-color: rgba(255,255,255,0.22);
}

.btn--ghost-light:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.4);
  transform: translateY(-2px);
}

/* ============================================================
   END-OF-POST CTA — Check your website performance
   ============================================================ */
.perf-cta {
  padding-block: var(--space-20);
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(108,59,255,0.16) 0%, transparent 60%),
    linear-gradient(150deg, #0D0A18 0%, #17102E 55%, #241448 100%);
  color: #fff;
}

.perf-cta__inner {
  max-width: 880px;
  margin-inline: auto;
  text-align: center;
}

.perf-cta__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #C9B6FF;
  margin-bottom: var(--space-5);
}

.perf-cta__eyebrow::before {
  content: '';
  width: 20px;
  height: 2px;
  border-radius: var(--radius-full);
  background: #6C3BFF;
}

.perf-cta h2 {
  color: #fff;
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-bottom: var(--space-4);
}

.perf-cta__sub {
  font-size: var(--text-lg);
  line-height: 1.75;
  color: rgba(255,255,255,0.74);
  max-width: 620px;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

.perf-cta__checks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3) var(--space-5);
  margin-bottom: var(--space-8);
}

.perf-cta__check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: rgba(255,255,255,0.86);
}

.perf-cta__check svg { color: #9F7BFF; flex-shrink: 0; }

.perf-cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.perf-cta__micro { font-size: var(--text-xs); color: rgba(255,255,255,0.52); }

/* ============================================================
   AUTHOR BOX + RELATED + FAQ
   ============================================================ */
.post-footer { max-width: 760px; margin-inline: auto; }

.author-box {
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-7);
  box-shadow: var(--shadow-sm);
  margin-top: var(--space-16);
}

.author-box__img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--color-purple-mid);
}

.author-box__label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-purple);
  margin-bottom: var(--space-1);
}

.author-box h3 { font-size: var(--text-xl); margin-bottom: var(--space-2); }

.author-box p {
  font-size: var(--text-sm);
  color: var(--color-muted);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

.author-box__links { display: flex; flex-wrap: wrap; gap: var(--space-4); }

.author-box__links a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-purple);
  text-decoration: none !important;
}

.author-box__links a:hover { color: var(--color-purple-dark); }

.related {
  padding-block: var(--space-20);
  background: var(--color-white);
  border-top: 1px solid var(--color-border-light);
}

.related__header { text-align: center; margin-bottom: var(--space-10); }

.related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}

.faq-list { display: flex; flex-direction: column; gap: var(--space-4); }

.faq-item {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
}

.faq-item h3 {
  font-size: var(--text-base) !important;
  font-weight: 700;
  margin: 0 0 var(--space-2) !important;
}

.faq-item p { font-size: var(--text-sm); color: var(--color-muted); line-height: 1.75; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 640px) {
  .blog-hero { padding-top: calc(var(--navbar-height) + var(--space-12)); }
  .post-header { padding-top: calc(var(--navbar-height) + var(--space-10)); }
  .post-body { font-size: 1rem; }
  .post-body pre { padding: var(--space-4); font-size: 0.75rem; }
  .cta-inline { padding: var(--space-6); }
  .cta-inline__actions .btn,
  .perf-cta__actions .btn { width: 100%; justify-content: center; }
  .author-box { flex-direction: column; gap: var(--space-4); padding: var(--space-6); }
  .takeaways, .post-toc, .callout { padding: var(--space-5); }
  .blog-grid { grid-template-columns: 1fr; }
}
