/* ==============================
   TIHNA BLOG — Blog Stylesheet
   Extends main site design system
   Dark premium · Teal #00C9A7
   Cabinet Grotesk + Satoshi
   ============================== */

/* Import shared tokens — same as main site */
:root {
  --bg:        #09090B;
  --surface:   #111113;
  --surface2:  #18181B;
  --surface3:  #222225;
  --border:    rgba(255,255,255,0.08);
  --divider:   rgba(255,255,255,0.05);
  --text:      #F4F4F5;
  --muted:     #A9A9B2;
  --faint:     #85858E;
  --teal:      #00C9A7;
  --teal-dim:  rgba(0,201,167,0.10);
  --teal-glow: 0 0 40px rgba(0,201,167,0.18);
  --blue:      #7DD3FC;
  --purple:    #A78BFA;
  --amber:     #F59E0B;
  --font-d:    'Cabinet Grotesk', 'Helvetica Neue', sans-serif;
  --font-b:    'Satoshi', 'Inter', sans-serif;
  --ease:      cubic-bezier(0.16,1,0.3,1);

  /* Text scale */
  --text-xs:   clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
}

/* --- RESET --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
body {
  font-family: var(--font-b);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  line-height: 1.65;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-d); line-height: 1.15; text-wrap: balance; }
p, li { text-wrap: pretty; }
ul { list-style: none; }
::selection { background: rgba(0,201,167,.2); color: var(--text); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- LAYOUT --- */
/* Match site-wide container so blog uses full desktop width and centers correctly */
.container { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: clamp(1.5rem, 4vw, 5rem); }
.container-narrow { width: 100%; max-width: 1100px; margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 3rem); }
.teal { color: var(--teal); }

/* --- BUTTONS --- */
.btn-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--teal); color: #09090B !important;
  font-family: var(--font-b); font-weight: 700;
  border-radius: 9999px; border: none; cursor: pointer;
  transition: background 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
  font-size: var(--text-sm); padding: .65rem 1.5rem;
  text-decoration: none;
}
.btn-primary:hover { background: #00b396; transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,201,167,.3); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.06); color: var(--text);
  font-family: var(--font-b); font-weight: 600;
  border-radius: 9999px; border: 1px solid var(--border); cursor: pointer;
  transition: background 180ms var(--ease);
  font-size: var(--text-sm); padding: .55rem 1.25rem;
  text-decoration: none;
}
.btn-ghost:hover { background: rgba(255,255,255,.11); }

/* --- NAV --- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(9,9,11,.88);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--divider);
}
.nav-inner {
  display: flex; align-items: center; gap: 2.5rem;
  max-width: 1180px; margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
  height: 64px;
}
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo a { display: flex; align-items: center; }
.nav-links { display: flex; align-items: center; gap: 2rem; flex: 1; }
.nav-links a { font-size: .875rem; font-weight: 500; color: var(--muted); transition: color 180ms var(--ease); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active { color: var(--teal); }
.nav-right { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.hamburger { display: none; flex-direction: column; gap: 5px; padding: .375rem; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all 180ms var(--ease); }
.mobile-menu { display: none; flex-direction: column; gap: 1rem; padding: 1.5rem clamp(1.25rem,5vw,3rem) 2rem; border-top: 1px solid var(--divider); }
.mobile-menu.open { display: flex; }
.mobile-menu a { font-size: 1rem; font-weight: 500; color: var(--muted); }
.mobile-menu .btn-primary { align-self: flex-start; margin-top: .5rem; }
@media (max-width: 768px) { .nav-links { display: none; } .nav-right .btn-primary { display: none; } .hamburger { display: flex; } }
@media (max-width: 480px) { .nav-right .btn-sm:not(.hamburger) { display: none; } }

/* --- BLOG INDEX HEADER --- */
/* --- BLOG HEADER: proper header band with centered filter tabs --- */
.blog-header {
  padding-block: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0,201,167,0.03) 0%, transparent 100%);
}

