/* Course page header: desktop = title + (3 cols | author); mobile = stacked, no overlap */
.course-header-card {
  box-sizing: border-box;
  overflow: hidden;
}

.course-header-title {
  display: block;
  width: 100%;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.course-header-body {
  display: flex;
  width: 100%;
  min-width: 0;
  position: relative;
  isolation: isolate;
}

.course-header-info-grid {
  min-width: 0;
  width: 100%;
  position: relative;
  z-index: 1;
}

.course-header-info-grid > * {
  min-width: 0;
}

.course-header-author {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

.course-header-author .authors-swiper {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  contain: layout style;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.course-header-author .authors-swiper .course-authors-swiper,
.course-header-author .authors-swiper .swiper {
  touch-action: pan-x pinch-zoom;
  -webkit-overflow-scrolling: touch;
}

.course-header-author .authors-swiper .swiper,
.course-header-author .authors-swiper .swiper-wrapper {
  width: 100% !important;
  max-width: 100%;
}

.course-header-author .authors-swiper .swiper-slide {
  box-sizing: border-box;
}

.course-header-author .authors-swiper .swiper-slide > div {
  min-height: 0 !important;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.course-header-author .authors-swiper img {
  width: 100% !important;
  max-width: 144px;
  height: auto !important;
  aspect-ratio: 1;
  max-height: 144px;
  object-fit: contain;
}

/* Mobile + narrow phones (incl. iPhone): stack blocks, single author slide */
@media (max-width: 767px) {
  .course-header-body {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .course-header-info-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    flex: none !important;
    width: 100% !important;
  }

  .course-header-author {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex-shrink: 0 !important;
    margin-top: 4px;
  }

  .course-header-author .authors-swiper {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .course-header-author .authors-swiper .swiper-slide {
    width: 100% !important;
  }

  .course-header-author .authors-swiper .swiper-slide > div {
    padding: 12px 16px !important;
    min-height: 0 !important;
  }

  .course-header-author .authors-swiper img {
    max-width: 120px;
    max-height: 120px;
  }
}

@media (min-width: 768px) {
  .course-header-body {
    flex-direction: row !important;
    align-items: stretch !important;
  }

  .course-header-info-grid {
    flex: 1 1 0 !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .course-header-author {
    align-self: stretch;
    display: flex;
    flex-direction: column;
  }

  .course-header-author .authors-swiper .swiper-slide > div {
    min-height: 220px !important;
    padding: 16px 24px !important;
  }
}

/* iOS Safari: prevent compositor overlap glitches */
@supports (-webkit-touch-callout: none) {
  .course-header-card,
  .course-header-body,
  .course-header-author .authors-swiper {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
}
