/* ===================================
   BLOG PAGE ENHANCED STYLES WITH DARK MODE
   =================================== */

/* Color Variables */
:root {
  --blog-bg-gradient-start: #f8f9fa;
  --blog-bg-gradient-end: #ffffff;
  --blog-card-bg: #ffffff;
  --blog-text-primary: #1a202c;
  --blog-text-secondary: #64748b;
  --blog-text-tertiary: #94a3b8;
  --blog-border: #e2e8f0;
  --blog-shadow: rgba(0, 0, 0, 0.1);
  --blog-accent: #6366f1;
  --blog-accent-secondary: #8b5cf6;
}

[data-theme="dark"] {
  --blog-bg-gradient-start: #0f172a;
  --blog-bg-gradient-end: #1e293b;
  --blog-card-bg: #1e293b;
  --blog-text-primary: #f1f5f9;
  --blog-text-secondary: #cbd5e1;
  --blog-text-tertiary: #94a3b8;
  --blog-border: #334155;
  --blog-shadow: rgba(0, 0, 0, 0.4);
  --blog-accent: #818cf8;
  --blog-accent-secondary: #a78bfa;
}

/* Main Blog Section */
.blog-main {
  background: linear-gradient(180deg, var(--blog-bg-gradient-start) 0%, var(--blog-bg-gradient-end) 100%);
  padding: 4rem 0 6rem;
  transition: background 0.3s ease;
}

/* Blog Header Enhancement */
.blog-header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeInUp 0.6s ease-out;
}

.blog-header .eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blog-accent);
  margin-bottom: 1rem;
  display: inline-block;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border-radius: 50px;
  transition: all 0.3s ease;
}

[data-theme="dark"] .blog-header .eyebrow {
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.2), rgba(167, 139, 250, 0.2));
}

.blog-header .heading_h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--blog-text-primary);
  margin-bottom: 1rem;
  line-height: 1.2;
  transition: color 0.3s ease;
}

.blog-header .subheading {
  font-size: 1.125rem;
  color: var(--blog-text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  transition: color 0.3s ease;
}

/* Enhanced Grid Layout */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

/* Blog Card Enhancements */
.blog-card {
  background: var(--blog-card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px var(--blog-shadow), 0 2px 4px -1px var(--blog-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--blog-border);
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px var(--blog-shadow), 0 10px 10px -5px var(--blog-shadow);
}

[data-theme="light"] .blog-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .blog-card:hover {
  border-color: rgba(129, 140, 248, 0.4);
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.08);
}

.blog-card:hover .blog-card-title {
  color: var(--blog-accent);
}

/* Image Container */
.blog-card-image {
  position: relative;
  width: 100%;
  padding-top: 66.67%; /* 3:2 aspect ratio */
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.blog-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card Content */
.blog-card-content {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Tag Group */
.blog-tag-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.blog-tag {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  color: var(--blog-accent);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

[data-theme="dark"] .blog-tag {
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.2), rgba(167, 139, 250, 0.2));
}

.blog-card:hover .blog-tag {
  background: linear-gradient(135deg, var(--blog-accent), var(--blog-accent-secondary));
  color: #ffffff;
}

.blog-read-time {
  font-size: 0.875rem;
  color: var(--blog-text-tertiary);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: color 0.3s ease;
}

.blog-read-time::before {
  content: "📖";
  font-size: 1rem;
}

/* Card Title */
.blog-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blog-text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
  transition: color 0.3s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Description */
.blog-card-description {
  font-size: 0.9375rem;
  color: var(--blog-text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

/* Read More Button */
.blog-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--blog-accent);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.2s ease;
  align-self: flex-start;
  padding: 0.5rem 0;
}

.blog-read-more::after {
  content: "→";
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}

.blog-read-more:hover {
  gap: 0.75rem;
}

[data-theme="light"] .blog-read-more:hover {
  color: #4f46e5;
}

[data-theme="dark"] .blog-read-more:hover {
  color: var(--blog-accent-secondary);
}

.blog-read-more:hover::after {
  transform: translateX(4px);
}

/* Featured Card (First Card) */
.blog-card.featured {
  grid-column: span 2;
  grid-row: span 1;
}

.blog-card.featured .blog-card-content {
  padding: 2.25rem;
}

.blog-card.featured .blog-card-title {
  font-size: 1.75rem;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.blog-card.featured .blog-card-description {
  font-size: 1.0625rem;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.blog-card.featured .blog-tag-group {
  margin-bottom: 1.25rem;
}

/* Date Badge */
.blog-date-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 0.5rem 0.875rem;
  border-radius: 50px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1a202c;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.blog-card {
  animation: fadeInUp 0.6s ease-out both;
}

.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.2s; }
.blog-card:nth-child(3) { animation-delay: 0.3s; }
.blog-card:nth-child(4) { animation-delay: 0.4s; }
.blog-card:nth-child(5) { animation-delay: 0.5s; }
.blog-card:nth-child(6) { animation-delay: 0.6s; }
.blog-card:nth-child(7) { animation-delay: 0.7s; }
.blog-card:nth-child(8) { animation-delay: 0.8s; }
.blog-card:nth-child(9) { animation-delay: 0.9s; }
.blog-card:nth-child(10) { animation-delay: 1s; }

/* Responsive Design */
@media (max-width: 1024px) {
  .blog-card.featured {
    grid-column: span 1;
  }
  
  .blog-header .heading_h2 {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .blog-header .heading_h2 {
    font-size: 1.75rem;
  }
  
  .blog-card-content {
    padding: 1.5rem;
  }
  
  .blog-card.featured .blog-card-content {
    padding: 1.5rem;
  }
  
  .blog-card.featured .blog-card-title {
    font-size: 1.5rem;
  }
  
  .blog-main {
    padding: 2rem 0 4rem;
  }
}

/* Loading State */
.blog-card.loading {
  pointer-events: none;
}

.blog-card.loading .blog-card-image::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  to {
    left: 100%;
  }
}

/* Accessibility */
.blog-card:focus-within {
  outline: 2px solid #6366f1;
  outline-offset: 4px;
}

.blog-read-more:focus {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Print Styles */
@media print {
  .blog-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #e2e8f0;
  }
  
  .blog-card-image {
    display: none;
  }
}
