/* Card Height Fix - Ensures all cards have equal heights */

/* ===== Featured Course Cards ===== */
.featured-courses-collection-list {
  align-items: stretch !important;
  display: grid !important;
  grid-auto-rows: 1fr; /* Equal height rows */
}

.featured-courses-collection-item {
  display: flex;
  height: 100%;
}

.featured-courses-single {
  height: 100%;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.featured-courses-single-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
}

/* Typography section should flex */
.featured-courses-typography {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
}

/* Name wrap should take available space */
.featured-courses-name-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Course name and description area */
.featured-courses-name {
  margin-bottom: 10px;
}

/* Rating section - fixed height */
.featured-courses-rating {
  margin-bottom: 15px;
}

/* Video session time - fixed height */
.courses-video-session-time-wrap {
  margin-bottom: 20px;
}

/* Push button to bottom of card */
.featured-courses-button-wrapper,
.featured-courses-single .featured-courses-single-content-button {
  margin-top: auto !important;
  padding-top: 20px;
}

/* Ensure all buttons align */
.featured-courses-button-wrapper {
  display: flex;
  align-items: flex-end;
  min-height: 60px; /* Ensure minimum space for button */
  width: 100%;
}

/* Primary button in course cards */
.featured-courses-button-wrapper .primary-button {
  width: 100%;
  text-align: center;
}

/* Ensure image container is consistent */
.featured-courses-single-image,
.featured-courses-image-link {
  flex-shrink: 0;
  height: 200px;
  display: block;
  overflow: hidden;
}

.featured-courses-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== Testimonial Cards ===== */
.testimonials-grid {
  align-items: stretch !important;
}

.testimonials-card-wrapper {
  display: flex;
  height: 100%;
}

.testimonials-single-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100% !important;
}

.testimonials-single-card-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Push rating to bottom */
.testimonials-single-card .testimonials-single-card-rating {
  margin-top: auto;
  padding-top: 15px;
}

/* ===== Instructor Cards ===== */
.instructor-collection-list {
  align-items: stretch !important;
}

.instructor-collection-item {
  display: flex;
  height: 100%;
}

.instructor-single {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ===== Learning Path Cards ===== */
.learning-path-grid {
  align-items: stretch !important;
}

.learning-path-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ===== Responsive Adjustments ===== */
@media screen and (max-width: 991px) {
  /* Tablet: 2 columns */
  .featured-courses-collection-list,
  .testimonials-grid {
    align-items: stretch !important;
  }
}

@media screen and (max-width: 767px) {
  /* Mobile: Single column, auto height */
  .featured-courses-collection-list,
  .testimonials-grid {
    align-items: initial;
  }
  
  .featured-courses-single,
  .testimonials-single-card,
  .instructor-single,
  .learning-path-card {
    height: auto;
  }
}

/* ===== Universal Card Fixes ===== */
/* Any card with description text */
.card-description,
.featured-courses-single p,
.testimonials-single-card p {
  flex-grow: 1;
  margin-bottom: 15px;
}

/* Ensure consistent spacing */
.featured-courses-single > *:last-child,
.testimonials-single-card > *:last-child {
  margin-bottom: 0;
}

/* Fix for any inline height styles */
[style*="height"] .featured-courses-single,
[style*="height"] .testimonials-single-card {
  height: 100% !important;
}

/* ===== Specific Course Card Button Alignment Fix ===== */
/* Ensure grid container has equal height items */
.featured-courses .featured-courses-collection-list,
.section.featured-courses .featured-courses-collection-list {
  display: grid !important;
  grid-auto-rows: 1fr !important;
  align-items: stretch !important;
}

/* Each card must be full height */
.featured-courses .featured-courses-single,
.section.featured-courses .featured-courses-single {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Typography section takes remaining space */
.featured-courses .featured-courses-typography,
.section.featured-courses .featured-courses-typography {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Name wrap section expands */
.featured-courses .featured-courses-name-wrap,
.section.featured-courses .featured-courses-name-wrap {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Button wrapper always at bottom */
.featured-courses .featured-courses-button-wrapper,
.section.featured-courses .featured-courses-button-wrapper {
  margin-top: auto !important;
  padding-top: 15px !important;
  width: 100% !important;
}

/* Ensure button takes full width */
.featured-courses .primary-button.secondary,
.section.featured-courses .primary-button.secondary {
  width: 100% !important;
  display: inline-block !important;
}