/* Global Route: Blog Stylesheet */
/* Enhanced blog experience with modern design patterns */

/* Hero Section */
.blog-hero {
  background: linear-gradient(135deg, #dbeafe 0%, #fed7aa 100%);
  padding: 3rem 1rem;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
}

.blog-hero h1 {
  font-size: 2.25rem;
  color: #1e40af;
  margin-bottom: 0.5rem;
}

.blog-hero-subtitle {
  font-size: 1.125rem;
  color: #4b5563;
  margin-bottom: 2rem;
}

/* Search Container */
.blog-search-container {
  display: flex;
  gap: 0.5rem;
  max-width: 500px;
  margin: 0 auto 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.blog-search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.5rem 0 0 0.5rem;
  font-size: 1rem;
  font-family: inherit;
}

.blog-search-input:focus {
  outline: 2px solid #2563eb;
  outline-offset: 0;
}

.blog-search-btn {
  padding: 0.75rem 1.5rem;
  background-color: #ea580c;
  color: white;
  border: none;
  border-radius: 0 0.5rem 0.5rem 0;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 150ms ease-in-out;
}

.blog-search-btn:hover {
  background-color: #c2410c;
}

.blog-search-btn:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Stats */
.blog-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.blog-stat {
  background-color: white;
  padding: 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.blog-stat-number {
  display: block;
  font-size: 1.875rem;
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 0.25rem;
}

.blog-stat-label {
  display: block;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Main Blog Container */
.blog-main {
  background-color: #f9fafb;
  padding: 3rem 1rem;
}

.blog-container {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 2rem;
  align-items: start;
}

/* Sidebar */
.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.blog-filters {
  background-color: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  height: fit-content;
  position: sticky;
  top: 80px;
}

.blog-filters h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: #111827;
}

.category-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-filter {
  display: block;
  padding: 0.75rem 1rem;
  color: #4b5563;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 150ms ease-in-out;
  font-weight: 500;
}

.category-filter:hover {
  background-color: #f3f4f6;
  color: #1e40af;
  padding-left: 1.25rem;
}

.category-filter.active {
  background-color: #dbeafe;
  color: #1e40af;
  font-weight: 600;
  border-left: 3px solid #2563eb;
  padding-left: 0.75rem;
}

/* Newsletter CTA */
.blog-newsletter-cta {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.blog-newsletter-cta h3 {
  color: white;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.blog-newsletter-cta p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.blog-newsletter-cta .newsletter-form {
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.blog-newsletter-cta .newsletter-form input {
  min-width: auto;
  background-color: white;
}

.blog-newsletter-cta .newsletter-form button {
  background-color: #ea580c;
  color: white;
  border: none;
  width: 100%;
}

.blog-newsletter-cta .newsletter-form button:hover {
  background-color: #c2410c;
}

.newsletter-privacy {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Blog Posts Section */
.blog-posts-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Featured Post */
.featured-post-container {
  margin-bottom: 2rem;
}

.featured-post {
  background-color: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  display: grid;
  grid-template-columns: 1fr 1fr;
  transition: transform 250ms ease-in-out, box-shadow 250ms ease-in-out;
}

.featured-post:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.featured-post-image {
  background: linear-gradient(135deg, #dbeafe 0%, #fed7aa 100%);
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.featured-post-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-post .post-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  background-color: #dbeafe;
  color: #1e40af;
  border-radius: 0.25rem;
  margin-bottom: 1rem;
  width: fit-content;
}

.featured-post h2 {
  font-size: 1.875rem;
  margin-bottom: 1rem;
  color: #111827;
}

.featured-post p {
  color: #4b5563;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.625;
}

.featured-post-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
}

.featured-post-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.featured-post-cta {
  align-self: flex-start;
}

/* Posts Grid */
.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.blog-post-card {
  background-color: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 250ms ease-in-out;
  display: flex;
  flex-direction: column;
}

.blog-post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.blog-post-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #dbeafe 0%, #fed7aa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  overflow: hidden;
}

.blog-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-post-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  background-color: #dbeafe;
  color: #1e40af;
  border-radius: 0.25rem;
  margin-bottom: 0.75rem;
  width: fit-content;
}

.blog-post-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: #111827;
  line-height: 1.375;
  flex-grow: 1;
}

.blog-post-card p {
  font-size: 0.95rem;
  color: #4b5563;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.blog-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #6b7280;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

.blog-post-date {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.blog-post-read-time {
  background-color: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

.blog-post-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
  transition: color 150ms ease-in-out;
}

.blog-post-link:hover {
  color: #1e40af;
}

/* Load More Button */
.blog-load-more {
  text-align: center;
  margin-top: 2rem;
  padding: 2rem 0;
}

#load-more-btn {
  margin: 0 auto;
}

/* Empty State */
.blog-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 2rem;
  background-color: white;
  border-radius: 0.75rem;
  border: 2px dashed #d1d5db;
}

.blog-empty-state h3 {
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.blog-empty-state p {
  color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .blog-container {
    grid-template-columns: 1fr;
  }

  .blog-filters {
    position: static;
  }

  .blog-filters h3 {
    display: none;
  }

  .category-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .category-filter {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }

  .featured-post {
    grid-template-columns: 1fr;
  }

  .featured-post-image {
    height: 250px;
  }
}

@media (max-width: 768px) {
  .blog-hero h1 {
    font-size: 1.875rem;
  }

  .blog-hero-subtitle {
    font-size: 1rem;
  }

  .blog-search-container {
    max-width: 100%;
  }

  .blog-stats {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .featured-post {
    grid-template-columns: 1fr;
  }

  .featured-post-image {
    height: 200px;
  }

  .featured-post-content {
    padding: 1.5rem;
  }

  .featured-post h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 640px) {
  .blog-main {
    padding: 1.5rem 1rem;
  }

  .blog-newsletter-cta {
    padding: 1rem;
  }

  .blog-posts-grid {
    gap: 1rem;
  }

  .blog-post-body {
    padding: 1rem;
  }
}

/* Search Results Highlighting */
.search-highlight {
  background-color: #fef08a;
  font-weight: 600;
  padding: 0 0.25rem;
}

/* Loading State */
.blog-post-card.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Print Styles */
@media print {
  .blog-search-container,
  .blog-filters,
  .blog-newsletter-cta,
  .blog-load-more {
    display: none;
  }

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

  .blog-post-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #d1d5db;
  }
}
