/* ===== Ridgeline Continuity Press — Global Styles ===== */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Epilogue:wght@400;500;600;700;800;900&family=Rubik:wght@300;400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
  --brand-50: #ecfdf5;
  --brand-100: #d1fae5;
  --brand-200: #a7f3d0;
  --brand-300: #6ee7b7;
  --brand-400: #34d399;
  --brand-500: #10b981;
  --brand-600: #059669;
  --brand-700: #047857;
  --brand-800: #065f46;
  --brand-900: #064e3b;
  --brand-950: #022c22;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --font-heading: 'Epilogue', sans-serif;
  --font-body: 'Rubik', sans-serif;
  --measure: 68ch;
}

/* --- Reset / Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--gray-800);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-700); text-decoration: none; transition: color .2s; }
a:hover { color: var(--brand-600); }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.2;
  color: var(--gray-900);
}
h1 { font-size: 3rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}

/* --- Layout --- */
.inner { max-width: 80rem; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }
.section-alt { background: var(--brand-50); }

/* --- Header / Navigation --- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1.5rem;
  max-width: 80rem;
  margin: 0 auto;
}
.nav-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.nav-logo svg { width: 28px; height: 28px; }
.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; }
.nav-links a {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .95rem;
  color: var(--gray-700);
  transition: color .2s;
}
.nav-links a:hover { color: var(--brand-600); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: .5rem 1.25rem;
  background: var(--brand-600);
  color: #fff !important;
  font-weight: 600;
  font-size: .875rem;
  border-radius: 9999px;
  transition: background .2s;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}
.nav-cta:hover { background: var(--brand-700); color: #fff !important; }

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gray-800);
  margin: 5px 0;
  border-radius: 2px;
  transition: all .3s;
}
.mobile-menu {
  display: none;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 1.5rem 1.5rem;
}
.mobile-menu a {
  display: block;
  padding: .625rem 0;
  color: var(--gray-700);
  font-weight: 500;
  font-size: 1rem;
  border-bottom: 1px solid var(--gray-100);
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu.open { display: block; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links, .nav-cta-wrap { display: none; }
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  padding: 1rem 0 0;
  font-size: .85rem;
  color: var(--gray-500);
}
.breadcrumbs a { color: var(--gray-500); }
.breadcrumbs a:hover { color: var(--brand-600); }
.breadcrumbs span { margin: 0 .375rem; }

/* --- Hero (Index) --- */
.hero-index {
  position: relative;
  text-align: center;
  padding: 5rem 1.5rem 4rem;
  overflow: hidden;
  background: #fff;
}
.hero-blobs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .5;
}
.blob-1 { width: 400px; height: 400px; background: var(--brand-100); top: -100px; left: -80px; }
.blob-2 { width: 300px; height: 300px; background: var(--brand-200); top: 50px; right: -60px; }
.blob-3 { width: 250px; height: 250px; background: var(--brand-100); bottom: -80px; left: 40%; }
.hero-index .inner { position: relative; z-index: 1; }
.hero-index h1 { margin-bottom: 1.25rem; }
.hero-subtitle {
  font-size: 1.125rem;
  color: var(--gray-600);
  max-width: 44rem;
  margin: 0 auto 2rem;
  font-weight: 400;
}
.badge-cluster {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .625rem;
  margin-bottom: 2.5rem;
}
.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: .375rem 1rem;
  background: var(--brand-100);
  color: var(--brand-800);
  font-size: .8rem;
  font-weight: 600;
  border-radius: 9999px;
}

/* --- Pill Badge Section Headings --- */
.pill-section-label {
  display: inline-flex;
  align-items: center;
  padding: .25rem .875rem;
  background: var(--brand-100);
  color: var(--brand-700);
  font-size: .75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .75rem;
}

