/**
 * Knowledge Slider Styles
 * Aligned with Popular Courses design system
 */

/* Container */
.knowledge-slider-container {
  position: relative;
  width: 100%;
}

/* Section Header */
.knowledge-section-header {
  margin-bottom: 40px;
  text-align: center;
}

.knowledge-section-subtitle {
  font-size: 14px;
  color: var(--iabt-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}

.knowledge-section-title {
  font-family: var(--iabt-font-family);
  font-size: var(--iabt-h2);
  font-weight: var(--iabt-font-bold);
  line-height: var(--iabt-line-height-heading);
  color: var(--iabt-text-heading);
  margin: 0;
}

/* =================================
   Post Card - Matched to Popular Courses
================================= */
.knowledge-post-card {
  background: var(--iabt-bg-main);
  border-radius: 18px;
  overflow: hidden;
  transition: all 0.4s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--iabt-blue-soft);
  box-shadow: 0 6px 20px var(--iabt-shadow);
  position: relative;
}

.knowledge-post-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 50px var(--iabt-shadow);
  border-color: var(--iabt-border);
}

.knowledge-post-card:hover::before {
  transform: scaleX(1.02);
}

/* Post Image */
.knowledge-post-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--iabt-bg-soft);
}

.knowledge-post-image a {
  display: block;
  position: relative;
  overflow: hidden;
}

.knowledge-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
  transform: scale(1);
}

.knowledge-post-card:hover .knowledge-post-image img {
  transform: scale(1.06);
}

/* Category Badge - Overlay on Image (like course rating) */
.knowledge-category-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-block;
  background: var(--iabt-blue-soft);
  color: var(--iabt-primary);
  font-size: var(--iabt-text-xs);
  font-weight: var(--iabt-font-semibold);
  padding: 6px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: var(--iabt-letter-spacing-wide);
  border: 1px solid hsl(var(--iabt-primary-hsl), 0.2);
  backdrop-filter: blur(6px);
  z-index: 2;
}

/* Legacy category styling (fallback) */
.knowledge-post-category {
  display: inline-block;
  padding: 6px 12px;
  background: var(--iabt-blue-soft);
  color: var(--iabt-primary);
  font-size: var(--iabt-text-xs);
  font-weight: var(--iabt-font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--iabt-letter-spacing-wide);
  border-radius: 999px;
  border: 1px solid hsl(var(--iabt-primary-hsl), 0.2);
}

/* Post Content - Compact sizing like Popular Courses */
.knowledge-post-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Post Meta */
.knowledge-post-meta {
  margin-bottom: 0;
}

/* Post Title */
.knowledge-post-title {
  font-size: var(--iabt-h4);
  font-weight: var(--iabt-font-semibold);
  line-height: var(--iabt-line-height-heading);
  letter-spacing: var(--iabt-letter-spacing-tight);
  margin: 0;
  color: var(--iabt-text-heading);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.knowledge-post-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.knowledge-post-title a:hover {
  color: var(--iabt-text-accent);
}

/* Post Date */
.knowledge-post-date {
  font-size: var(--iabt-text-sm);
  color: var(--iabt-text-muted);
  display: flex;
  align-items: center;
}

.knowledge-post-date:before {
  content: "\f017";
  font-family: "Font Awesome 5 Free";
  font-weight: 400;
  margin-right: 6px;
  opacity: 0.6;
}

/* Post Excerpt */
.knowledge-post-excerpt {
  font-size: var(--iabt-text-sm);
  line-height: var(--iabt-line-height-body);
  color: var(--iabt-text-body);
  margin-bottom: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Read More Button - Matched to Popular Courses */
.iabt-btn--readmore {
  padding: 12px 18px;
  align-self: flex-start;
  margin-top: auto;
}


/* =================================
   Responsive Styles
================================= */
@media only screen and (max-width: 1024px) {
  .knowledge-section-title {
    font-size: 30px;
  }

  .knowledge-post-title {
    font-size: var(--iabt-h5);
  }

  .knowledge-post-content {
    padding: 20px;
  }
}

@media only screen and (max-width: 768px) {
  .knowledge-section-title {
    font-size: 28px;
  }

  .knowledge-section-subtitle {
    font-size: 13px;
  }

  .knowledge-post-title {
    font-size: var(--iabt-h6);
  }

  .knowledge-post-content {
    padding: 16px;
    gap: 8px;
  }

  .knowledge-post-excerpt {
    font-size: var(--iabt-text-xs);
  }

  .iabt-btn--readmore {
    padding: 10px 14px;
    font-size: var(--iabt-text-sm);
    gap: 6px;
  }

  .knowledge-category-badge {
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    font-size: 10px;
  }
}

@media only screen and (max-width: 576px) {
  .knowledge-section-header {
    margin-bottom: 30px;
  }

  .knowledge-section-title {
    font-size: 24px;
  }

  .knowledge-section-subtitle {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .knowledge-post-title {
    font-size: 16px;
    margin-bottom: 0;
  }

  .knowledge-post-content {
    padding: 15px;
  }

  .knowledge-post-excerpt {
    font-size: 13px;
  }

  .iabt-btn--readmore {
    padding: 8px 16px;
    font-size: 12px;
  }
}

/* Empty State */
.elementor-widget-knowledge-slider-elementor .elementor-alert-info {
  padding: 40px 20px;
  text-align: center;
  background: var(--iabt-bg-soft);
  border-left: 4px solid var(--iabt-primary);
  border-radius: 4px;
}
