/* ==============
   Birthday Nudge – Blog styles
   ============== */

/* Blog-specific CSS Variables */
:root {
  --blog-content-width: 800px;
  --blog-card-bg: rgba(255,255,255,0.95);
  --blog-text: #2d3748;
  --blog-text-muted: #64748b;
  --blog-border: #e2e8f0;
  --blog-hover: #f7fafc;
  --blog-accent: var(--brand-lilac);
  --blog-cta-bg: linear-gradient(135deg, var(--brand-lilac) 0%, var(--brand-pink) 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --blog-content-width: 800px;
    --blog-card-bg: rgba(30,41,59,0.95);
    --blog-text: #f1f5f9;
    --blog-text-muted: #94a3b8;
    --blog-border: #334155;
    --blog-hover: #1e293b;
    --blog-accent: var(--brand-lilac);
  }
}

/* Blog Layout */
.blog-container {
  max-width: var(--blog-content-width);
  margin: 0 auto;
  padding: 2rem 1rem;
  background: var(--blog-card-bg);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
  position: relative;
  z-index: 3;
}

.blog-header {
  text-align: center;
  margin-bottom: 3rem;
  color: var(--blog-text);
}

.blog-header h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  margin: 0 0 1rem;
  background: linear-gradient(135deg, var(--brand-lilac), var(--brand-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.blog-header .intro {
  font-size: 1.2rem;
  color: var(--blog-text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Blog Cards Grid */
.blog-posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.blog-card {
  background: var(--blog-card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  border: 1px solid var(--blog-border);
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.blog-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.blog-card-content {
  padding: 1.5rem;
}

.blog-card-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--blog-text);
  line-height: 1.3;
}

.blog-card-excerpt {
  font-size: 0.95rem;
  color: var(--blog-text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.blog-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--blog-accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.blog-card-link:hover {
  color: var(--brand-pink);
}

.blog-card-link::after {
  content: '→';
  transition: transform 0.2s ease;
}

.blog-card-link:hover::after {
  transform: translateX(4px);
}

/* CTA Strips */
.cta-strip {
  background: var(--blog-cta-bg);
  color: white;
  text-align: center;
  padding: 1.5rem;
  border-radius: 16px;
  margin: 2rem 0;
  box-shadow: 0 8px 25px rgba(167, 139, 250, 0.3);
}

.cta-strip h3 {
  margin: 0 0 1rem;
  font-size: 1.4rem;
  font-weight: 700;
}

.cta-strip p {
  margin: 0 0 1.5rem;
  opacity: 0.95;
  font-size: 1rem;
}

.cta-button {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  border: 2px solid rgba(255,255,255,0.3);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.cta-button:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Article Prose Styles */
.prose {
  max-width: var(--blog-content-width);
  margin: 0 auto;
  color: var(--blog-text);
  line-height: 1.7;
  font-size: 1.1rem;
}

.prose h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  margin: 0 0 1rem;
  color: var(--blog-text);
  line-height: 1.1;
}

.prose h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--blog-text);
  line-height: 1.3;
  border-bottom: 3px solid var(--blog-accent);
  padding-bottom: 0.5rem;
}

.prose h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: var(--blog-text);
  line-height: 1.4;
}

.prose p {
  margin: 1.5rem 0;
  color: var(--blog-text);
}

.prose ul, .prose ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.prose ul {
  list-style-type: disc;
  list-style-position: inside;
  padding-left: 0;
  margin-left: 0;
}

.prose ol {
  list-style-type: decimal;
  list-style-position: inside;
  padding-left: 0;
  margin-left: 0;
}

.prose li {
  margin: 0.5rem 0;
  color: var(--blog-text);
  line-height: 1.6;
  padding-left: 0;
}

.prose ul li::marker {
  color: #A78BFA;
}

.prose ol li::marker {
  color: #A78BFA;
}

/* Ensure nested lists work properly */
.prose ul ul, .prose ol ol, .prose ul ol, .prose ol ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
  list-style-position: inside;
}

.prose ul ul {
  list-style-type: circle;
}

.prose ul ul li::marker {
  color: #A78BFA;
}

.prose a {
  color: var(--blog-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.prose a:hover {
  color: var(--brand-pink);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 2rem auto;
  display: block;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.prose blockquote {
  border-left: 4px solid var(--blog-accent);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--blog-hover);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--blog-text-muted);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}

.prose th, .prose td {
  border: 1px solid var(--blog-border);
  padding: 0.75rem;
  text-align: left;
}

.prose th {
  background: var(--blog-hover);
  font-weight: 600;
  color: var(--blog-text);
}

.prose td {
  color: var(--blog-text);
}

/* Article Header */
.article-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--blog-border);
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
  color: var(--blog-text-muted);
  flex-wrap: wrap;
}

.article-meta::before {
  content: '';
  width: 40px;
  height: 2px;
  background: var(--blog-accent);
  border-radius: 2px;
}

.article-meta::after {
  content: '';
  width: 40px;
  height: 2px;
  background: var(--blog-accent);
  border-radius: 2px;
}

/* Table of Contents */
.toc {
  background: var(--blog-hover);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  border-left: 4px solid var(--blog-accent);
}

.toc h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--blog-text);
}