/* --- Article Cards --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}
.card {
  background: var(--brand-50);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: box-shadow .3s, transform .3s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.07);
  transform: translateY(-2px);
}
.card-tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--brand-700);
  margin-bottom: .75rem;
}
.card h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.card h3 a { color: var(--gray-900); }
.card h3 a:hover { color: var(--brand-700); }
.card-meta {
  font-size: .8rem;
  color: var(--gray-500);
  margin-bottom: .75rem;
}
.card-excerpt {
  font-size: .925rem;
  color: var(--gray-600);
  flex: 1;
  margin-bottom: 1rem;
}
.card-link {
  font-weight: 600;
  font-size: .875rem;
  color: var(--brand-700);
}
.card-link:hover { color: var(--brand-600); }

/* Featured card */
.card-featured {
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  border: 2px solid var(--brand-200);
  grid-column: 1 / -1;
  padding: 2.5rem;
}
.card-featured h3 { font-size: 1.5rem; }

/* --- Buttons --- */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .75rem 2rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: .95rem;
  font-family: var(--font-body);
  transition: all .2s;
  border: none;
  cursor: pointer;
}
.btn-primary { background: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand-700); color: #fff; }
.btn-outline { background: transparent; color: var(--brand-700); border: 2px solid var(--brand-300); }
.btn-outline:hover { background: var(--brand-50); }

/* --- Circled Icon --- */
.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  background: var(--brand-50);
  border-radius: 9999px;
  color: var(--brand-600);
  margin-bottom: .75rem;
  flex-shrink: 0;
}
.icon-circle svg { width: 20px; height: 20px; }

/* --- Newsletter / Lead Capture --- */
.newsletter-box {
  background: var(--brand-50);
  border-radius: 1.5rem;
  padding: 2.5rem;
  text-align: center;
  max-width: 36rem;
  margin: 0 auto;
}
.newsletter-box h3 { margin-bottom: .5rem; }
.newsletter-box p { color: var(--gray-600); margin-bottom: 1.25rem; font-size: .95rem; }
.newsletter-form {
  display: flex;
  gap: .625rem;
  max-width: 28rem;
  margin: 0 auto;
}
.newsletter-form input[type="email"] {
  flex: 1;
  padding: .75rem 1.25rem;
  border: 1px solid var(--gray-300);
  border-radius: 9999px;
  font-size: .95rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color .2s;
}
.newsletter-form input[type="email"]:focus { border-color: var(--brand-400); }
.newsletter-success {
  display: none;
  color: var(--brand-700);
  font-weight: 600;
  padding: .5rem;
  font-size: .95rem;
}

/* In-article CTA */
.inline-cta {
  background: var(--brand-50);
  border-radius: 1.5rem;
  padding: 2rem 2.5rem;
  margin: 2.5rem 0;
  border-left: 4px solid var(--brand-400);
}
.inline-cta h4 { margin-bottom: .375rem; }
.inline-cta p { color: var(--gray-600); margin-bottom: 1rem; font-size: .925rem; }

/* Contact form */
.contact-form { max-width: 32rem; margin: 0 auto; }
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: .875rem;
  margin-bottom: .375rem;
  color: var(--gray-700);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 1rem;
  font-size: .95rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color .2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--brand-400); }
.form-group textarea { resize: vertical; min-height: 6rem; }
.form-success {
  display: none;
  background: var(--brand-50);
  color: var(--brand-700);
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  font-weight: 600;
  text-align: center;
}

/* --- Article Prose --- */
.prose {
  max-width: var(--measure);
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.75;
  color: var(--gray-800);
}
.prose h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.625rem;
  scroll-margin-top: 5rem;
}
.prose h3 {
  margin-top: 2rem;
  margin-bottom: .75rem;
  font-size: 1.25rem;
  scroll-margin-top: 5rem;
}
.prose p { margin-bottom: 1.25rem; }
.prose ul, .prose ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.prose li { margin-bottom: .375rem; }
.prose ul li { list-style-type: disc; }
.prose ol li { list-style-type: decimal; }
.prose strong { font-weight: 600; color: var(--gray-900); }
.prose em { font-style: italic; }
.prose a { color: var(--brand-700); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--brand-600); }
.prose blockquote {
  border-left: 4px solid var(--brand-300);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--brand-50);
  border-radius: 0 1rem 1rem 0;
  color: var(--gray-700);
  font-style: italic;
}
.prose code {
  background: var(--gray-100);
  padding: .15rem .4rem;
  border-radius: .375rem;
  font-size: .875em;
  color: var(--brand-800);
}
.prose pre {
  background: var(--gray-900);
  color: var(--gray-100);
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: .875rem;
  line-height: 1.6;
}
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 2.5rem 0;
}
.prose img { border-radius: 1rem; margin: 1.5rem 0; }