/* --- BLOG FILTER TABS: centered under an implicit header, text-tab style --- */
.blog-filters {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0;
  margin: 0;
  border: 0;
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  .blog-filters {
    justify-content: flex-start;
    flex-wrap: nowrap;
    padding-inline: 0.25rem;
  }
}
.blog-filters::-webkit-scrollbar { display: none; }
.filter-btn {
  display: inline-flex; align-items: center;
  font-family: var(--font-b);
  font-size: var(--text-sm); font-weight: 500;
  letter-spacing: 0; text-transform: none;
  padding: 0; margin: 0;
  border: 0; border-radius: 0;
  color: var(--muted); background: transparent;
  cursor: pointer; white-space: nowrap;
  transition: color 180ms var(--ease);
  position: relative;
  padding-bottom: .4rem;
}
.filter-btn:hover { color: var(--text); background: transparent; }
.filter-btn.active {
  color: var(--text);
  background: transparent;
  border: 0;
}
.filter-btn.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--teal);
  border-radius: 2px;
}

/* --- BLOG LAYOUT: Editorial magazine pattern (hero → secondary → uniform grid) --- */
.blog-grid-section { padding-block: clamp(2rem, 4vw, 3.5rem); }

/* LEAD: One large featured post, image left, text right (or stacked on mobile) */
.blog-lead {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 0 0 clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--border);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  text-decoration: none;
  color: var(--text);
  transition: opacity 200ms var(--ease);
}
.blog-lead:hover { opacity: 0.96; }
.blog-lead:hover .blog-lead__title { color: var(--teal); }
.blog-lead__img {
  width: 100%; aspect-ratio: 16/10; overflow: hidden;
  border-radius: 20px; background: var(--surface2);
}
.blog-lead__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease); }
.blog-lead:hover .blog-lead__img img { transform: scale(1.03); }
.blog-lead__body { display: flex; flex-direction: column; }
.blog-lead__label {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 1rem;
}
.blog-lead__meta {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  font-size: var(--text-xs); color: var(--faint);
  margin-bottom: 1.25rem;
}
.blog-lead__meta .blog-card__tag { margin: 0; }
.blog-lead__title {
  font-family: var(--font-d); font-weight: 800;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  line-height: 1.15; letter-spacing: -0.015em;
  margin-bottom: 1.25rem;
  transition: color 180ms var(--ease);
}
.blog-lead__excerpt {
  font-size: var(--text-base); color: var(--muted);
  line-height: 1.65; margin-bottom: 1.5rem;
  max-width: 52ch;
}
.blog-lead__cta {
  font-size: var(--text-sm); font-weight: 600; color: var(--teal);
  display: inline-flex; align-items: center; gap: .5rem;
  transition: gap 200ms var(--ease);
}
.blog-lead:hover .blog-lead__cta { gap: .85rem; }

/* SECONDARY FEATURES: exactly 2 cards, equal size */
.blog-secondary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
  margin-bottom: clamp(3rem, 5vw, 4rem);
}

/* UNIFORM GRID: all remaining cards in identical 3-column layout */
.blog-grid-heading {
  font-family: var(--font-d); font-weight: 800;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  letter-spacing: -0.01em;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: baseline; justify-content: space-between;
}
.blog-grid-heading__count {
  font-family: var(--font-b); font-weight: 500;
  font-size: var(--text-sm); color: var(--faint);
  letter-spacing: 0;
}
.blog-grid {
  display: grid;
  /* auto-fit collapses empty tracks so filtered results (e.g. 1 Focus card)
     stay centered instead of anchoring alone in the left column with two
     empty columns beside them. minmax cap at 380px stops cards ballooning
     when only 1-2 are visible. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 380px));
  gap: 1.75rem 1.5rem;
  align-items: start;
  justify-content: center;
  max-width: 1200px;
  margin-inline: auto;
}

/* Backward-compat: legacy --feature cards now render at normal size in the uniform grid */
.blog-card--feature { grid-column: auto; }
.blog-card--feature .blog-card__img { aspect-ratio: 16/9; }



/* WAITLIST CTA CARD: mid-grid conversion block */
.blog-cta-card {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(0,201,167,0.10) 0%, rgba(0,201,167,0.03) 100%);
  border: 1px solid rgba(0,201,167,0.25);
  border-radius: 20px;
  padding: clamp(1.75rem, 3vw, 2.75rem);
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-block: .5rem;
}
.blog-cta-card__body h3 {
  font-family: var(--font-d); font-weight: 800;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  line-height: 1.2; letter-spacing: -0.015em;
  margin-bottom: .75rem; color: var(--text);
}
.blog-cta-card__body p {
  font-size: var(--text-sm); color: var(--muted);
  line-height: 1.6; margin: 0; max-width: 52ch;
}
.blog-cta-card__action {
  display: flex; flex-direction: column; gap: .75rem; align-items: flex-start;
}
.blog-cta-card__button {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--teal); color: #001410;
  font-family: var(--font-b); font-weight: 700;
  font-size: var(--text-sm); letter-spacing: -0.005em;
  padding: .85rem 1.5rem; border-radius: 10px;
  text-decoration: none;
  transition: background 180ms var(--ease), transform 180ms var(--ease);
}
.blog-cta-card__button:hover { background: #23d8b6; transform: translateY(-1px); }
.blog-cta-card__note {
  font-size: var(--text-xs); color: var(--faint);
}
@media (max-width: 720px) {
  .blog-cta-card { grid-template-columns: 1fr; gap: 1.25rem; }
}

@media (max-width: 960px) {
  .blog-lead { grid-template-columns: 1fr; gap: 1.75rem; }
  .blog-lead__img { aspect-ratio: 16/9; }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .blog-secondary { grid-template-columns: 1fr; gap: 1.25rem; }
  .blog-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .blog-lead__title { font-size: 1.6rem; }
}

/* --- BLOG CARD --- */
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color 220ms var(--ease), transform 220ms var(--ease), box-shadow 220ms var(--ease);
  text-decoration: none; color: var(--text);
}
.blog-card:hover {
  border-color: rgba(0,201,167,.3);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.blog-card__img {
  width: 100%; aspect-ratio: 16/9; overflow: hidden;
  background: var(--surface2);
  flex-shrink: 0;
}
.blog-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease); }
.blog-card:hover .blog-card__img img { transform: scale(1.04); }

