/* ============================================
   MODERN BLOG PAGE - CORECLASSES
   Optimized for SEO, Speed, and Mobile UX
   ============================================ */

/* ===== HERO SECTION ===== */
.blog-hero {
  padding: 6rem 0 4rem;
  background: linear-gradient(135deg, #e5edff 0%, #f3f4f6 100%);
  text-align: center;
  position: relative;
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem); /* Fluid sizing for SEO */
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.1;
  font-family: var(--font-heading);
  color: var(--color-dark);
}

.gradient-text {
  background: linear-gradient(135deg, #f97316, #e11d48);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.highlight {
  color: var(--color-primary);
}

.hero-subtitle {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-gray-600);
  margin: 0 auto;
  max-width: 700px;
}

/* ===== FILTER SECTION - SMART STICKY ===== */
.filter-section {
  padding: 1.5rem 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px); /* Modern glass effect */
  position: sticky;
  top: 70px; /* Below main header */
  z-index: 900;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  transition: all 0.3s ease;
  border-bottom: 1px solid var(--color-gray-200);
}

.category-filter {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: 1px solid var(--color-gray-200);
  background: white;
  color: var(--color-gray-600);
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(31, 60, 136, 0.1);
}

.filter-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(31, 60, 136, 0.2);
}

.filter-btn svg {
  width: 18px;
  height: 18px;
}

/* ===== ARTICLES SECTION ===== */
.blog-articles {
  padding: 4rem 0;
  background: var(--color-gray-100);
  min-height: 600px; /* Prevents footer jump during loading */
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

/* ===== ARTICLE CARD ===== */
.article-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,0,0,0.05);
}

.article-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.card-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9; /* Fixes Layout Shift (CLS) for SEO */
  overflow: hidden;
  background-color: var(--color-gray-200); /* Placeholder color */
}

.card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-card:hover .card-image-wrapper img {
  transform: scale(1.05);
}

.card-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  backdrop-filter: blur(4px);
}

.category-badge svg { width: 14px; height: 14px; }

/* Dynamic Badge Colors */
.category-badge.languages { color: #d97706; }
.category-badge.exams { color: #2563eb; }
.category-badge.careers { color: #7c3aed; }
.category-badge.skills { color: #059669; }

.card-content {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--color-gray-500);
  margin-bottom: 1rem;
  font-weight: 500;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  font-family: var(--font-heading);
}

.card-title a {
  color: var(--color-dark);
  text-decoration: none;
  transition: color 0.2s ease;
}

.card-title a:hover {
  color: var(--color-primary);
}

.card-excerpt {
  font-size: 0.95rem;
  color: var(--color-gray-600);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* Limit text to 3 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  transition: gap 0.2s ease;
}

.card-link:hover { gap: 10px; }

/* Utility class to hide filtered items */
.article-card.hidden {
  display: none;
}

/* ===== LOAD MORE BUTTON ===== */
.load-more-section {
  text-align: center;
  padding: 3rem 0;
  background: var(--color-gray-100);
}

.btn-load-more {
  padding: 12px 36px;
  background: white;
  color: var(--color-dark);
  border: 1px solid var(--color-gray-300);
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn-load-more:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(31, 60, 136, 0.15);
}

/* ===== SOCIAL MEDIA SECTION ===== */
.social-media-section {
  padding: 6rem 0;
  background: white;
}

.social-media-content {
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.social-media-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--color-dark);
}

.social-media-description {
  font-size: 1.1rem;
  color: var(--color-gray-600);
  margin-bottom: 3rem;
  line-height: 1.6;
}

.social-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.social-link-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: white;
  border-radius: 16px;
  text-decoration: none;
  border: 1px solid var(--color-gray-200);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.social-link-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
  border-color: transparent;
}

.social-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  font-size: 1.5rem;
}

.social-link-card:hover .social-icon {
  transform: scale(1.1) rotate(5deg);
}

.social-info { text-align: left; }

.social-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--color-dark);
}

.social-handle {
  font-size: 0.9rem;
  color: var(--color-gray-500);
  margin: 0;
}

/* Brand Colors for Socials */
.social-link-card.facebook .social-icon { background: #e7f3ff; color: #1877f2; }
.social-link-card.youtube .social-icon { background: #fee2e2; color: #ff0000; } /* Using fixed YouTube red */
.social-link-card.whatsapp .social-icon { background: #dcfce7; color: #25d366; }

.social-media-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--color-gray-500);
  margin-top: 2rem;
}

.social-media-note svg { color: var(--color-success); }

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet & Smaller Laptops */
@media (max-width: 1024px) {
  .hero-title { font-size: 3rem; }
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile Devices */
@media (max-width: 768px) {
  .blog-hero { padding: 4rem 0 2rem; }
  .hero-title { font-size: 2.25rem; }
  
  /* Sticky Filters on Mobile */
  .filter-section {
    top: 0; /* Sticks to very top on mobile */
    padding: 1rem 0;
  }
  
  /* Horizontal Scroll for Filters */
  .category-filter {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 5px; /* Space for scrollbar */
    padding-left: 1rem;
    padding-right: 1rem;
    flex-wrap: nowrap; /* Forces single line */
    -webkit-overflow-scrolling: touch; /* Smooth scroll iOS */
    scrollbar-width: none; /* Hide scrollbar Firefox */
  }
  
  .category-filter::-webkit-scrollbar { display: none; } /* Hide scrollbar Chrome */

  .filter-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    flex-shrink: 0;
  }

  .articles-grid {
    grid-template-columns: 1fr; /* 1 Column */
    gap: 2rem;
  }
  
  .social-links-grid {
    grid-template-columns: 1fr;
  }
}

/* Sticky State Utility */
.filter-section.is-sticky {
  position: sticky;
  top: 70px;
  z-index: 1000;
  transition: box-shadow 0.3s ease;
}