/* =============================================
   BLOG PAGE — Premium Redesign
   ============================================= */

/* ---- Page wrapper ---- */
.blog-section {
  min-height: 100vh;
  padding: 105px 24px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ---- Page heading ---- */
.blog-heading {
  text-align: center;
  margin-bottom: 56px;
  position: relative;
}

.blog-heading h1 {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(90deg, #10B981, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.blog-heading h1::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #10B981, #F97316);
  border-radius: 2px;
  margin: 12px auto 0;
}

.blog-heading p {
  font-size: 1rem;
  color: #64748B;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ---- Blog Grid ---- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 26px;
}

/* ---- Blog Card ---- */
.blog-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.3s ease, box-shadow 0.35s ease;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Colored top stripe per card (cycles through 4 accent colors) */
.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #10B981, #34d399);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.blog-card:nth-child(2)::before {
  background: linear-gradient(90deg, #F97316, #fb923c);
}

.blog-card:nth-child(3)::before {
  background: linear-gradient(90deg, #6366f1, #818cf8);
}

.blog-card:nth-child(4)::before {
  background: linear-gradient(90deg, #ec4899, #f472b6);
}

.blog-card:nth-child(5)::before {
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
}

.blog-card:nth-child(6)::before {
  background: linear-gradient(90deg, #10B981, #34d399);
}

.blog-card:nth-child(7)::before {
  background: linear-gradient(90deg, #F97316, #fb923c);
}

.blog-card:nth-child(8)::before {
  background: linear-gradient(90deg, #6366f1, #818cf8);
}

.blog-card.animate-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.blog-card:hover {
  border-color: rgba(16, 185, 129, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 25px rgba(16, 185, 129, 0.07);
  transform: translateY(-8px);
}

.blog-card:nth-child(2):hover {
  border-color: rgba(249, 115, 22, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 25px rgba(249, 115, 22, 0.07);
}

.blog-card:nth-child(3):hover {
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 25px rgba(99, 102, 241, 0.07);
}

.blog-card:nth-child(4):hover {
  border-color: rgba(236, 72, 153, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 25px rgba(236, 72, 153, 0.07);
}

.blog-card:nth-child(5):hover {
  border-color: rgba(14, 165, 233, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 25px rgba(14, 165, 233, 0.07);
}

.blog-card:hover::before {
  transform: scaleX(1);
}

/* Card body wrapper */
.blog-card-body {
  padding: 28px 26px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Post number badge */
.blog-card-number {
  font-size: 0.72rem;
  font-weight: 700;
  color: #10B981;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
  opacity: 0.75;
}

.blog-card:nth-child(2) .blog-card-number {
  color: #F97316;
}

.blog-card:nth-child(3) .blog-card-number {
  color: #6366f1;
}

.blog-card:nth-child(4) .blog-card-number {
  color: #ec4899;
}

.blog-card:nth-child(5) .blog-card-number {
  color: #0ea5e9;
}

.blog-card:nth-child(6) .blog-card-number {
  color: #10B981;
}

.blog-card:nth-child(7) .blog-card-number {
  color: #F97316;
}

.blog-card:nth-child(8) .blog-card-number {
  color: #6366f1;
}

.blog-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #F1F5F9;
  line-height: 1.45;
  margin-bottom: 12px;
  transition: color 0.25s ease;
}

.blog-card:hover h2 {
  color: #FFFFFF;
}

.blog-card p {
  font-size: 0.88rem;
  color: #64748B;
  line-height: 1.7;
  flex: 1;
  margin-bottom: 20px;
}

/* Card footer */
.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: auto;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  font-weight: 700;
  color: #10B981;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: gap 0.25s ease, color 0.25s ease;
}

.read-more::after {
  content: '→';
  transition: transform 0.25s ease;
}

.blog-card:hover .read-more {
  gap: 12px;
  color: #34d399;
}

.blog-card:hover .read-more::after {
  transform: translateX(4px);
}

.blog-card:nth-child(2) .read-more {
  color: #F97316;
}

.blog-card:nth-child(3) .read-more {
  color: #6366f1;
}

.blog-card:nth-child(4) .read-more {
  color: #ec4899;
}

.blog-card:nth-child(5) .read-more {
  color: #0ea5e9;
}

.blog-card:nth-child(6) .read-more {
  color: #10B981;
}

.blog-card:nth-child(7) .read-more {
  color: #F97316;
}

.blog-card:nth-child(8) .read-more {
  color: #6366f1;
}

.blog-card-min {
  font-size: 0.75rem;
  color: #475569;
}

/* =============================================
   BLOG MODAL
   ============================================= */
.blog-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
}

.blog-modal.active {
  display: flex;
  animation: blogFadeIn 0.35s ease;
}

@keyframes blogFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.blog-modal .modal-content {
  background: rgba(10, 15, 30, 0.98);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: #CBD5E1;
  padding: 44px 36px 36px;
  max-width: 650px;
  width: 100%;
  border-radius: 24px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 40px rgba(16, 185, 129, 0.07);
  animation: blogModalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  overflow-y: auto;
}

@keyframes blogModalIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.blog-modal .modal-content h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: #F1F5F9;
  line-height: 1.4;
  margin-bottom: 20px;
  padding-right: 40px;
}

.blog-modal .modal-content p {
  font-size: 0.95rem;
  line-height: 1.85;
  color: #94A3B8;
}

.blog-modal .close-modal {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  border-radius: 10px;
  font-size: 1.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
  line-height: 1;
  font-weight: 700;
  padding: 0;
}

.blog-modal .close-modal:hover {
  background: #ef4444;
  color: #fff;
  transform: rotate(90deg);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .blog-heading h1 {
    font-size: 1.7rem;
  }

  .blog-modal .modal-content {
    padding: 32px 22px 24px;
  }
}

/* =============================================
   LIGHT MODE
   ============================================= */
.light-mode .blog-section {
  color: #0F172A;
}

.light-mode .blog-heading h1 {
  background: linear-gradient(90deg, #0F766E, #14b8a6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.light-mode .blog-heading p {
  color: #4B5563;
}

.light-mode .blog-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.07);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

.light-mode .blog-card:hover {
  border-color: rgba(15, 118, 110, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.light-mode .blog-card h2 {
  color: #0F172A;
}

.light-mode .blog-card p {
  color: #4B5563;
}

.light-mode .blog-card-footer {
  border-top-color: rgba(0, 0, 0, 0.06);
}

.light-mode .blog-card-min {
  color: #9CA3AF;
}

.light-mode .blog-modal {
  background: rgba(0, 0, 0, 0.5);
}

.light-mode .blog-modal .modal-content {
  background: #F8FAFC;
  border-color: rgba(15, 118, 110, 0.15);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

.light-mode .blog-modal .modal-content h2 {
  color: #0F172A;
}

.light-mode .blog-modal .modal-content p {
  color: #374151;
}