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

/* Justify the homepage prose and the complete article body on blog detail pages. */
html body.homepage-page main p,
html body.homepage-page main li,
html body.homepage-page main blockquote,
html body.blog-details-page .postbox-dsc,
html body.blog-details-page .postbox-dsc p,
html body.blog-details-page .postbox-dsc li,
html body.blog-details-page .postbox-dsc blockquote,
html body.blog-details-page .postbox-dsc div,
html body.blog-details-page .ed-blog-quote {
  text-align: justify !important;
  text-justify: inter-word !important;
  text-align-last: left !important;
}

/* The homepage About copy is admin rich text; target its rendered blocks directly.
   Keep headings outside this rule so their existing alignment remains unchanged. */
html body.homepage-page main .ed-home-about-section .it-about-text .ed-about-dynamic-description,
html body.homepage-page main .ed-home-about-section .it-about-text .ed-about-dynamic-description p,
html body.homepage-page main .ed-home-about-section .it-about-text .ed-about-dynamic-description li,
html body.homepage-page main .ed-home-about-section .it-about-text .ed-about-dynamic-description blockquote,
html body.homepage-page main .ed-home-about-section .it-about-text .ed-about-dynamic-description .ed-about-extra-description,
html body.homepage-page main .ed-home-about-section .it-about-text .ed-about-dynamic-description .ed-about-extra-description p,
html body.homepage-page main .ed-home-about-section .it-about-text .ed-about-dynamic-description .ed-about-extra-description div {
  text-align: justify !important;
  text-justify: inter-word !important;
  text-align-last: left !important;
}

/* Copy directly below the homepage's four service buttons (About section). */
html body.homepage-page main section.ed-home-about-section .it-about-text p,
html body.homepage-page main section.ed-home-about-section .it-about-text li,
html body.homepage-page main section.ed-home-about-section .it-about-text blockquote,
html body.homepage-page main section.ed-home-about-section .it-about-text .ed-about-dynamic-description > div:not(.ed-about-added-context),
html body.homepage-page main section.ed-home-about-section .it-about-text .ed-about-extra-description,
html body.homepage-page main section.ed-home-about-section .it-about-text .ed-about-extra-description p,
html body.homepage-page main section.ed-home-about-section .it-about-text .ed-about-extra-description div {
  text-align: justify !important;
  text-justify: inter-word !important;
  text-align-last: left !important;
}

/* 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;
}

/* Shared corporate partner slider used by page-level visibility controls. */
html body .company-placement-section {
  width: 100%;
  padding: 38px 0;
  overflow: hidden;
  background: #fff;
}

html body .company-placement-heading {
  margin: 0 auto 25px;
  padding: 0 16px;
  text-align: center;
}

html body .company-placement-heading h2 {
  margin: 0 0 8px;
  color: #202938;
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 750;
}

html body .company-placement-heading h5 {
  margin: 0;
  color: #687385;
  font-size: 15px;
  font-weight: 400;
}

html body .company-placement-slider { position: relative; width: 100%; overflow: hidden; }
html body .company-placement-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: companyPlacementScroll 35s linear infinite;
  will-change: transform;
}
html body .company-placement-group { display: flex; align-items: center; flex: 0 0 auto; gap: 24px; }
html body .company-placement-item {
  box-sizing: border-box;
  display: flex;
  flex: 0 0 160px;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 78px;
  padding: 10px;
  border: 1px solid #ece7f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(25, 20, 35, .06);
  transition: transform .25s ease, box-shadow .25s ease;
}
html body .company-placement-item:hover { transform: translateY(-4px); box-shadow: 0 9px 22px rgba(25, 20, 35, .12); }
html body .company-placement-item img { display: block; width: auto; height: auto; max-width: 132px; max-height: 48px; object-fit: contain; }
@keyframes companyPlacementScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Keep the blog detail breadcrumb content below the fixed site header. */
html body.blog-details-page .ips-bc-hero {
  padding-top: var(--header-space, 150px) !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 .company-placement-section { padding: 28px 0; }
  html body .company-placement-heading { margin-bottom: 18px; }
  html body .company-placement-item { flex-basis: 132px; width: 132px; height: 66px; padding: 8px; }
  html body .company-placement-item img { max-width: 108px; max-height: 42px; }
  html body .company-placement-track { animation-duration: 28s; }
  html body .company-placement-group { gap: 14px; }

  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;
  }
}
