/* === Shared CSS — all pages === */

/* ---------- Base ---------- */

body { font-family: 'Karla', sans-serif; }
h1, h2, h3, h4, h5, h6 { font-family: 'Playfair Display', serif; }
[data-lucide] { font-family: lucide !important; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height, 96px); }

/* ---------- Fade-in ---------- */

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Stagger children ---------- */

.stagger-children > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-children > *:nth-child(7) { transition-delay: 0.35s; }
.stagger-children > *:nth-child(8) { transition-delay: 0.4s; }
.stagger-children > *:nth-child(9) { transition-delay: 0.45s; }
.stagger-children > *:nth-child(10) { transition-delay: 0.5s; }
.stagger-children > *:nth-child(11) { transition-delay: 0.55s; }
.stagger-children > *:nth-child(12) { transition-delay: 0.6s; }

/* ---------- CTA pulse ---------- */

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(1, 117, 194, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(1, 117, 194, 0); }
}
.cta-pulse { animation: pulse-glow 2.5s ease-in-out infinite; }

/* ---------- Card hover ---------- */

.card-lift {
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.card-lift:hover {
  transform: translateY(-4px);
  border-color: rgba(100, 181, 246, 0.3);
  box-shadow: 0 8px 32px rgba(1, 117, 194, 0.12);
}

/* ---------- Grid pattern ---------- */

.grid-pattern {
  background-image: linear-gradient(rgba(1, 117, 194, 0.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(1, 117, 194, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ---------- Glow orbs ---------- */

.glow-orb {
  filter: blur(80px);
  opacity: 0.15;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fade-in { opacity: 1; transform: none; }
  html { scroll-behavior: auto; scroll-padding-top: 0; }
  :root { --nav-height: 0; }
}

/* ---------- Screen reader only ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ---------- Mobile menu ---------- */

.mobile-menu { display: none; }
.mobile-menu.open {
  display: block;
  animation: fadeIn 200ms ease;
}

/* ---------- FAQ ---------- */

.faq-content { display: none; }
.faq-content.open {
  display: block;
  animation: fadeIn 200ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.faq-icon.open { transform: rotate(180deg); }

/* ---------- Sticky CTA ---------- */

#sticky-cta {
  transform: translateY(100%);
  transition: transform 300ms ease;
}
#sticky-cta.visible { transform: translateY(0); }

/* ---------- Number counter ---------- */

@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.count-up { animation: countUp 0.8s ease forwards; }

/* ---------- Cookie checkboxes ---------- */

.cookie-toggle input[type="checkbox"]:checked {
  background-color: rgb(109 41 218);
  border-color: rgb(109 41 218);
}
input[type="checkbox"] {
  accent-color: rgb(109 41 218);
}

/* ---------- Consent checkbox error ---------- */

.border-red-400 > .consent-checkbox {
  outline: 2px solid #f87171;
  outline-offset: 2px;
}

/* ---------- Blog grid ---------- */

#blog-posts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
#blog-posts article.blog-hidden { display: none; }
@media (max-width: 1023px) {
  #blog-posts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 639px) {
  #blog-posts { grid-template-columns: 1fr; }
}

/* ---------- Line clamp ---------- */

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Aspect ratio ---------- */

.aspect-[16/10] { aspect-ratio: 16 / 10; }

/* ---------- Category filter ---------- */

.category-btn.active {
  background: rgba(109, 41, 218, 0.2);
  border-color: rgba(142, 90, 229, 0.4);
  color: #9B6EEB;
}

/* ---------- Article typography ---------- */

.article-body p {
  margin-bottom: 1.5rem;
  line-height: 1.75;
  font-size: 1.125rem;
  color: #cbd5e1;
}
.article-body h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.875rem;
  color: white;
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.article-body ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.5rem;
}
.article-body ul li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.75rem;
  line-height: 1.75;
  color: #cbd5e1;
  font-size: 1.125rem;
}
.article-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 6px;
  height: 6px;
  background: rgb(109 41 218);
  border-radius: 50%;
}
.article-body strong {
  color: white;
  font-weight: 600;
}
.article-body blockquote {
  border-left: 3px solid rgb(109 41 218);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  color: #94a3b8;
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.75;
  background: rgba(109, 41, 218, 0.04);
  border-radius: 0 8px 8px 0;
}

/* ---------- Insight card ---------- */

.insight-card {
  background: linear-gradient(135deg, rgba(109, 41, 218, 0.1) 0%, rgba(109, 41, 218, 0.03) 100%);
  border: 1px solid rgba(109, 41, 218, 0.2);
  border-left: 4px solid rgb(109 41 218);
  border-radius: 0 12px 12px 0;
  padding: 1.75rem;
  margin: 2.5rem 0;
}
.insight-card .card-label {
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9B6EEB;
  margin-bottom: 0.75rem;
}
.insight-card h4 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: white;
  margin-bottom: 0.75rem;
}
.insight-card p, .insight-card ul {
  color: #94a3b8;
  font-size: 0.9375rem;
  line-height: 1.7;
}
.insight-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.insight-card ul li {
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0.5rem;
  color: #94a3b8;
  font-size: 0.9375rem;
}
.insight-card ul li::before { content: ''; display: none; }
.insight-card ul li::after {
  content: '✓';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: #34d399;
  font-weight: 700;
}

/* ---------- Pull quote ---------- */

.pull-quote {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  line-height: 1.5;
  text-align: center;
  padding: 2.5rem 1.5rem;
  margin: 2.5rem 0;
  border-top: 2px solid rgba(109, 41, 218, 0.3);
  border-bottom: 2px solid rgba(109, 41, 218, 0.3);
  position: relative;
}
.pull-quote::before {
  content: '';
  display: block;
  width: 32px;
  height: 3px;
  background: rgb(109 41 218);
  margin: 0 auto 1rem;
}

/* ---------- TOC sidebar ---------- */

.toc-link {
  color: #64748b;
  text-decoration: none;
  border-left: 2px solid rgba(255,255,255,0.06);
  padding-left: 0.875rem;
  display: block;
  margin-bottom: 0.625rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  transition: border-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}
.toc-link:hover {
  color: #9B6EEB;
  border-color: #9B6EEB;
  padding-left: 1rem;
}
.toc-link.active {
  color: #9B6EEB;
  border-color: rgb(109 41 218);
}

/* ---------- Section number ---------- */

.section-number {
  font-family: 'Karla', sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
  color: #9B6EEB;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.375rem;
}

/* ---------- Reading progress bar ---------- */

#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, rgb(109 41 218), #9B6EEB);
  z-index: 100;
  transition: width 0.1s linear;
  width: 0%;
}

/* ---------- Related post card ---------- */

.related-card {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.related-card:hover {
  transform: translateY(-2px);
  border-color: rgba(100, 181, 246, 0.3);
  box-shadow: 0 8px 32px rgba(1, 117, 194, 0.1);
}