/* Gradient placeholder for cards without images */
.blog-card__img--gradient {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16/9;
}
.blog-card--feature .blog-card__img { aspect-ratio: 16/7; }

.blog-card__body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.blog-card__meta { display: flex; align-items: center; gap: .75rem; margin-bottom: .875rem; }
.blog-card__tag {
  font-size: var(--text-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--teal); background: var(--teal-dim);
  padding: .2rem .6rem; border-radius: 4px;
}
.blog-card__read-time { font-size: var(--text-xs); color: var(--faint); }
.blog-card__title {
  font-family: var(--font-d); font-weight: 700;
  font-size: var(--text-lg); line-height: 1.25;
  color: var(--text); margin-bottom: .625rem;
  transition: color 180ms var(--ease);
}
.blog-card:hover .blog-card__title { color: var(--teal); }
.blog-card--feature .blog-card__title { font-size: var(--text-xl); }
.blog-card__excerpt { font-size: var(--text-sm); color: var(--muted); line-height: 1.6; flex: 1; margin-bottom: 1.25rem; max-width: 60ch; }
.blog-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.blog-card__cta { font-size: var(--text-xs); font-weight: 600; color: var(--teal); display: flex; align-items: center; gap: .3rem; transition: gap 180ms var(--ease); }
.blog-card:hover .blog-card__cta { gap: .55rem; }