/* Tables */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .925rem;
}
.prose thead th {
  background: var(--brand-600);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: .75rem 1rem;
}
.prose thead th:first-child { border-radius: .75rem 0 0 0; }
.prose thead th:last-child { border-radius: 0 .75rem 0 0; }
.prose tbody td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
}
.prose tbody tr:nth-child(even) { background: var(--brand-50); }
.prose tbody tr:last-child td:first-child { border-radius: 0 0 0 .75rem; }
.prose tbody tr:last-child td:last-child { border-radius: 0 0 .75rem 0; }

/* Table of Contents */
.toc {
  background: var(--brand-50);
  border-radius: 1.5rem;
  padding: 1.75rem 2rem;
  margin: 1.5rem 0 2.5rem;
}
.toc-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--gray-900);
  margin-bottom: .75rem;
}
.toc ol { padding-left: 1.25rem; margin: 0; }
.toc li { margin-bottom: .375rem; font-size: .925rem; }
.toc a { color: var(--brand-700); text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* Byline */
.article-meta {
  max-width: var(--measure);
  margin: 0 auto 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  font-size: .875rem;
  color: var(--gray-500);
}
.author-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: var(--brand-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--brand-800);
  font-size: .75rem;
  flex-shrink: 0;
}
.author-info { line-height: 1.4; }
.author-name { font-weight: 600; color: var(--gray-800); }
.author-name a { color: var(--gray-800); text-decoration: none; }
.author-name a:hover { color: var(--brand-600); }

/* Key Takeaways */
.key-takeaways {
  background: var(--brand-50);
  border-radius: 1.5rem;
  padding: 2rem;
  margin: 2rem 0;
}
.key-takeaways h3 {
  font-size: 1.125rem;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.key-takeaways ul { padding-left: 1.5rem; margin: 0; }
.key-takeaways li { margin-bottom: .375rem; }

/* Related Posts */
.related-posts {
  max-width: var(--measure);
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-200);
}
.related-posts h3 { font-size: 1.25rem; margin-bottom: 1rem; }
.related-list { list-style: none; padding: 0; }
.related-list li { margin-bottom: .75rem; }
.related-list a {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--brand-700);
  font-weight: 500;
}
.related-list a::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-400);
  flex-shrink: 0;
}

/* --- Article Hero --- */
.article-hero {
  text-align: center;
  padding: 3.5rem 1.5rem 2rem;
  position: relative;
  overflow: hidden;
}
.article-hero .inner { position: relative; z-index: 1; }
.article-hero h1 {
  max-width: 44rem;
  margin: 0 auto .75rem;
}

/* --- About Page --- */
.author-card {
  display: flex;
  gap: 2rem;
  background: var(--brand-50);
  border-radius: 1.5rem;
  padding: 2rem;
  margin-bottom: 1.5rem;
}
.author-card-avatar {
  width: 5rem;
  height: 5rem;
  border-radius: 9999px;
  background: var(--brand-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--brand-800);
  font-size: 1.25rem;
  flex-shrink: 0;
  font-family: var(--font-heading);
}
.author-card h3 { margin-bottom: .125rem; }
.author-card .role { font-size: .85rem; color: var(--brand-600); font-weight: 600; margin-bottom: .5rem; }
.author-card p { font-size: .95rem; color: var(--gray-600); }

@media (max-width: 640px) {
  .author-card { flex-direction: column; align-items: center; text-align: center; }
}

