/* Blog Page Light Theme Enhancements
   Complementary styles for improved accessibility and visual design */

/* Blog Card Focus States - Enhanced for Light Theme */
.blog-post-card:focus {
  outline: none;
  box-shadow: 
    0 0 0 3px rgba(42, 111, 186, 0.3),
    var(--shadow-xl);
  transform: scale(1.02);
}

.blog-post-card:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

/* Enhanced text readability on blog cards */
.blog-post-card h3,
.blog-post-card h4 {
  text-shadow: 
    1px 1px 2px rgba(0, 0, 0, 0.8),
    0 0 8px rgba(0, 0, 0, 0.5);
  font-weight: 600;
}

.blog-post-card p {
  text-shadow: 
    1px 1px 2px rgba(0, 0, 0, 0.7),
    0 0 6px rgba(0, 0, 0, 0.4);
}

/* Improved overlay contrast */
.blog-post-card .overlay-text {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.3) 40%,
    rgba(0, 0, 0, 0.8) 100%
  );
  padding: 1rem;
  border-radius: 0 0 0.75rem 0.75rem;
}

/* Filter Button Enhanced States */
.filter-btn {
  position: relative;
  border: 1px solid transparent;
}

.filter-btn:focus {
  outline: none;
  box-shadow: 
    0 0 0 3px rgba(42, 111, 186, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.15);
}

.filter-btn:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

/* Improved contrast for inactive filter buttons */
.filter-btn:not(.active) {
  background-color: rgba(255, 255, 255, 0.9) !important;
  color: var(--text-primary) !important;
  border-color: rgba(42, 111, 186, 0.2) !important;
  backdrop-filter: blur(8px);
}

.filter-btn:not(.active):hover {
  background-color: var(--brand-accent) !important;
  color: var(--text-on-dark) !important;
  border-color: var(--brand-accent) !important;
  transform: translateY(-1px);
}

/* Active state styling */
.filter-btn.active {
  background-color: var(--brand-accent) !important;
  color: var(--text-on-dark) !important;
  border-color: var(--brand-accent) !important;
  box-shadow: 0 4px 12px rgba(42, 111, 186, 0.3);
}

/* Load More Button Enhanced States */
#load-more-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#load-more-btn:hover {
  background-color: var(--brand-accent-hover) !important;
  transform: translateY(-2px) !important;
  box-shadow: 
    0 12px 30px rgba(42, 111, 186, 0.4),
    0 8px 16px rgba(0, 0, 0, 0.1);
}

#load-more-btn:focus {
  outline: none;
  box-shadow: 
    0 0 0 3px rgba(42, 111, 186, 0.4),
    0 8px 25px rgba(42, 111, 186, 0.3);
}

#load-more-btn:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

#load-more-btn:active {
  transform: translateY(-1px) !important;
  box-shadow: 
    0 6px 20px rgba(42, 111, 186, 0.3),
    0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Enhanced Card Hover Effects for Light Theme */
.blog-post-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.blog-post-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(42, 111, 186, 0.2);
}

.blog-post-card:focus-within {
  outline: none;
  box-shadow: 
    0 0 0 3px rgba(42, 111, 186, 0.3),
    var(--shadow-xl);
  transform: translateY(-2px) scale(1.01);
  border-color: var(--brand-accent);
}

/* Reading Time Badge Accessibility */
.blog-post-card .reading-time {
  font-weight: 500;
  letter-spacing: 0.025em;
}

/* Tag Pills Enhanced Styling */
.blog-post-card .tag-pill {
  font-weight: 500;
  letter-spacing: 0.025em;
  transition: all 0.2s ease;
}

.blog-post-card:hover .tag-pill {
  background-color: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Filter Section Responsiveness */
@media (max-width: 640px) {
  .filter-btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
    font-size: 0.75rem;
    padding: 0.625rem 1rem;
  }
  
  /* Ensure blog cards stack properly on mobile */
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Improve mobile text readability */
  .blog-post-card h3 {
    font-size: 1.125rem;
    line-height: 1.4;
  }
  
  .blog-post-card p {
    font-size: 0.875rem;
    line-height: 1.5;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .blog-post-card {
    border: 2px solid var(--text-primary);
  }
  
  .filter-btn {
    border-width: 2px !important;
    font-weight: 600;
  }
  
  .filter-btn:not(.active) {
    background-color: white !important;
    color: var(--text-primary) !important;
    border-color: var(--text-primary) !important;
  }
  
  .filter-btn.active {
    background-color: var(--brand-accent) !important;
    color: white !important;
    border-color: var(--brand-accent) !important;
  }
  
  .blog-post-card .reading-time {
    background-color: white !important;
    border: 2px solid var(--text-primary) !important;
    color: var(--text-primary) !important;
  }

  /* Enhanced text shadows for better readability on images */
  .blog-post-card h3,
  .blog-post-card h4,
  .blog-post-card p {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
  }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  .blog-post-card,
  .filter-btn,
  #load-more-btn {
    transition: none;
  }
  
  .blog-post-card:hover {
    transform: none;
  }
}

/* Loading State for Blog Cards */
.blog-post-card.loading {
  opacity: 0.7;
  pointer-events: none;
}

.blog-post-card.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--brand-accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Blog Grid Responsiveness Enhancement */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .blog-grid {
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }
}

@media (min-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* Skip to Content Link for Blog */
.skip-to-posts {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 8px 16px;
  background: var(--brand-accent);
  color: white;
  text-decoration: none;
  border-radius: 4px;
}

.skip-to-posts:focus {
  left: 8px;
  top: 8px;
}