/* Gradient backgrounds for cards */
.grad-sleep  { background: linear-gradient(135deg, #0f1a2e 0%, #0d2b2b 100%); }
.grad-calm   { background: linear-gradient(135deg, #1a1528 0%, #0d2033 100%); }
.grad-focus  { background: linear-gradient(135deg, #1a2010 0%, #0d2520 100%); }
.grad-science{ background: linear-gradient(135deg, #1a1010 0%, #201520 100%); }

/* Icon decoration inside gradient cards */
.card-icon {
  width: 64px; height: 64px;
  background: rgba(0,201,167,.12); border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}

/* --- ARTICLE PAGE --- */
.article-header {
  padding-top: clamp(2.5rem, 5vw, 4rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--divider);
}
.article-header .breadcrumb {
  display: flex; align-items: center; gap: .5rem;
  font-size: var(--text-xs); color: var(--faint); margin-bottom: 1.5rem;
}
.article-header .breadcrumb a { color: var(--muted); transition: color 180ms var(--ease); }
.article-header .breadcrumb a:hover { color: var(--teal); }
.article-header .breadcrumb span { color: var(--faint); }
.article-tag {
  display: inline-flex; align-items: center;
  font-size: var(--text-xs); font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--teal); background: var(--teal-dim);
  padding: .25rem .7rem; border-radius: 4px; margin-bottom: 1rem;
}
.article-header h1 {
  font-family: var(--font-d); font-weight: 800;
  font-size: clamp(1.75rem, 1rem + 3vw, 3rem);
  line-height: 1.12; color: var(--text);
  margin-bottom: 1.25rem;
  max-width: 820px;
}
.article-meta {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  font-size: var(--text-xs); color: var(--muted);
}
.article-meta__item { display: flex; align-items: center; gap: .35rem; }
.article-meta__dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.article-byline {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 201, 167, .45);
  transition: color .2s ease, border-color .2s ease;
}
.article-byline:hover { color: var(--teal); border-bottom-color: var(--teal); }
/* The byline is a real navigation target, not just prose, so give it a >=30px
   tap area. An absolutely-positioned ::after grows the hit box without adding
   padding (which would push the underline away from the text) and without
   reflowing the meta row. */
.article-byline { position: relative; }
.article-byline::after {
  content: "";
  position: absolute;
  inset: -7px -6px;
}

/* --- KEY TAKEAWAYS BOX --- */
.key-takeaways {
  background: var(--teal-dim);
  border: 1px solid rgba(0,201,167,.2);
  border-left: 3px solid var(--teal);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}
.key-takeaways h3 {
  font-family: var(--font-d); font-weight: 700; font-size: var(--text-base);
  color: var(--teal); margin-bottom: 1rem; letter-spacing: .02em;
  text-transform: uppercase; font-size: var(--text-xs);
}
.key-takeaways ul { list-style: none; }
.key-takeaways li {
  padding: .375rem 0;
  padding-left: 1.25rem;
  position: relative;
  font-size: var(--text-sm);
  color: var(--text);
  line-height: 1.55;
  border: none;
}
.key-takeaways li::before {
  content: '→';
  position: absolute; left: 0;
  color: var(--teal); font-weight: 700;
}

/* --- ARTICLE BODY --- */
.article-body {
  padding-block: clamp(2.5rem, 5vw, 4rem);
}
.article-content {
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--text);
  max-width: 100%; /* article-layout grid already constrains to ~770px next to sidebar */
}
.article-content h2 {
  font-family: var(--font-d); font-weight: 700;
  font-size: var(--text-xl);
  color: var(--text);
  margin-top: 2.75rem; margin-bottom: .875rem;
  padding-top: .25rem;
  border-top: 1px solid var(--divider);
}
.article-content h3 {
  font-family: var(--font-d); font-weight: 600;
  font-size: var(--text-lg);
  color: var(--text);
  margin-top: 2rem; margin-bottom: .625rem;
}
.article-content h4 {
  font-family: var(--font-d); font-weight: 600;
  font-size: var(--text-base);
  color: var(--teal);
  margin-top: 1.5rem; margin-bottom: .5rem;
  text-transform: uppercase; letter-spacing: .04em;
  font-size: var(--text-xs);
}
.article-content p {
  margin-bottom: 1.4rem;
  max-width: 72ch;
}
.article-content a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 180ms var(--ease);
}
.article-content a:hover { color: #00b396; }
.article-content ul, .article-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
}
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li {
  margin-bottom: .5rem;
  font-size: var(--text-base);
  line-height: 1.65;
  max-width: 68ch;
}
.article-content strong { color: var(--text); font-weight: 700; }
.article-content em { color: var(--muted); }
.article-content hr {
  border: none; border-top: 1px solid var(--divider);
  margin: 2.5rem 0;
}

/* --- DATA TABLES --- */
.article-content table {
  width: 100%; border-collapse: collapse;
  margin: 1.5rem 0; font-size: var(--text-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.article-content th {
  background: var(--surface2);
  font-family: var(--font-d); font-weight: 700;
  color: var(--teal); font-size: var(--text-xs);
  letter-spacing: .05em; text-transform: uppercase;
  padding: .75rem 1rem; text-align: left;
  border-bottom: 1px solid var(--border);
}
.article-content td {
  padding: .7rem 1rem; color: var(--text);
  border-bottom: 1px solid var(--divider);
  vertical-align: top;
}
.article-content tr:last-child td { border-bottom: none; }
.article-content tr:nth-child(even) td { background: rgba(255,255,255,.02); }

/* --- ARTICLE SIDEBAR LAYOUT --- */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }
}

/* --- SIDEBAR --- */
.article-sidebar { position: sticky; top: 88px; }
.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.sidebar-card__title {
  font-family: var(--font-d); font-weight: 700;
  font-size: var(--text-xs); color: var(--teal);
  letter-spacing: .07em; text-transform: uppercase;
  margin-bottom: 1rem;
}
.sidebar-toc a {
  display: block; font-size: var(--text-xs);
  color: var(--muted); padding: .35rem 0;
  border-left: 2px solid var(--divider); padding-left: .75rem;
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
  line-height: 1.45;
}
.sidebar-toc a:hover, .sidebar-toc a.active { color: var(--teal); border-left-color: var(--teal); }
.sidebar-cta-text { font-size: var(--text-xs); color: var(--muted); margin-bottom: 1rem; line-height: 1.55; }

/* --- ARTICLE CTA BLOCK --- */
.article-cta {
  background: linear-gradient(135deg, rgba(0,201,167,.08) 0%, rgba(0,201,167,.04) 100%);
  border: 1px solid rgba(0,201,167,.2);
  border-radius: 16px;
  padding: 2rem 2.25rem;
  margin: 3rem 0;
  text-align: center;
}
.article-cta h3 {
  font-family: var(--font-d); font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text); margin-bottom: .625rem;
  max-width: 100%;
}
.article-cta p {
  font-size: var(--text-sm); color: var(--muted);
  margin-bottom: 1.25rem; max-width: 100%;
}
.article-cta .btn-primary { margin-inline: auto; }

/* --- RELATED ARTICLES --- */
.related-section {
  padding-block: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--divider);
}
.related-section h2 {
  font-family: var(--font-d); font-weight: 700;
  font-size: var(--text-xl); margin-bottom: 1.75rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
@media (max-width: 768px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .related-grid { grid-template-columns: 1fr; } }

/* --- FOOTER --- */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--divider);
  padding-block: clamp(2.5rem, 5vw, 4rem);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem; align-items: center;
}
@media (max-width: 600px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.footer-text { font-size: var(--text-xs); color: var(--faint); line-height: 1.6; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { font-size: var(--text-xs); color: var(--muted); transition: color 180ms var(--ease); }
.footer-links a:hover { color: var(--teal); }
.footer-disclaimer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--divider);
  font-size: var(--text-xs); color: var(--faint); line-height: 1.65;
}

/* --- FONT LOAD --- */
@import url('https://api.fontshare.com/v2/css?f[]=cabinet-grotesk@800,700,600,500&f[]=satoshi@700,600,500,400&display=swap');

/* --- SCIENCE CITATIONS BLOCK --- */
.citations-block {
  margin: 2.5rem 0 1.5rem;
  padding: 1.75rem 2rem;
  background: var(--surface2);
  border: 1px solid rgba(0,201,167,.18);
  border-left: 3px solid var(--teal);
  border-radius: 12px;
}
.citations-block__title {
  display: flex; align-items: center; gap: .625rem;
  font-family: var(--font-d); font-weight: 700;
  font-size: var(--text-sm); color: var(--teal);
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 1.25rem;
}
.citations-block__title svg { flex-shrink: 0; }
.citations-list {
  display: flex; flex-direction: column; gap: .75rem;
  list-style: none; padding: 0; margin: 0;
}
.citations-list li {
  font-size: var(--text-xs); color: var(--muted); line-height: 1.6;
  padding-left: 1.25rem; position: relative;
}
.citations-list li::before {
  content: counter(cite-counter);
  counter-increment: cite-counter;
  position: absolute; left: 0;
  color: var(--teal); font-weight: 700; font-size: .7rem;
}
.citations-list { counter-reset: cite-counter; }
.citations-list a {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: var(--teal);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--text-xs);
  background: rgba(0,201,167,.08);
  border: 1px solid rgba(0,201,167,.3);
  border-radius: 6px;
  padding: .3rem .7rem;
  margin-top: .35rem;
  transition: background 160ms, border-color 160ms;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,201,167,.2);
  position: relative;
  z-index: 5;
  cursor: pointer;
}
.citations-list a::after {
  content: '\2197';
  font-size: .7rem;
  opacity: .8;
}
.citations-list a:hover,
.citations-list a:active {
  background: rgba(0,201,167,.18);
  border-color: var(--teal);
}

