/* Popular Blog Widget Style */

.popular-blog-wrapper {
  width: 100%;
  margin: 0 auto;
  padding-top: 40px;
}

.popular-blog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  grid-template-rows: repeat(2, 1fr);
  column-gap: 45px;
  row-gap: 20px;
  width: 100%;
  /* min-height: 500px; */
}

/* Featured Card (Left - spans 2 rows) */
.popular-blog-card.featured-card {
  grid-column: 1 / 4;
  grid-row: 1 / 3;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
  background: #ebf8ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

/* Small Cards (Right - each takes 1 row) */
.popular-blog-card.small-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
  background: #ebf8ff;
  display: flex;
  flex-direction: column;
}

.popular-blog-card.small-card:nth-child(2) {
  grid-column: 4 / 6;
  grid-row: 1 / 2;
}

.popular-blog-card.small-card:nth-child(3) {
  grid-column: 4 / 6;
  grid-row: 2 / 3;
}

/* Card Link */
.popular-blog-card .blog-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

/* Image Styling */
.popular-blog-card .blog-image {
  position: relative;
  width: 100%;
  overflow: hidden;
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
  flex-shrink: 0;
}

/* Featured Card Image (taller) */
.popular-blog-card.featured-card .blog-image {
  /* height: 300px; */
}

/* Small Cards Image (shorter) */
.popular-blog-card.small-card .blog-image {
  /* height: 140px; */
}

/* Different gradient backgrounds for each card */
.popular-blog-card.featured-card .blog-image {
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
}

.popular-blog-card.small-card:nth-child(2) .blog-image {
  /* background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); */
}

.popular-blog-card.small-card:nth-child(3) .blog-image {
  /* background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); */
}

.popular-blog-card .blog-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.popular-blog-card:hover .blog-thumbnail {
  transform: scale(1.1);
}

.popular-blog-card .blog-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Content Styling */
.popular-blog-card .blog-content {
  padding: 32px;
  background: #ebf8ff;
  /* flex-grow: 1; */
  display: flex;
  flex-direction: column;
}

.popular-blog-card.small-card .blog-content {
  padding: 24px;
}

/* Title */
.popular-blog-card .blog-title {
  max-width: 649px;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 16px 0;
  color: #350f6b;
  transition: color 0.3s ease;
}

.popular-blog-card.small-card .blog-title {
  max-width: 327px;
  font-size: 28px;
  line-height: 1.3;
  margin-bottom: 0;
}

.popular-blog-card:hover .blog-title {
  color: #667eea;
}

/* Excerpt (only for featured card) */
.popular-blog-card .blog-excerpt {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  color: #350f6b;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* No Posts Message */
.popular-blog-no-posts {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
}

.popular-blog-no-posts p {
  font-size: 16px;
  margin: 0;
}

/* Responsive Design */

/* Tablet - 768px to 1024px */
@media screen and (max-width: 1024px) and (min-width: 768px) {
  .popular-blog-grid {
    gap: 20px;
    min-height: 450px;
  }

  .popular-blog-card.featured-card .blog-image {
    height: 250px;
  }

  .popular-blog-card.small-card .blog-image {
    height: 120px;
  }

  .popular-blog-card .blog-content {
    padding: 20px;
  }

  .popular-blog-card.small-card .blog-content {
    padding: 18px;
  }

  .popular-blog-card .blog-title {
    font-size: 17px;
  }

  .popular-blog-card.small-card .blog-title {
    font-size: 15px;
  }

  .popular-blog-card .blog-excerpt {
    font-size: 13.5px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}

/* Mobile - Below 768px */
@media screen and (max-width: 767px) {
  .popular-blog-wrapper {
    /* padding: 15px 0; */
  }

  .popular-blog-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 16px;
    min-height: auto;
  }

  /* Reset grid positioning for mobile */
  .popular-blog-card.featured-card {
    grid-column: 1 / 2;
    grid-row: auto;
  }

  .popular-blog-card.small-card:nth-child(2),
  .popular-blog-card.small-card:nth-child(3) {
    grid-column: 1 / 2;
    grid-row: auto;
  }

  .popular-blog-card.featured-card .blog-image {
    height: 220px;
  }

  .popular-blog-card.small-card .blog-image {
    height: 180px;
  }

  .popular-blog-card .blog-content {
    padding: 18px;
  }

  .popular-blog-card.small-card .blog-content {
    padding: 18px;
  }

  .popular-blog-card .blog-title {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .popular-blog-card.small-card .blog-title {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .popular-blog-card .blog-excerpt {
    font-size: 13px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .popular-blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  }
}

/* Extra Small Mobile - Below 480px */
@media screen and (max-width: 480px) {
  .popular-blog-wrapper {
    /* padding: 10px 0; */
  }

  .popular-blog-grid {
    gap: 12px;
  }

  .popular-blog-card.featured-card .blog-image,
  .popular-blog-card.small-card .blog-image {
    height: 180px;
  }

  .popular-blog-card .blog-content,
  .popular-blog-card.small-card .blog-content {
    padding: 16px;
  }

  .popular-blog-card .blog-title,
  .popular-blog-card.small-card .blog-title {
    font-size: 15px;
  }

  .popular-blog-card .blog-excerpt {
    font-size: 12.5px;
  }
}

/* Elementor Editor Specific Styles */
.elementor-editor-active .popular-blog-card {
  pointer-events: auto;
}

/* Smooth Animations */
.popular-blog-card,
.popular-blog-card .blog-thumbnail,
.popular-blog-card .blog-title {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
