/**
 * Mobile program listing refinements.
 *
 * This file owns the final mobile presentation for canonical Program listings.
 * Desktop geometry remains in internal-layout.
 */
@media (max-width: 768px) {
  /* Listing pages use the canonical 16px mobile gutter. Legacy .container-inner
   * padding is removed here so the container width remains the only horizontal
   * spacing source instead of stacking 20px padding on top of that gutter. */
  body.jci-courses-page main :is(
    .jci-container.jci-container--page,
    .jci-container.jci-container--program,
    .jci-container.jci-container--secondary-nav
  ):not(.jci-program-listing-hero__features) {
    padding-left: 0;
    padding-right: 0;
  }

  /* Program type listing hero uses the same canonical mobile gutter as Courses.
   * Unlike Courses, its legacy `.container-inner` padding was still stacking
   * inside the 16px jci-container gutter. Remove that padding only from the
   * title and intro rows; the grey feature panel keeps its own internal padding. */
  body.jci-program-type-page .jci-program-listing-hero :is(
    .jci-program-listing-hero__title-row,
    .jci-program-listing-hero__intro
  ).jci-container {
    padding-left: 0;
    padding-right: 0;
  }

  /* Component-scoped fallback: the Courses route can be served through more than
   * one WordPress query shape under WPML. These unique component classes keep
   * layout correct even if a cached page was rendered without the helper body
   * class. */
  .jci-courses-nav-handoff .jci-container,
  .jci-courses-subject-nav.jci-container,
  #courses-results.jci-container,
  .jci-courses-industry.jci-container,
  .jci-courses-features.jci-container {
    padding-left: 0;
    padding-right: 0;
  }

  body.jci-courses-page .jci-program-listing-hero,
  body.jci-program-type-page .jci-program-listing-hero,
  body.jci-subject-area-page .masters-hero {
    padding-top: 32px;
    padding-bottom: 34px;
  }

  body.jci-courses-page .jci-program-listing-hero .masters-title,
  body.jci-program-type-page .jci-program-listing-hero .masters-title,
  body.jci-bachelors-page .masters-title,
  body.jci-vocational-training-page .masters-title,
  body.jci-subject-area-page .masters-title,
  body.jci-subject-area-page .masters-title-max {
    margin: 0;
  }

  body.jci-subject-area-page .masters-title,
  body.jci-subject-area-page .masters-title-max {
    font-size: clamp(38px, 10vw, 44px) !important;
    line-height: 1 !important;
  }

  /* These page families retain their own mobile title scale. */
  body.jci-subject-area-page .jci-subject-area-hero h1.masters-title-max,
  body main h1.font-rala {
    font-size: 40px !important;
    line-height: 1.06 !important;
    letter-spacing: var(--jci-page-heading-tracking, var(--jci-mobile-page-title-tracking)) !important;
  }

  body.jci-courses-page .jci-program-listing-hero .masters-title,
  body.jci-program-type-page .jci-program-listing-hero .masters-title,
  body.jci-bachelors-page .masters-title,
  body.jci-vocational-training-page .masters-title,
  body.jci-subject-area-page .masters-title,
  body.jci-subject-area-page .masters-title-max {
    max-width: 100%;
  }

  body.jci-courses-page .jci-program-listing-hero__intro,
  body.jci-program-type-page .jci-program-listing-hero__intro {
    margin-top: 26px;
  }

  body.jci-courses-page .jci-program-listing-hero__intro h2,
  body.jci-program-type-page .jci-program-listing-hero__intro h2,
  body.jci-subject-area-page .masters-subtitle-max {
    max-width: 32rem;
    margin: 0;
    padding: 0;
  }

  body.jci-courses-page .jci-program-listing-hero__intro h2,
  body.jci-program-type-page .jci-program-listing-hero__intro h2,
  body.jci-subject-area-page .masters-subtitle-max,
  body.jci-courses-page .jci-courses-on-demand > h2 {
    font-size: clamp(22px, 6.3vw, 28px);
    line-height: 1.12;
  }

  body.jci-courses-page .jci-program-listing-hero__intro .font18,
  body.jci-program-type-page .jci-program-listing-hero__intro .font18,
  body.jci-subject-area-page .masters-subtitle-max {
    line-height: 1.5;
  }

  /* Give the Course hero subtitle and description distinct editorial beats.
   * The legacy padtop0mobile utility intentionally remains untouched; margin
   * provides the spacing without reintroducing utility-specific overrides. */
  body.jci-courses-page .jci-program-listing-hero__intro .font18,
  body.jci-program-type-page .jci-program-listing-hero__intro .font18 {
    margin-top: 14px;
  }

  /* The intro owns the gap before the feature panel. Remove only the final
   * paragraph's legacy spacing so it does not stack with the wrapper padding. */
  body.jci-program-type-page .jci-program-listing-hero__intro .font18 {
    padding-bottom: 16px;
  }

  body.jci-program-type-page .jci-program-listing-hero__intro .font18 > :last-child {
    margin-bottom: 0;
    padding-bottom: 0;
  }

  /* Courses mobile catalogue.
   *
   * Keep one source of truth for the mobile filter, results rhythm and the two
   * editorial blocks below the catalogue. The canonical jci-container owns the
   * 16px page gutter; this layer only removes legacy inner padding and defines
   * component spacing. */
  .jci-courses-subject-menu-bar {
    margin: 20px 0 0;
    border-top: 1px solid rgba(7, 27, 58, .16);
    border-bottom: 1px solid rgba(7, 27, 58, .16);
    background: #fff;
  }

  .jci-courses-subject-nav .jci-horizontal-menu__disclosure {
    min-height: 64px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .jci-courses-subject-nav .jci-horizontal-menu__disclosure-value {
    display: block;
    min-width: 0;
    margin-left: 0;
  }

  .jci-courses-subject-nav .jci-horizontal-menu__disclosure-label {
    display: block;
    overflow: hidden;
    color: var(--color-brand-blue, #487cff);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .jci-courses-subject-nav .jci-horizontal-menu__item.is-active > .jci-horizontal-menu__link,
  .jci-courses-subject-nav .jci-horizontal-menu__link.is-active {
    --jci-secondary-nav-disclosure-link-end: 30px;
    position: relative;
  }

  .jci-courses-subject-nav .jci-horizontal-menu__item.is-active > .jci-horizontal-menu__link::after,
  .jci-courses-subject-nav .jci-horizontal-menu__link.is-active::after {
    content: "✓";
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    font-size: 13px;
    line-height: 1;
  }

  #courses-results {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 28px;
    padding-bottom: 0;
  }

  #courses-results .jci-program-card--course-grid {
    width: 100%;
    margin: 0;
    padding: 0;
    border-bottom: 0;
  }

  #courses-results .jci-program-card--course-grid:first-child {
    padding-top: 0;
  }

  #courses-results .jci-program-card--course-grid .jci-program-card__media {
    width: 100%;
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  #courses-results .jci-program-card--course-grid .jci-program-card__body {
    display: block;
    flex: none;
    padding-top: 12px;
  }

  #courses-results .jci-program-card--course-grid .jci-program-card__catalog-meta {
    margin: 0;
    padding: 0;
  }

  #courses-results .jci-program-card__description {
    margin: 8px 0 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.45;
  }

  [data-jci-course-listing-toggle-wrap] {
    padding-top: 48px;
  }

  .jci-courses-industry {
    margin-top: 0;
    padding-top: 16px;
  }

  .jci-courses-industry .font18.padtop20 {
    padding-top: 14px;
  }

  .jci-courses-industry .row.margtop40 {
    margin-top: 18px;
  }

  .jci-courses-industry__image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin-top: 18px;
    object-fit: contain;
  }

  .jci-courses-features {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 24px;
    padding-bottom: 0;
  }

  .jci-courses-features > h2 {
    max-width: 34rem;
    margin: 0 0 28px;
    padding: 0;
    color: var(--color-brand-navy, #041c40);
    font-family: "DM Sans", "DM Sans Fallback", sans-serif;
    font-size: clamp(36px, 10vw, 40px);
    font-weight: 700;
    letter-spacing: var(--jci-page-heading-tracking, -.02em);
    line-height: 1;
    text-align: left;
  }

  .jci-courses-features__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    width: 100%;
    margin: 0;
  }

  .jci-courses-feature {
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    margin: 0;
    padding: 0;
  }

  .jci-courses-feature__icon {
    width: 40px;
    height: 40px;
    padding: 3px;
    box-sizing: border-box;
    object-fit: contain;
  }

  .jci-courses-feature__content {
    display: grid;
    gap: 0;
    min-width: 0;
  }

  .jci-courses-feature__title {
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.25;
  }

  .jci-courses-feature__description {
    max-width: none;
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.5;
  }

  .jci-courses-features ~ .jci-faqs {
    margin-top: 34px;
  }

  /* Courses FAQs use the same compact type scale as the catalogue while the
   * section heading remains clearly distinct and each summary stays a 44px
   * touch target. */
  body.jci-courses-page .jci-faqs {
    margin-bottom: 48px;
  }

  body.jci-courses-page .jci-faqs > h2 {
    margin: 0 0 14px;
    color: var(--color-brand-navy, #041c40);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
  }

  body.jci-courses-page .jci-faqs summary {
    padding: 10px 4px 10px 0;
  }

  body.jci-courses-page .jci-faqs__answer {
    padding: 0 26px 16px 0;
  }

  body.jci-courses-page .jci-faqs__answer p {
    margin-top: 0;
    font-size: 14px;
    line-height: 1.5;
  }

  /* Program-type listing spacing remains page-specific; the shared wide
   * testimonial geometry now lives with its desktop owner in internal-layout. */
  body.jci-program-type-page .jci-program-type-testimonial {
    margin-top: 64px;
    padding-bottom: 32px;
  }

  /* Masters-by-subject mobile presentation. The Page keeps its SEO route, but
   * presentation now consumes the same canonical container/navigation system as
   * the other Program listings. Native <details> replaces the former arrow +
   * hidden-class mechanism, which had no JavaScript controller. */
  body.jci-subject-area-page .jci-subject-area-listing-shell {
    display: flex;
    flex-direction: column;
  }

  body.jci-subject-area-page .jci-subject-area-program-type-menu {
    order: 1;
  }

  body.jci-subject-area-page .jci-subject-area-hero {
    order: 2;
  }

  body.jci-subject-area-page .jci-subject-area-programs {
    order: 3;
  }

  body.jci-subject-area-page .masters-content.bigger.jci-container,
  body.jci-subject-area-page .jci-subject-area-program.jci-container {
    padding-inline: 0;
  }

  body.jci-subject-area-page .jci-subject-area-program {
    --bs-gutter-x: 0;
    display: block;
    gap: 0;
    margin-left: auto;
    margin-right: auto;
  }

  body.jci-subject-area-page .jci-subject-area-program > [class*="col-"] {
    width: 100%;
    max-width: 100%;
    padding-inline: 0;
  }

  body.jci-subject-area-page .jci-subject-area-program-shell {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  body.jci-subject-area-page .jci-subject-area-program__primary {
    margin-top: 32px;
  }

  body.jci-subject-area-page .jci-subject-area-program .masters-title {
    margin: 0;
    font-size: clamp(30px, 9vw, 40px);
    line-height: 1;
  }

  body.jci-subject-area-page .jci-subject-area-program__subtitle {
    margin-top: 8px;
    margin-bottom: 18px;
    padding-top: 0;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-top: 0;
    object-fit: cover;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-details {
    position: relative;
    width: 100%;
    margin: 0;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-summary {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 8px 0;
    border: 0;
    background: #fff;
    color: var(--color-brand-blue, #487cff);
    cursor: pointer;
    list-style: none;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-summary::-webkit-details-marker {
    display: none;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-summary:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-summary-icon {
    display: block;
    width: 11px;
    height: 11px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transform-origin: center;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-details[open] {
    padding-bottom: 44px;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-details[open] > .jci-subject-area-program__mobile-summary {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-details[open] .jci-subject-area-program__mobile-summary-icon {
    transform: rotate(225deg) translate(-2px, -2px);
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-content {
    font-size: 14px;
    line-height: 1.55;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-meta,
  body.jci-subject-area-page .jci-subject-area-program__mobile-note {
    padding: 28px 24px;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-meta {
    display: grid;
    gap: 10px;
    background: var(--color-brand-blue, #487cff);
    color: #fff;
  }

  body.jci-subject-area-page .jci-subject-area-program.is-alternate .jci-subject-area-program__mobile-meta {
    background: #6a2cb8;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-meta > * {
    margin: 0;
    color: inherit;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-note {
    background: #ecf2ff;
    color: var(--color-brand-blue, #487cff);
    text-align: center;
  }

  body.jci-subject-area-page .jci-subject-area-program.is-alternate .jci-subject-area-program__mobile-note {
    background: #cdbbe0;
    color: #6a2cb8;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-note > :first-child,
  body.jci-subject-area-page .jci-subject-area-program__mobile-description > :first-child {
    margin-top: 0;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-note > :last-child,
  body.jci-subject-area-page .jci-subject-area-program__mobile-description > :last-child {
    margin-bottom: 0;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-description {
    margin-top: 28px;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-content > h3 {
    margin-top: 28px;
    margin-bottom: 14px;
    font-size: 22px;
    line-height: 1.2;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-content .listblue {
    margin-bottom: 24px;
    padding-left: 22px;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-content .listblue li {
    margin-bottom: 12px;
  }

  body.jci-subject-area-page .jci-subject-area-program__mobile-content .jci-program-card__cta {
    width: 100%;
    margin-top: 24px;
  }

  body.jci-subject-area-page .jci-subject-area-program + .hr,
  body.jci-subject-area-page .jci-subject-area-program-shell > .hr {
    margin-inline: 0;
  }

}