/* inline body links — make them clearly tappable on mobile */
.article-content a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(0,201,167,.5);
  transition: color 180ms, text-decoration-color 180ms;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,201,167,.2);
  cursor: pointer;
}
.article-content a:hover,
.article-content a:active {
  color: #00e6bf;
  text-decoration-color: var(--teal);
}

@media (max-width: 640px) {
  .citations-block { padding: 1.25rem 1.25rem; }
  /* On mobile, each citation link becomes a full-width button */
  .citations-list li {
    display: flex;
    flex-direction: column;
    gap: .4rem;
  }
  .citations-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .65rem 1rem;
    font-size: .8125rem;
    border-radius: 8px;
    background: rgba(0,201,167,.1);
    border-color: rgba(0,201,167,.35);
    min-height: 44px;
  }
}

/* ============================================================
   BLOG RESPONSIVE — Full device coverage
   ============================================================ */

/* ── sm: iPad portrait (768–1023px) ── */
@media (max-width: 1023px) and (min-width: 768px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }
  .article-body { max-width: 720px; margin-inline: auto; }
  .related-grid { grid-template-columns: repeat(2,1fr); }
}

/* ── xs + 2xs: mobile (≤ 767px) ── */
@media (max-width: 767px) {
  /* Nav */
  .nav-inner { padding-inline: 1.25rem; height: 60px; }

  /* Blog hero */
  .blog-hero { padding-block: clamp(2.5rem,6vw,4rem); }
  .blog-hero h1 { font-size: clamp(1.75rem,6vw,2.5rem); }

  /* Article */
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }
  .article-body { max-width: 100%; }

  /* Article header */
  .article-header h1 { font-size: clamp(1.625rem,5.5vw,2.25rem); line-height: 1.2; }
  .article-header { padding-block: clamp(2.5rem,6vw,4rem); }

  /* Prose */
  .prose h2 { font-size: clamp(1.25rem,4.5vw,1.75rem); }
  .prose h3 { font-size: clamp(1.125rem,4vw,1.375rem); }
  .prose p, .prose li { font-size: .9375rem; }
  .prose blockquote { padding: 1rem 1.25rem; font-size: .9375rem; }
  .prose table { font-size: .8125rem; }
  .prose table th, .prose table td { padding: .5rem .75rem; }

  /* Article CTA */
  .article-cta { padding: 1.5rem 1.25rem; }
  .article-cta .btn-primary { width: 100%; justify-content: center; }

  /* Citations */
  .citations-block { padding: 1.25rem 1.25rem; }

  /* Related */
  .related-grid { grid-template-columns: 1fr; }
  .related-section h2 { font-size: 1.375rem; }

  /* Blog index cards */
  .blog-grid { grid-template-columns: 1fr !important; }
  .blog-card { border-radius: 16px; }
}

