/* ==========================================================================
   BLOG PAGE STYLES
   ========================================================================== */
.blog-hero {
  padding-top: 8rem;
  padding-bottom: 2.5rem;
  text-align: center;
  position: relative;
}

.blog-hero h1.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.blog-controls-section {
  padding: 1rem 0;
}

.blog-grid-section {
  padding-top: 1rem;
}

.blog-controls {
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .blog-controls {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
}

/* Mobile Spacing Optimizations for Blogs Page */
@media (max-width: 768px) {
  section.blog-hero {
    padding-top: 5.5rem !important;
    padding-bottom: 0.5rem !important;
  }
  section.blog-hero h1.hero-title {
    font-size: 1.65rem !important;
  }
  section.blog-controls-section {
    padding: 0.5rem 0 !important;
  }
  .blog-controls {
    margin-bottom: 1rem;
    gap: 0.85rem;
  }
  section.blog-grid-section {
    padding-top: 0.25rem !important;
  }
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1.25rem 0.75rem 2.75rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition-smooth);
}

.search-input:focus {
  outline: none;
  border-color: var(--flutter-light);
  background: rgba(30, 41, 59, 0.6);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}

.search-btn {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 50%;
  transition: var(--transition-smooth);
  z-index: 10;
}

.search-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.search-btn img {
  width: 16px;
  height: 16px;
  opacity: 0.6;
  transition: var(--transition-smooth);
}

.search-btn:hover img {
  opacity: 1;
}

.filter-tabs {
  display: flex;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.3);
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 450px;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}

.filter-tabs::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

.filter-tab {
  flex: 1;
  text-align: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab.active[data-category="all"] {
  color: #04050a;
  background: linear-gradient(135deg, var(--flutter-light) 0%, var(--firebase-amber) 100%);
}

.filter-tab.active[data-category="Dart"] {
  color: #04050a;
  background: var(--flutter-light);
}

.filter-tab.active[data-category="Flutter"] {
  color: #ffffff;
  background: #0284c7;
}

.filter-tab.active[data-category="Firebase"] {
  color: #04050a;
  background: var(--firebase-amber);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 5rem;
}

.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.blog-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Ratio */
  overflow: hidden;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border-color);
  border-radius: 1rem 1rem 0 0;
}

.blog-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-card:hover .blog-image {
  transform: scale(1.05);
}

.blog-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.blog-category-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

.badge-dart {
  background: rgba(56, 189, 248, 0.1);
  color: var(--flutter-light);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.badge-flutter {
  background: rgba(2, 86, 155, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(2, 86, 155, 0.3);
}

.badge-firebase {
  background: rgba(245, 124, 0, 0.1);
  color: var(--firebase-amber);
  border: 1px solid rgba(245, 124, 0, 0.2);
}

.blog-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.blog-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 3rem;
}

.blog-card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.blog-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--flutter-light);
  text-decoration: none;
  margin-top: auto;
  transition: var(--transition-smooth);
}

.blog-card-link:hover {
  color: var(--firebase-amber);
  transform: translateX(4px);
}

.blog-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.blog-no-results svg {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}
