/* Last-loaded, page-scoped fixes for the requested responsive layouts. */

/* Keep the added homepage learning block aligned consistently on desktop and mobile. */
html body .ed-home-about-section .ed-about-added-context,
html body .ed-home-about-section .ed-about-added-context h5,
html body .ed-home-about-section .ed-about-extra-description,
html body .ed-home-about-section .ed-about-extra-description p {
  text-align: center !important;
}

html body .ed-home-about-section .ed-about-added-context .ed-about-extra-description,
html body .ed-home-about-section .ed-about-added-context .ed-about-extra-description p,
html body .ed-home-about-section .ed-about-added-context .ed-about-extra-description span,
html body .ed-home-about-section .ed-about-added-context .ed-about-extra-description li,
html body .ed-home-about-section .ed-about-added-context .ed-about-extra-description div {
  text-align: justify !important;
  text-justify: inter-word !important;
  text-align-last: left !important;
}

/* Shared pale-pink statistic cards, matching the supplied reference image. */
html body .mssp-dewhy-stat,
html body .why-learn-fr-stat-box,
html body .wlj-stat-box,
html body .mandarin-stat-box {
  display: flex !important;
  min-width: 0 !important;
  min-height: 119px !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 14px 10px !important;
  background: #fff1f1 !important;
  border: 0 !important;
  border-radius: 16px !important;
  box-shadow: none !important;
  text-align: center !important;
}

html body .mssp-dewhy-stats,
html body .why-learn-fr-stats,
html body .wlj-stats,
html body .mandarin-stats {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

html body .mssp-dewhy-stat-num-static,
html body .why-learn-fr-stat-num,
html body .wlj-stat-num,
html body .mandarin-stat-num {
  color: #e82127 !important;
  margin: 0 0 4px !important;
  font-size: clamp(25px, 2.2vw, 34px) !important;
  line-height: 1.15 !important;
  font-weight: 400 !important;
  text-align: center !important;
}

html body .mssp-dewhy-stat-label,
html body .why-learn-fr-stat-label,
html body .wlj-stat-label,
html body .mandarin-stat-label {
  color: #666 !important;
  margin: 0 !important;
  font-size: 15px !important;
  line-height: 1.35 !important;
  font-weight: 400 !important;
  text-align: center !important;
}

/* Keep dynamic course hero art anchored to the top so faces and flags are not cut off. */
html body.course-page .course-hero {
  background-position: center top !important;
}

/* Keep review copy readable on every colored homepage testimonial card. */
html body .ttm-section .ttm-card .ttm-text {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Keep blog card actions legible on their red button background. */
html body .it-blog-inner-style .it-blog-item .it-blog-btn .it-btn-yellow {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  min-width: 132px !important;
  min-height: 44px !important;
  padding: 0 22px !important;
  border-radius: 8px !important;
  background: #e82127 !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

html body .it-blog-inner-style .it-blog-item .it-blog-btn .it-btn-yellow span,
html body .it-blog-inner-style .it-blog-item .it-blog-btn .it-btn-yellow span span,
html body .it-blog-inner-style .it-blog-item:hover .it-blog-btn .it-btn-yellow span,
html body .it-blog-inner-style .it-blog-item:hover .it-blog-btn .it-btn-yellow span span {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html body .it-blog-inner-style .it-blog-item .it-blog-btn .it-btn-yellow > span {
  display: inline-block !important;
  overflow: hidden !important;
  line-height: 1.2 !important;
}

html body .it-blog-inner-style .it-blog-item .it-blog-btn .it-btn-yellow .text-1,
html body .it-blog-inner-style .it-blog-item .it-blog-btn .it-btn-yellow .text-2,
html body .it-blog-inner-style .it-blog-item:hover .it-blog-btn .it-btn-yellow .text-1,
html body .it-blog-inner-style .it-blog-item:hover .it-blog-btn .it-btn-yellow .text-2 {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 600 !important;
}

html body .it-blog-inner-style .it-blog-item .it-blog-btn .it-btn-yellow:hover {
  background: #c9151c !important;
  color: #ffffff !important;
}

/* Keep the homepage mission link visible as a full-size button in both states. */
html body.homepage-page main .ed-home-about-section .ed-about-actions #aboutReadMoreButton,
html body.homepage-page main #aboutReadMoreButton {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  min-width: 190px !important;
  min-height: 58px !important;
  padding: 0 28px !important;
  border: 2px solid #e82127 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #e82127 !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-decoration: none !important;
  cursor: pointer !important;
}

html body.homepage-page main .ed-home-about-section .ed-about-actions #aboutReadMoreButton span,
html body.homepage-page main #aboutReadMoreButton span {
  display: inline !important;
  color: #e82127 !important;
  -webkit-text-fill-color: #e82127 !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

html body.homepage-page main .ed-home-about-section .ed-about-actions #aboutReadMoreButton:hover,
html body.homepage-page main #aboutReadMoreButton:hover {
  background: #e82127 !important;
  color: #ffffff !important;
}

html body.homepage-page main .ed-home-about-section .ed-about-actions #aboutReadMoreButton:hover span,
html body.homepage-page main #aboutReadMoreButton:hover span {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Remove stray top spacing before course hero sections on both static and dynamic course pages. */
html body.course-page main.course-details-page {
  margin-top: 0 !important;
  padding-top: var(--header-space, 150px) !important;
}

html body.course-page > section.course-hero:first-of-type,
html body.course-page main.course-details-page > section.course-hero:first-child {
  margin-top: 0 !important;
}

/* The site header is fixed, so reserve its measured height before course content. */
html body.course-page > section.course-hero:first-of-type,
html body.course-page > .spanish-hero:first-of-type,
html body.course-page > .hero-slider:first-of-type,
html body.course-page > .hero-fr-hero:first-of-type,
html body.course-page > .hero-jp-hero:first-of-type {
  margin-top: var(--header-space, 150px) !important;
}

/* CEFR / JLPT cards: smaller, regular-weight typography and flexible height. */
html body .cefr-pro-section .cefr-pro-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)) !important;
  grid-auto-rows: auto !important;
  align-items: stretch !important;
  gap: 18px !important;
}