.toc ul {
  margin: 0;
  padding-left: 1.5rem;
  list-style: none;
}

.toc li {
  padding-left: 0;
}

.toc li::before {
  display: none;
}

.toc li {
  margin: 0.5rem 0;
}

.toc a {
  color: var(--blog-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
  padding-left: 1rem;
}

.toc a::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--blog-accent);
}

.toc a:hover {
  color: var(--blog-accent);
}

/* Inline CTA */
.inline-cta {
  background: linear-gradient(135deg, var(--brand-mint), var(--brand-blue));
  color: white;
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  margin: 3rem 0;
  box-shadow: 0 8px 25px rgba(119, 227, 200, 0.3);
}

.inline-cta h3 {
  margin: 0 0 1rem;
  font-size: 1.3rem;
  font-weight: 700;
}

.inline-cta p {
  margin: 0 0 1.5rem;
  opacity: 0.95;
}

/* Related Posts */
.related-posts {
  background: var(--blog-hover);
  border-radius: 16px;
  padding: 2rem;
  margin: 3rem 0;
}

.related-posts h3 {
  margin: 0 0 1.5rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--blog-text);
}

.related-posts ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-posts li {
  margin: 1rem 0;
}

.related-posts a {
  color: var(--blog-accent);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s ease;
}

.related-posts a::before {
  content: '📄';
  font-size: 1.2rem;
}

.related-posts a:hover {
  color: var(--brand-pink);
}

/* Final CTA Block */
.final-cta {
  background: var(--blog-cta-bg);
  color: white;
  text-align: center;
  padding: 3rem 2rem;
  border-radius: 20px;
  margin: 3rem 0;
  box-shadow: 0 12px 35px rgba(167, 139, 250, 0.4);
}

.final-cta h2 {
  margin: 0 0 1rem;
  font-size: 2rem;
  font-weight: 800;
  border: none;
  padding: 0;
}

.final-cta p {
  font-size: 1.1rem;
  margin: 0 0 2rem;
  opacity: 0.95;
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.app-store-badge {
  height: 60px;
  transition: transform 0.2s ease;
}

.app-store-badge:hover {
  transform: scale(1.05);
}

.waitlist-btn {
  background: rgba(255,255,255,0.2);
  color: white;
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  border: 2px solid rgba(255,255,255,0.3);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  display: inline-block;
}

.waitlist-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
  .blog-container {
    padding: 1.5rem 1rem;
    border-radius: 0;
  }

  .blog-posts {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .prose {
    font-size: 1rem;
  }

  .prose h1 {
    font-size: 2.5rem;
  }

  .prose h2 {
    font-size: 1.75rem;
    margin: 2rem 0 1rem;
  }

  .article-meta {
    font-size: 0.85rem;
    gap: 0.5rem;
  }

  .cta-strip {
    padding: 1.25rem;
  }

  .final-cta {
    padding: 2rem 1.5rem;
  }

  .final-cta h2 {
    font-size: 1.75rem;
  }

  .cta-buttons {
    flex-direction: column;
    gap: 1rem;
  }

  .app-store-badge {
    height: 50px;
  }
}

@media (max-width: 480px) {
  .blog-posts {
    grid-template-columns: 1fr;
  }

  .blog-card-content {
    padding: 1.25rem;
  }

  .toc {
    padding: 1.25rem;
  }

  .inline-cta, .final-cta {
    margin: 2rem 0;
  }
}

/* Focus Styles for Accessibility */
.blog-card-link:focus,
.cta-button:focus,
.waitlist-btn:focus,
.toc a:focus,
.prose a:focus {
  outline: 2px solid var(--blog-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .cta-button,
  .waitlist-btn,
  .app-store-badge {
    transition: none;
  }

  .blog-card:hover,
  .cta-button:hover,
  .waitlist-btn:hover {
    transform: none;
  }
}