/* --- Footer --- */
.site-footer {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  padding: 3rem 0 2rem;
  font-size: .875rem;
  color: var(--gray-600);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}
.footer-brand p { margin-top: .5rem; font-size: .85rem; max-width: 22rem; }
.footer-col h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: .875rem;
  color: var(--gray-800);
  margin-bottom: .75rem;
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: .5rem; }
.footer-col a { color: var(--gray-600); }
.footer-col a:hover { color: var(--brand-600); }
.footer-bottom {
  border-top: 1px solid var(--gray-200);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem;
  font-size: .8rem;
  color: var(--gray-500);
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* --- Cookie Consent Bar --- */
.cookie-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--gray-900);
  color: var(--gray-200);
  padding: 1rem 1.5rem;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: .85rem;
}
.cookie-bar.show { display: flex; }
.cookie-bar p { flex: 1; margin: 0; }
.cookie-bar a { color: var(--brand-400); }
.cookie-btns { display: flex; gap: .5rem; flex-shrink: 0; }
.cookie-accept,
.cookie-decline {
  padding: .5rem 1rem;
  border: none;
  border-radius: 9999px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.cookie-accept { background: var(--brand-600); color: #fff; }
.cookie-accept:hover { background: var(--brand-700); }
.cookie-decline { background: var(--gray-700); color: var(--gray-200); }
.cookie-decline:hover { background: var(--gray-600); }

@media (max-width: 640px) {
  .cookie-bar { flex-direction: column; text-align: center; }
}

/* --- Scroll Animations --- */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- 404 Page --- */
.error-page {
  text-align: center;
  padding: 6rem 1.5rem;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.error-page h1 { font-size: 6rem; color: var(--brand-300); margin-bottom: .5rem; }
.error-page h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.error-page p { color: var(--gray-600); margin-bottom: 2rem; max-width: 28rem; }

/* --- Thanks Page --- */
.thanks-page {
  text-align: center;
  padding: 6rem 1.5rem;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.thanks-page h1 { font-size: 2.5rem; margin-bottom: .75rem; }
.thanks-page p { color: var(--gray-600); max-width: 32rem; margin-bottom: 2rem; }

/* --- Legal Pages --- */
.legal-prose { max-width: var(--measure); margin: 0 auto; }
.legal-prose h2 { margin-top: 2rem; margin-bottom: .75rem; }
.legal-prose p { margin-bottom: 1rem; }
.legal-prose ul { margin-bottom: 1rem; padding-left: 1.5rem; }
.legal-prose li { margin-bottom: .25rem; list-style-type: disc; }

/* Recovery timeline diagram */
.timeline-diagram {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 2rem 0;
  position: relative;
  padding-left: 2rem;
  border-left: 3px solid var(--brand-300);
}
.timeline-step {
  position: relative;
  padding: 1rem 1.5rem;
  background: var(--brand-50);
  border-radius: 1rem;
  margin-bottom: 1rem;
}
.timeline-step::before {
  content: '';
  position: absolute;
  left: -2.375rem;
  top: 1.25rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand-500);
  border: 2px solid #fff;
}
.timeline-step .time-label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--brand-700);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .25rem;
}
.timeline-step h4 { font-size: 1rem; margin-bottom: .25rem; }
.timeline-step p { font-size: .9rem; color: var(--gray-600); margin: 0; }

/* Checklist styling */
.checklist { list-style: none; padding: 0; margin: 1.5rem 0; }
.checklist li {
  position: relative;
  padding: .5rem 0 .5rem 2rem;
  border-bottom: 1px solid var(--gray-100);
}
.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .75rem;
  width: 18px;
  height: 18px;
  border: 2px solid var(--brand-400);
  border-radius: .25rem;
}

/* Testing matrix */
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.matrix-cell {
  background: var(--brand-50);
  border-radius: 1rem;
  padding: 1.25rem;
  text-align: center;
}
.matrix-cell .freq {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--brand-700);
}
.matrix-cell .label {
  font-size: .85rem;
  color: var(--gray-600);
  margin-top: .25rem;
}

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