/* ── 2xs: iPhone (≤ 479px) ── */
@media (max-width: 479px) {
  .container { padding-inline: 1.25rem; }
  .container-narrow { padding-inline: 1.25rem; }
  .article-header h1 { font-size: clamp(1.5rem,7vw,2rem); }
  .article-meta { gap: .6rem .85rem; row-gap: .5rem; align-items: center; }
  .article-cta h3 { font-size: 1.125rem; }
  .citations-list li { font-size: .8125rem; }
  .btn-primary { min-height: 44px; }
}

/* Safe area insets for blog */
@supports (padding: max(0px)) {
  @media (max-width: 479px) {
    .footer { padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
  }
}

/* ===== ARTICLE HERO IMAGE =====
   Rule: blog post hero image takes MORE space on desktop/iPad so posts
   command the page instead of sitting in a narrow center column.
   Matches the article header container width (1100px) for visual alignment
   with the title above and the body/sidebar layout below. */
.article-hero-img {
  width: calc(100% - clamp(2.5rem, 8vw, 6rem));
  max-width: 1100px;
  margin: 0 auto 2.5rem;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16/7;
}
.article-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== BLOG CARD IMAGE — real photos ===== */
.blog-card__img {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
  background: #0d1a1a;
}
.blog-card--feature .blog-card__img {
  aspect-ratio: 16/7;
}
.blog-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.blog-card:hover .blog-card__img img {
  transform: scale(1.04);
}

/* Responsive hero image */
@media (max-width: 768px) {
  .article-hero-img {
    border-radius: 10px;
    margin-bottom: 1.75rem;
    aspect-ratio: 16/9;
  }
}

/* =====================================================
   Study Modal — bottom sheet overlay
   ===================================================== */
#study-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: flex-end;
  justify-content: center;
}
#study-modal-overlay.is-open {
  display: flex;
}
#study-modal-sheet {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: #111214;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px 20px 0 0;
  padding: 2rem 1.75rem 2.5rem;
  transform: translateY(100%);
  transition: transform 320ms cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 88svh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#study-modal-sheet.is-visible {
  transform: translateY(0);
}
#study-modal-drag-bar {
  width: 40px;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  margin: 0 auto 1.5rem;
}
#study-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: none;
  color: #aaa;
  font-size: 1.25rem;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 200ms, color 200ms;
}
#study-modal-close:hover { background: rgba(255,255,255,0.14); color: #fff; }
#study-modal-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3em 0.85em;
  border-radius: 100px;
  margin-bottom: 0.6rem;
}
#study-modal-journal {
  font-size: 0.8rem;
  color: #666;
  margin: 0 0 0.6rem;
  letter-spacing: 0.02em;
}
#study-modal-title {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 1rem;
  line-height: 1.35;
  padding-right: 2rem;
}
#study-modal-stat-box {
  background: rgba(0,201,167,0.08);
  border: 1px solid rgba(0,201,167,0.2);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