html body .cefr-pro-section .cefr-pro-card {
  min-height: 0 !important;
  height: auto !important;
  padding: 18px !important;
  font-weight: 400 !important;
}

html body .header .course-mini-img img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}

/* Blue level cards use the white, regular-weight paragraph treatment from the reference. */
html body .cefr-pro-section .cefr-pro-card.cefr-pro-tone-1 {
  /* Keep the accent blue so the hover pill has contrast against white text. */
  --level-color: #214b9b !important;
  --level-bg: #071d49 !important;
  --level-soft: rgba(255, 255, 255, .12) !important;
  color: #fff !important;
}

html body .cefr-pro-section .cefr-pro-card.cefr-pro-tone-1 .cefr-pro-card-head h3 {
  color: #214b9b !important;
  -webkit-text-fill-color: #214b9b !important;
}

html body .cefr-pro-section .cefr-pro-card.cefr-pro-tone-1:hover .cefr-pro-card-head h3 {
  background: #214b9b !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html body .cefr-pro-section .cefr-pro-card.cefr-pro-tone-1 .cefr-pro-card-head strong,
html body .cefr-pro-section .cefr-pro-card.cefr-pro-tone-1 .cefr-pro-description,
html body .cefr-pro-section .cefr-pro-card.cefr-pro-tone-1 .cefr-pro-list li {
  color: #fff !important;
  font-weight: 400 !important;
}

html body .cefr-pro-section .cefr-pro-card.cefr-pro-tone-1 .cefr-pro-description {
  font-size: 16px !important;
  line-height: 1.55 !important;
  text-align: justify !important;
  text-justify: inter-word !important;
}

html body .cefr-pro-section .cefr-pro-card-head {
  gap: 13px !important;
}

html body .cefr-pro-section .cefr-pro-icon {
  width: 68px !important;
  height: 68px !important;
  flex: 0 0 68px !important;
  font-size: 20px !important;
}

html body .cefr-pro-section .cefr-pro-card-head h3 {
  width: 168px !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 66px !important;
  margin: 0 0 14px !important;
  padding: 0 12px !important;
  font-size: clamp(12px, 1.2vw, 15px) !important;
  line-height: 1.15 !important;
  font-weight: 400 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

html body .cefr-pro-section .cefr-pro-card-head strong {
  display: block !important;
  font-size: 15px !important;
  line-height: 1.35 !important;
  font-weight: 400 !important;
}

html body .cefr-pro-section .cefr-pro-description {
  min-height: 0 !important;
  margin: 12px 0 !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  font-weight: 400 !important;
  text-align: left !important;
  text-justify: auto !important;
  word-spacing: normal !important;
  overflow-wrap: anywhere !important;
}

html body .cefr-pro-section .cefr-pro-list {
  margin: 0 !important;
  padding-left: 18px !important;
}

html body .cefr-pro-section .cefr-pro-list li {
  margin: 0 0 6px !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  font-weight: 400 !important;
}

@media (max-width: 767.98px) {
  html body .mssp-dewhy-stats,
  html body .why-learn-fr-stats,
  html body .wlj-stats,
  html body .mandarin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  html body.course-page .course-hero {
    background-position: 58% top !important;
  }

  html body .cefr-pro-section .cefr-pro-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html body .cefr-pro-section .cefr-pro-card {
    height: auto !important;
    padding: 16px !important;
  }

  html body .cefr-pro-section .cefr-pro-card-head h3 {
    height: 52px !important;
    margin-bottom: 12px !important;
    font-size: clamp(11px, 3.2vw, 14px) !important;
  }

  html body .cefr-pro-section .cefr-pro-description {
    font-size: 13px !important;
    line-height: 1.45 !important;
  }

  html body .mssp-dewhy-stat,
  html body .why-learn-fr-stat-box,
  html body .wlj-stat-box,
  html body .mandarin-stat-box {
    min-height: 112px !important;
    padding: 12px 7px !important;
    border-radius: 14px !important;
  }

  html body .mssp-dewhy-stat-num-static,
  html body .why-learn-fr-stat-num,
  html body .wlj-stat-num,
  html body .mandarin-stat-num {
    font-size: clamp(22px, 6vw, 30px) !important;
  }

  html body .mssp-dewhy-stat-label,
  html body .why-learn-fr-stat-label,
  html body .wlj-stat-label,
  html body .mandarin-stat-label {
    font-size: 13px !important;
  }
}
