/* ==========================================================================
   Blog & case studies
   Built entirely on the tokens in larwell-design.css.
   ========================================================================== */

/* ── Page hero ────────────────────────────────────────────────────────── */

.blog-hero {
  position: relative;
  padding-block: clamp(56px, 8vw, 96px) clamp(36px, 5vw, 56px);
  background: var(--lw-bg-alt);
  border-bottom: 1px solid var(--lw-border);
  overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--lw-ink-5) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: .5;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000, transparent);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000, transparent);
  pointer-events: none;
}
.blog-hero > * { position: relative; z-index: 1; }

.blog-hero-title { margin-top: 18px; max-width: 16ch; }
.blog-hero-sub   { margin-top: 20px; max-width: 62ch; }

.blog-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--lw-border);
}
.blog-hero-stat-n {
  font-family: var(--lw-font-mono);
  font-size: var(--lw-text-2xl);
  font-weight: 500;
  color: var(--lw-ink);
  line-height: 1;
}
.blog-hero-stat-l {
  font-family: var(--lw-font-mono);
  font-size: var(--lw-text-xs);
  color: var(--lw-ink-4);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-top: 8px;
}

/* ── Cards ────────────────────────────────────────────────────────────── */

.post-card-link { display: block; color: inherit; text-decoration: none; }

.post-card-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--lw-bg-sunken);
}
.post-card-fallback span {
  font-family: var(--lw-font-mono);
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--lw-ink-5);
  letter-spacing: -.02em;
}

.post-card-cat {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 2;
  font-family: var(--lw-font-mono);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
  color: var(--lw-ink);
  padding: 5px 11px;
  border-radius: var(--lw-r-full);
  border: 1px solid var(--lw-border);
}

.post-card-title {
  font-size: var(--lw-text-xl);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.28;
  color: var(--lw-ink);
}
.post-card-excerpt {
  margin-top: 10px;
  font-size: var(--lw-text-sm);
  line-height: 1.68;
  color: var(--lw-ink-3);
}
.post-card-meta {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--lw-border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--lw-font-mono);
  font-size: var(--lw-text-xs);
  color: var(--lw-ink-4);
}

/* Lead card: media beside copy on wide screens. */
.post-card-wide .post-card-link { display: grid; grid-template-columns: 1.15fr 1fr; align-items: stretch; }
.post-card-wide .lw-card-media  { aspect-ratio: auto; min-height: 340px; }
.post-card-wide .lw-card-body   { padding: clamp(24px, 3vw, 44px); align-self: center; }
.post-card-wide .post-card-title { font-size: clamp(1.4rem, 2.6vw, 2.15rem); }
.post-card-wide .post-card-excerpt { font-size: var(--lw-text-base); }
@media (max-width: 860px) {
  .post-card-wide .post-card-link { grid-template-columns: 1fr; }
  .post-card-wide .lw-card-media  { min-height: 0; aspect-ratio: 16/9; }
}

/* ── Sidebar ──────────────────────────────────────────────────────────── */

.blog-aside { position: sticky; top: calc(var(--lw-nav-h) + 24px); display: grid; gap: 22px; }
@media (max-width: 1040px) { .blog-aside { position: static; } }

.aside-block {
  background: var(--lw-surface);
  border: 1px solid var(--lw-border);
  border-radius: var(--lw-r-lg);
  padding: 22px;
}
.aside-title {
  font-family: var(--lw-font-mono);
  font-size: var(--lw-text-xs);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--lw-ink-4);
  margin-bottom: 16px;
}
.aside-search { display: flex; gap: 8px; }
.aside-search .lw-input { flex: 1; }
.aside-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.aside-count { font-size: .65rem; color: var(--lw-ink-4); }
.lw-chip-active .aside-count { color: rgba(255,255,255,.6); }

.aside-list { list-style: none; display: grid; gap: 16px; padding: 0; margin: 0; }
.aside-post { display: flex; gap: 12px; color: inherit; text-decoration: none; }
.aside-rank {
  font-family: var(--lw-font-mono);
  font-size: var(--lw-text-xs);
  color: var(--lw-ink-5);
  padding-top: 2px;
}
.aside-post-title {
  display: block;
  font-size: var(--lw-text-sm);
  font-weight: 600;
  line-height: 1.45;
  color: var(--lw-ink);
  transition: color var(--lw-dur) var(--lw-ease);
}
.aside-post:hover .aside-post-title { color: var(--lw-accent-ink); }
.aside-post-meta {
  display: block;
  font-family: var(--lw-font-mono);
  font-size: .66rem;
  color: var(--lw-ink-4);
  margin-top: 5px;
}

