/* =============================
   TEKIZZ BLOG — UPGRADED THEME
   ============================= */

/* Blog Section with Animated Background */
#blog {
  background: 
    radial-gradient(1400px 1000px at 90% -10%, rgba(147, 51, 234, 0.15), transparent 50%),
    radial-gradient(1000px 800px at -10% 30%, rgba(65, 105, 225, 0.12), transparent 40%),
    radial-gradient(800px 600px at 50% 100%, rgba(220, 38, 127, 0.08), transparent 50%),
    linear-gradient(180deg, #0d1221 0%, #141929 100%);
  position: relative;
  padding: clamp(4rem, 8vw, 8rem) 0;
  overflow: hidden;
}

/* Animated Orbs */
#blog::before,
#blog::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(65, 105, 225, 0.1), rgba(147, 51, 234, 0.1));
  filter: blur(40px);
  z-index: 0;
}

#blog::before {
  width: 600px;
  height: 600px;
  top: -200px;
  right: -200px;
  animation: float 20s ease-in-out infinite;
}

#blog::after {
  width: 800px;
  height: 800px;
  bottom: -300px;
  left: -300px;
  animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-30px) rotate(5deg); }
  66% { transform: translateY(20px) rotate(-3deg); }
}

/* Section Header */
#blog .section-header {
  max-width: 800px;
  margin: 0 auto 4rem auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

#blog .section-header .pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 20px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

#blog .section-header .pill i {
  color: #4169e1;
  font-size: 16px;
}

#blog .section-header h2 {
  color: white;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #4169e1 0%, #9333ea 50%, #dc267f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#blog .section-header .lead {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Search Filters */
#blog .blog-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

#blog .search-input-wrapper {
  position: relative;
  flex: 1;
}

#blog .search-input-wrapper i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
}

#blog .search-input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: white;
  font-size: 16px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

#blog .search-input:focus {
  outline: none;
  border-color: #4169e1;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.1);
}

#blog .search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#blog .search-btn {
  background: linear-gradient(135deg, #4169e1 0%, #9333ea 100%);
  border: none;
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(65, 105, 225, 0.3);
}

#blog .search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(65, 105, 225, 0.4);
}

/* Blog Grid */
#blog .blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

/* Post Card */
#blog .post-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
  position: relative;
}

#blog .post-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(65, 105, 225, 0.3), rgba(147, 51, 234, 0.3), rgba(220, 38, 127, 0.3));
  mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  mask-composite: xor;
  opacity: 0;
  transition: opacity 0.3s ease;
   /* ✅ Allow clicks to pass through */
  pointer-events: none;
}

#blog .post-card:hover {
  transform: translateY(-12px);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 8px 32px rgba(65, 105, 225, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#blog .post-card:hover::before {
  opacity: 1;
}

/* Post Media */
#blog .post-media {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: linear-gradient(135deg, #4169e1, #9333ea);
}

#blog .post-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#blog .post-card:hover .post-media img {
  transform: scale(1.08);
}

#blog .post-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg, 
    transparent 0%, 
    rgba(0, 0, 0, 0.2) 60%, 
    rgba(0, 0, 0, 0.6) 100%
  );
  z-index: 1;
}

/* Post Badge */
#blog .post-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: linear-gradient(135deg, #4169e1, #9333ea);
  color: white;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#blog .post-badge.draft {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Post Content */
#blog .post-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

#blog .post-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  font-weight: 500;
}

#blog .post-meta i {
  color: #4169e1;
  margin-right: 4px;
}

#blog .post-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 700;
}

#blog .post-title a {
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
}

#blog .post-title a:hover {
  background: linear-gradient(135deg, #4169e1, #9333ea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#blog .post-excerpt {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#blog .post-actions {
  margin-top: auto;
  display: flex;
  gap: 0.75rem;
}

#blog .btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

#blog .btn-ghost:hover {
  background: linear-gradient(135deg, #4169e1, #9333ea);
  border-color: transparent;
  color: white;
  transform: translateY(-2px);
}

/* Empty State */
#blog .empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px);
}

#blog .empty-state i {
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 1rem;
}

#blog .empty-state p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.125rem;
  margin: 0;
}

/* Pagination */
#blog .pagination-wrap {
  display: flex;
  justify-content: center;
  margin-top: 4rem;
  position: relative;
  z-index: 1;
}

#blog .pagination-wrap nav {
  display: inline-flex;
  gap: 0.5rem;
}

#blog .pagination-wrap .page-link,
#blog .pagination-wrap a,
#blog .pagination-wrap span {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  text-decoration: none;
  min-width: 44px;
  text-align: center;
}