#study-modal-stat {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #00C9A7;
}
#study-modal-finding {
  font-size: 0.9rem;
  color: #b0b0b0;
  line-height: 1.65;
  margin: 0 0 1.5rem;
}
#study-modal-open-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: transparent;
  border: 1.5px solid rgba(0,201,167,0.45);
  color: #00C9A7;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  margin-bottom: 0.75rem;
  transition: background 200ms, border-color 200ms;
  cursor: pointer;
  min-height: 48px;
}
#study-modal-open-btn:hover { background: rgba(0,201,167,0.08); border-color: #00C9A7; }
#study-modal-cta {
  display: block;
  width: 100%;
  text-align: center;
  background: #00C9A7;
  color: #09090B;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  transition: opacity 200ms;
  min-height: 48px;
}
#study-modal-cta:hover { opacity: 0.9; }

@media (min-width: 641px) {
  #study-modal-sheet {
    border-radius: 20px;
    margin-bottom: 2rem;
    max-width: 560px;
  }
}

/* ------------------------------------------------------------------
   FEATURED (latest post) card — placed at END of file so source order
   beats base .blog-card { display: flex }. Spans full grid width.
   ------------------------------------------------------------------ */
.blog-card.blog-card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(0,201,167,0.04) 0%, transparent 100%), var(--surface);
  margin-bottom: 0.5rem;
}
.blog-card.blog-card--featured .blog-card__img {
  aspect-ratio: auto;
  height: 100%;
  min-height: 320px;
  max-height: 460px;
}
.blog-card.blog-card--featured .blog-card__img img {
  width: 100%; height: 100%; object-fit: cover;
}
.blog-card.blog-card--featured .blog-card__body {
  padding: clamp(1.75rem, 3vw, 2.75rem);
  display: flex; flex-direction: column; justify-content: center;
  gap: 1rem;
}
.blog-card.blog-card--featured .blog-card__title {
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  line-height: 1.15;
  margin: 0;
}
.blog-card.blog-card--featured .blog-card__excerpt {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}
.blog-card__featured-label {
  display: inline-flex; align-items: center;
  font-family: var(--font-b);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(0,201,167,0.35);
  border-radius: 999px;
  background: rgba(0,201,167,0.08);
  margin-right: 0.5rem;
}
.blog-card.blog-card--featured:hover {
  border-color: rgba(0,201,167,0.5);
  transform: translateY(-2px);
}
@media (max-width: 900px) {
  .blog-card.blog-card--featured {
    grid-template-columns: 1fr;
  }
  .blog-card.blog-card--featured .blog-card__img {
    min-height: 220px;
    max-height: 300px;
    aspect-ratio: 16/9;
  }
}

/* ------------------------------------------------------------------
   SOLO CARD LAYOUT — when a filter leaves exactly ONE visible card,
   promote it to full-width so it doesn't sit alone in the middle.
   Uses the same 2-column image+text pattern as the featured card, but
   works on ANY card via the .blog-card--solo class added by JS.
   ------------------------------------------------------------------ */