.aside-cta { color: #fff; border: 0; }
.aside-cta-title { font-size: var(--lw-text-lg); font-weight: 700; letter-spacing: -.02em; line-height: 1.3; }
.aside-cta-text  { font-size: var(--lw-text-sm); color: rgba(255,255,255,.72); line-height: 1.65; margin-block: 10px 18px; }
.aside-cta .lw-btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.aside-cta .lw-btn-outline:hover { background: #fff; color: var(--lw-ink); border-color: #fff; }

/* ── Article ──────────────────────────────────────────────────────────── */

.article-head {
  padding-block: clamp(40px, 6vw, 72px) clamp(24px, 3vw, 36px);
  border-bottom: 1px solid var(--lw-border);
  background: var(--lw-bg-alt);
}
.article-title { margin-top: 16px; max-width: 20ch; }
.article-sub   { margin-top: 18px; max-width: 60ch; }

.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  font-family: var(--lw-font-mono);
  font-size: var(--lw-text-xs);
  color: var(--lw-ink-3);
}
.article-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--lw-ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: var(--lw-text-xs);
  font-weight: 600;
}
.article-byline-sep { color: var(--lw-ink-5); }

.article-cover {
  margin-top: clamp(24px, 4vw, 44px);
  border-radius: var(--lw-r-lg);
  overflow: hidden;
  border: 1px solid var(--lw-border);
  background: var(--lw-bg-sunken);
  aspect-ratio: 16/8;
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.article-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding-block: clamp(40px, 6vw, 72px);
}
@media (max-width: 1040px) { .article-layout { grid-template-columns: minmax(0, 1fr); gap: 36px; } }

/* Table of contents */
.article-toc { position: sticky; top: calc(var(--lw-nav-h) + 24px); }
@media (max-width: 1040px) {
  .article-toc {
    position: static;
    border: 1px solid var(--lw-border);
    border-radius: var(--lw-r);
    padding: 18px;
    background: var(--lw-surface);
  }
}
.toc-title {
  font-family: var(--lw-font-mono);
  font-size: var(--lw-text-xs);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--lw-ink-4);
  margin-bottom: 14px;
}
.toc-list { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--lw-border); }
.toc-list a {
  display: block;
  padding: 7px 0 7px 16px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  font-size: var(--lw-text-sm);
  line-height: 1.45;
  color: var(--lw-ink-3);
  text-decoration: none;
  transition: color var(--lw-dur) var(--lw-ease), border-color var(--lw-dur) var(--lw-ease);
}
.toc-list a:hover { color: var(--lw-ink); }
.toc-list a.is-active { color: var(--lw-ink); border-left-color: var(--lw-ink); font-weight: 600; }
.toc-l3 a { padding-left: 28px; font-size: var(--lw-text-xs); }

/* Key takeaways box */
.takeaways {
  border: 1px solid var(--lw-border);
  border-left: 3px solid var(--lw-ink);
  border-radius: var(--lw-r);
  background: var(--lw-bg-alt);
  padding: 22px 24px;
  margin-bottom: 36px;
}
.takeaways h2 {
  font-family: var(--lw-font-mono);
  font-size: var(--lw-text-xs);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--lw-ink-4);
  margin: 0 0 14px;
}
.takeaways ul { margin: 0; padding-left: 18px; display: grid; gap: 9px; }
.takeaways li { font-size: var(--lw-text-base); line-height: 1.6; color: var(--lw-ink-2); }

/* Share rail */
.article-share {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--lw-border);
  flex-wrap: wrap;
}
.share-label {
  font-family: var(--lw-font-mono);
  font-size: var(--lw-text-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--lw-ink-4);
  margin-right: 4px;
}
.share-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--lw-border);
  border-radius: var(--lw-r-sm);
  color: var(--lw-ink-3);
  background: var(--lw-surface);
  cursor: pointer;
  transition: all var(--lw-dur) var(--lw-ease);
}
.share-btn:hover { border-color: var(--lw-ink); color: var(--lw-ink); transform: translateY(-2px); }

/* Tags */
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }

/* FAQ accordion */
.faq-list { display: grid; gap: 0; border-top: 1px solid var(--lw-border); }
.faq-item { border-bottom: 1px solid var(--lw-border); }
.faq-q {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 0;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--lw-font);
  font-size: var(--lw-text-lg);
  font-weight: 600;
  color: var(--lw-ink);
  line-height: 1.45;
}
.faq-icon { flex-shrink: 0; color: var(--lw-ink-4); transition: transform var(--lw-dur) var(--lw-ease); margin-top: 3px; }
.faq-item[open] .faq-icon, .faq-q[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }
.faq-a {
  overflow: hidden;
  font-size: var(--lw-text-base);
  line-height: 1.75;
  color: var(--lw-ink-3);
}
.faq-a > div { padding-bottom: 22px; max-width: 70ch; }

/* Author card */
.author-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  border: 1px solid var(--lw-border);
  border-radius: var(--lw-r-lg);
  background: var(--lw-surface);
  padding: 24px;
  margin-top: 44px;
}
.author-avatar {
  width: 54px; height: 54px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--lw-ink);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: var(--lw-text-lg);
}
.author-name { font-weight: 700; color: var(--lw-ink); font-size: var(--lw-text-base); }
.author-role { font-family: var(--lw-font-mono); font-size: var(--lw-text-xs); color: var(--lw-ink-4); margin-top: 3px; }
.author-bio  { font-size: var(--lw-text-sm); color: var(--lw-ink-3); line-height: 1.7; margin-top: 10px; }

/* ── Case studies ─────────────────────────────────────────────────────── */

.cs-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--lw-border);
  border: 1px solid var(--lw-border);
  border-radius: var(--lw-r-lg);
  overflow: hidden;
}
.cs-result { background: var(--lw-surface); padding: 26px 22px; }
.cs-result-v {
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--lw-ink);
  line-height: 1;
}
.cs-result-l {
  font-family: var(--lw-font-mono);
  font-size: var(--lw-text-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--lw-ink-4);
  margin-top: 10px;
}
.cs-result-n { font-size: var(--lw-text-sm); color: var(--lw-ink-3); margin-top: 8px; line-height: 1.55; }

.cs-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 22px;
  padding: 24px 0;
  border-block: 1px solid var(--lw-border);
}
.cs-fact-l {
  font-family: var(--lw-font-mono);
  font-size: var(--lw-text-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--lw-ink-4);
}
.cs-fact-v { font-size: var(--lw-text-base); font-weight: 600; color: var(--lw-ink); margin-top: 7px; }

.cs-quote {
  border-radius: var(--lw-r-lg);
  background: var(--lw-bg-invert);
  color: #fff;
  padding: clamp(30px, 5vw, 52px);
  margin-block: clamp(36px, 5vw, 60px);
}
.cs-quote-text {
  font-family: var(--lw-font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.85rem);
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: -.015em;
}
.cs-quote-by { font-family: var(--lw-font-mono); font-size: var(--lw-text-xs); color: rgba(255,255,255,.6); margin-top: 22px; letter-spacing: .06em; }

.cs-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.cs-gallery figure { margin: 0; }
.cs-gallery img {
  width: 100%;
  border-radius: var(--lw-r);
  border: 1px solid var(--lw-border);
  display: block;
}
.cs-gallery figcaption {
  font-family: var(--lw-font-mono);
  font-size: var(--lw-text-xs);
  color: var(--lw-ink-4);
  margin-top: 9px;
}

/* ── Pagination ───────────────────────────────────────────────────────── */

.lw-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 52px; flex-wrap: wrap; }
.lw-pagination a, .lw-pagination span {
  min-width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 11px;
  border: 1px solid var(--lw-border);
  border-radius: var(--lw-r-sm);
  font-family: var(--lw-font-mono);
  font-size: var(--lw-text-xs);
  color: var(--lw-ink-3);
  text-decoration: none;
  background: var(--lw-surface);
  transition: all var(--lw-dur) var(--lw-ease);
}
.lw-pagination a:hover { border-color: var(--lw-ink); color: var(--lw-ink); }
.lw-pagination .is-current { background: var(--lw-ink); color: #fff; border-color: var(--lw-ink); }
.lw-pagination .is-disabled { opacity: .4; pointer-events: none; }

/* ── Empty state ──────────────────────────────────────────────────────── */

.lw-empty {
  text-align: center;
  padding: clamp(50px, 9vw, 92px) 20px;
  border: 1px dashed var(--lw-border-mid);
  border-radius: var(--lw-r-lg);
  background: var(--lw-surface);
}
.lw-empty i { font-size: 1.9rem; color: var(--lw-ink-5); }
.lw-empty h2 { font-size: var(--lw-text-xl); font-weight: 700; color: var(--lw-ink); margin-top: 18px; }
.lw-empty p  { font-size: var(--lw-text-sm); color: var(--lw-ink-3); margin-top: 10px; }
