/* ============================================
   Blog Styles - Extends styles.css
   Cal AI Landing Page Blog
   ============================================ */

/* ============================================
   Blog Index Page
   ============================================ */

.blog-hero {
  background: linear-gradient(135deg, #007AFF 0%, #5AC8FA 100%);
  color: white;
  padding: 120px 20px 80px;
  text-align: center;
}

.blog-hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.blog-hero p {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

.blog-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 20px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 40px;
  margin-top: 40px;
}

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

  .blog-hero h1 {
    font-size: 2.5rem;
  }
}

/* ============================================
   Article Card
   ============================================ */

.article-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.article-card-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
}

.article-card-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 100%);
  pointer-events: none;
}

.article-category {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0, 122, 255, 0.9);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 1;
}

.article-card-content {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.article-card-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1C1C1E;
  margin-bottom: 12px;
  line-height: 1.3;
}

.article-card-content p {
  font-size: 1rem;
  color: #666;
  line-height: 1.6;
  margin-bottom: 16px;
  flex-grow: 1;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  color: #8E8E93;
  margin-bottom: 16px;
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.article-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #007AFF;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  transition: gap 0.3s ease;
}

.article-link:hover {
  gap: 12px;
}

/* ============================================
   Article Page
   ============================================ */

.blog-article {
  max-width: 800px;
  margin: 120px auto 80px;
  padding: 0 20px;
}

.article-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid #E5E5EA;
}

.breadcrumbs {
  font-size: 0.875rem;
  color: #8E8E93;
  margin-bottom: 24px;
}

.breadcrumbs a {
  color: #007AFF;
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumbs a:hover {
  color: #0051D5;
}

.article-header .article-category {
  position: static;
  display: inline-block;
  margin-bottom: 16px;
}

.article-header h1 {
  font-size: 3rem;
  font-weight: 800;
  color: #1C1C1E;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .article-header h1 {
    font-size: 2rem;
  }
}

.article-header .article-meta {
  margin-bottom: 0;
}

/* ============================================
   Article Content
   ============================================ */

.article-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: #1C1C1E;
}

.article-content .lead {
  font-size: 1.25rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 32px;
  line-height: 1.6;
}

.article-content h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #1C1C1E;
  margin-top: 48px;
  margin-bottom: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.article-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1C1C1E;
  margin-top: 36px;
  margin-bottom: 16px;
  line-height: 1.4;
}

.article-content p {
  margin-bottom: 24px;
}

.article-content ul,
.article-content ol {
  margin-bottom: 24px;
  padding-left: 28px;
}

.article-content li {
  margin-bottom: 12px;
  line-height: 1.8;
}

.article-content strong {
  font-weight: 600;
  color: #000;
}

.article-content a {
  color: #007AFF;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 122, 255, 0.3);
  transition: border-color 0.2s;
}

.article-content a:hover {
  border-bottom-color: #007AFF;
}

/* ============================================
   Table of Contents
   ============================================ */

.toc {
  background: #F2F2F7;
  border-radius: 12px;
  padding: 24px;
  margin: 32px 0 48px;
}

.toc h2 {
  font-size: 1.25rem !important;
  margin-top: 0 !important;
  margin-bottom: 16px !important;
}

.toc ul {
  margin-bottom: 0 !important;
  padding-left: 20px !important;
}

.toc li {
  margin-bottom: 8px !important;
}

.toc a {
  color: #007AFF;
  text-decoration: none;
  font-size: 1rem;
  border-bottom: none;
}

.toc a:hover {
  text-decoration: underline;
}

/* ============================================
   Article CTA
   ============================================ */

.article-cta {
  background: linear-gradient(135deg, #007AFF 0%, #5AC8FA 100%);
  border-radius: 16px;
  padding: 48px 32px;
  text-align: center;
  color: white;
  margin: 64px 0;
}

.article-cta h3 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: white !important;
  margin-top: 0 !important;
}

.article-cta p {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 32px;
}

.download-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.download-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: white;
  color: #007AFF;
  padding: 14px 24px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.download-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* ============================================
   Related Articles
   ============================================ */

.related-articles {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 2px solid #E5E5EA;
}

.related-articles h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: #1C1C1E;
  margin-top: 0 !important;
}

.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.related-article-card {
  background: #F2F2F7;
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  display: block;
  transition: all 0.3s ease;
}

.related-article-card:hover {
  background: #E5E5EA;
  transform: translateY(-4px);
}

.related-article-card h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1C1C1E;
  margin-bottom: 8px;
  line-height: 1.4;
}

.related-article-card p {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0;
}

/* ============================================
   Category Badge Colors
   ============================================ */

.article-category.beginner {
  background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
}

.article-category.weight-loss {
  background: linear-gradient(135deg, #FF3B30 0%, #FF453A 100%);
}

.article-category.nutrition {
  background: linear-gradient(135deg, #FF9500 0%, #FF9F0A 100%);
}

.article-category.features {
  background: linear-gradient(135deg, #007AFF 0%, #0A84FF 100%);
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
  .blog-container {
    padding: 60px 20px;
  }

  .blog-article {
    margin: 20px auto 60px;
  }

  .article-content {
    font-size: 1rem;
  }

  .article-content .lead {
    font-size: 1.125rem;
  }

  .article-content h2 {
    font-size: 1.5rem;
    margin-top: 36px;
  }

  .article-content h3 {
    font-size: 1.25rem;
    margin-top: 28px;
  }

  .article-cta {
    padding: 32px 24px;
  }

  .article-cta h3 {
    font-size: 1.5rem;
  }

  .related-articles-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Print Styles
   ============================================ */

/* ============================================
   Comparison Tables
   ============================================ */

.comparison-card {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-card table {
  min-width: 600px;
}

.comparison-card th,
.comparison-card td {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .comparison-card {
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px !important;
    padding-right: 20px !important;
    border-radius: 0 !important;
  }

  .comparison-card table {
    font-size: 14px;
  }

  .comparison-card th,
  .comparison-card td {
    padding: 12px 8px !important;
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .blog-article {
    max-width: 100%;
  }

  nav, footer, .article-cta, .related-articles, .breadcrumbs {
    display: none;
  }

  .article-content {
    font-size: 12pt;
  }

  .article-header h1 {
    font-size: 24pt;
  }

  .article-content h2 {
    font-size: 18pt;
    page-break-after: avoid;
  }

  .article-content h3 {
    font-size: 14pt;
    page-break-after: avoid;
  }
}