.blog-card.blog-card--solo {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(0,201,167,0.04) 0%, transparent 100%), var(--surface);
}
.blog-card.blog-card--solo .blog-card__img {
  aspect-ratio: auto;
  height: 100%;
  min-height: 320px;
  max-height: 460px;
}
.blog-card.blog-card--solo .blog-card__img img {
  width: 100%; height: 100%; object-fit: cover;
}
.blog-card.blog-card--solo .blog-card__body {
  padding: clamp(1.75rem, 3vw, 2.75rem);
  display: flex; flex-direction: column; justify-content: center;
  gap: 1rem;
}
.blog-card.blog-card--solo .blog-card__title {
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  line-height: 1.15;
  margin: 0;
}
.blog-card.blog-card--solo .blog-card__excerpt {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}
.blog-card.blog-card--solo:hover {
  border-color: rgba(0,201,167,0.5);
  transform: translateY(-2px);
}

/* Grid switches to a single full-width track when only one card is visible.
   Overrides the auto-fit rule that would otherwise leave the solo card at 380px. */
.blog-grid.blog-grid--single {
  grid-template-columns: 1fr;
  max-width: 1200px;
}

/* Responsive: stack image + text on tablet/mobile */
@media (max-width: 900px) {
  .blog-card.blog-card--solo {
    grid-template-columns: 1fr;
  }
  .blog-card.blog-card--solo .blog-card__img {
    min-height: 220px;
    max-height: 300px;
    aspect-ratio: 16/9;
  }
}

/* ============================================================
   RESPONSIVE + A11Y HARDENING
   ============================================================ */

/* P0 — Wide tables forced .article-content to 549px inside a 390px
   viewport, and body{overflow-x:hidden} then clipped every sibling
   paragraph and heading. Let tables scroll inside their own box. */
.article-content { min-width: 0; max-width: 100%; }
@media (max-width: 768px) {
  .article-content table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .article-content table tbody,
  .article-content table thead { min-width: 460px; display: table; width: 100%; }
}

/* P1 — Tap targets. Hamburger was 28px tall; it is the only mobile
   nav control so it must clear the 44px minimum. */
@media (max-width: 768px) {
  .hamburger {
    min-width: 44px; min-height: 44px;
    justify-content: center; align-items: center;
  }
  .footer-links { gap: .25rem 1.5rem; }
  .footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .nav-links a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* P1 — Contrast: --faint on --bg was 2.44:1, below the 4.5:1 AA floor. */
.footer-text, .footer-disclaimer { color: #8A8A93; }

/* P2 — Grid wrap dead space: 3 items in a 2-col grid left an orphan
   row with an empty cell. Let the last item span both columns. */
@media (min-width: 601px) and (max-width: 1023px) {
  .related-grid, .support-grid { grid-template-columns: 1fr; }
}

/* Visually hidden but available to screen readers and crawlers. */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Standalone link touch targets (inline prose links stay exempt). */
@media (max-width: 768px) {
  .breadcrumb a, .related-card a, .support-card a {
    display: inline-flex; align-items: center; min-height: 44px;
  }
}

/* Long bare study URLs were overflowing the mobile viewport. */
.article-content a, .citation-list a, .article-content p a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Filter buttons were exactly 30px tall — the primary way to navigate
   the blog index on a phone, so they must clear 44px. */
@media (max-width: 768px) {
  .filter-btn { min-height: 44px; display: inline-flex; align-items: center; }
}

/* --- Quick answer -----------------------------------------------------------
   Answer-first block at the top of each article. Deliberately styled as a
   neutral elevated panel rather than a second teal card, so it reads as
   distinct from .key-takeaways sitting directly beneath it. */
.quick-answer {
  background: var(--surface2);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin: 0 0 1.25rem;
}
.quick-answer__label {
  font-family: var(--font-d);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 .75rem;
}
.quick-answer__q {
  font-family: var(--font-d);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin: 0 0 .5rem;
  text-wrap: balance;
}
.quick-answer__a {
  font-size: var(--text-sm);
  color: rgba(244,244,245,.82);
  line-height: 1.7;
  margin: 0;
  max-width: 68ch;
}
.quick-answer__a em { font-style: italic; }

@media (max-width: 600px) {
  .quick-answer { padding: 1.25rem 1.25rem; border-radius: 10px; }
}