#blog .pagination-wrap .page-link:hover,
#blog .pagination-wrap a:hover {
  background: linear-gradient(135deg, #4169e1, #9333ea);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(65, 105, 225, 0.3);
}

#blog .pagination-wrap .active span {
  background: linear-gradient(135deg, #4169e1, #9333ea);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px rgba(65, 105, 225, 0.3);
}

/* Blog Hero (for individual posts) */
#blog .blog-hero {
  position: relative;
  padding: clamp(6rem, 12vw, 9rem) 0 clamp(4rem, 8vw, 6rem);
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(147, 51, 234, 0.25), transparent 50%),
    radial-gradient(900px 600px at -10% 20%, rgba(65, 105, 225, 0.25), transparent 40%),
    linear-gradient(180deg, #0d1221 0%, #141929 100%);
  overflow: hidden;
}

#blog .blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.6)), var(--cover, none);
  background-size: cover;
  background-position: center;
  z-index: 0;
}

#blog .blog-hero-overlay {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 -100px 140px rgba(0, 0, 0, 0.6);
  z-index: 0;
}

#blog .blog-hero .container {
  position: relative;
  z-index: 1;
}

#blog .blog-hero-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

#blog .blog-title {
  margin: 1.5rem 0 1rem;
  color: white;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  line-height: 1.2;
  font-weight: 800;
}

#blog .blog-meta {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 500;
}

#blog .blog-meta i {
  color: #4169e1;
  margin-right: 4px;
}

/* Article Content */
#blog .article {
  max-width: 800px;
  margin: 4rem auto;
  position: relative;
  z-index: 1;
}

#blog .article-lead {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.7;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2rem;
  border-radius: 16px;
  margin-bottom: 3rem;
  backdrop-filter: blur(10px);
}

#blog .article-body {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  line-height: 1.7;
}

#blog .article-body h2,
#blog .article-body h3,
#blog .article-body h4 {
  color: white;
  margin: 2.5rem 0 1rem;
  font-weight: 700;
}

#blog .article-body p {
  margin-bottom: 1.5rem;
}

#blog .article-body img {
  border-radius: 12px;
  margin: 2rem 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

#blog .article-body blockquote {
  border-left: 4px solid #4169e1;
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: rgba(65, 105, 225, 0.05);
  color: rgba(255, 255, 255, 0.9);
  font-style: italic;
  border-radius: 8px;
}

#blog .article-body pre {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  backdrop-filter: blur(10px);
}

/* Share Buttons */
#blog .article-share {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
#blog .post-content {
  position: relative;
  z-index: 2;
}
#blog .article-share .share-btn {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

#blog .article-share .share-btn:hover {
  background: linear-gradient(135deg, #4169e1, #9333ea);
  color: white;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(65, 105, 225, 0.4);
}

/* Article Navigation */
#blog .article-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#blog .article-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
  flex: 1;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  text-decoration: none;
}

#blog .article-nav .nav-link:hover {
  background: linear-gradient(135deg, #4169e1, #9333ea);
  color: white;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(65, 105, 225, 0.4);
}

#blog .article-nav .nav-link i {
  color: #4169e1;
  transition: color 0.3s ease;
}

#blog .article-nav .nav-link:hover i {
  color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
  #blog {
    padding: 3rem 0;
  }
  
  #blog .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  #blog .blog-filters {
    flex-direction: column;
    gap: 1rem;
  }
  
  #blog .post-content {
    padding: 1.5rem;
  }
  
  #blog .article-nav {
    flex-direction: column;
    align-items: stretch;
  }
  
  #blog .section-header h2 {
    font-size: 2.5rem;
  }
  
  #blog::before,
  #blog::after {
    display: none;
  }
}

@media (min-width: 1200px) {
  #blog .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

#blog .post-media::after {
  pointer-events: none; /* allow clicks to pass through */
}

#blog .reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation delays */
#blog .post-card:nth-child(1) { animation-delay: 0.1s; }
#blog .post-card:nth-child(2) { animation-delay: 0.2s; }
#blog .post-card:nth-child(3) { animation-delay: 0.3s; }
#blog .post-card:nth-child(4) { animation-delay: 0.4s; }
#blog .post-card:nth-child(5) { animation-delay: 0.5s; }
#blog .post-card:nth-child(6) { animation-delay: 0.6s; }

@media (prefers-reduced-motion: reduce) {
  #blog .reveal,
  #blog .post-card,
  #blog::before,
  #blog::after {
    animation: none !important;
    transition: none !important;
  }
}