:root {
  --study-program-nav-half: 49px;
}

.study-program-hero {
  position: relative;
  min-height: 768px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.study-program-hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 21, 50, 0.34);
  pointer-events: none;
}

.study-program-hero__fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 185px;
  background: linear-gradient(0deg, rgba(13, 21, 50, 0.8) 1.92%, rgba(13, 21, 50, 0.8) 51.44%, rgba(13, 21, 50, 0) 98.56%);
  pointer-events: none;
}

.study-program-hero__inner {
  min-height: 768px;
}

.study-program-hero__title-band {
  padding-bottom: 12px;
}

.study-program-hero__title {
  margin: 0;
  color: #FFFFFF;
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-shadow: 0 2px 8px rgba(13, 21, 50, 0.4);
}

.study-program-hero__nav-stack {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  /* JS syncs this on :root based on actual program-nav height. */
  padding-bottom: calc(var(--study-program-nav-half) + 2.0175rem);
}

.study-program-hero__category-band {
  position: relative;
  z-index: 1;
}

.study-program-hero__category-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  padding: 8px 0;
}

.study-program-hero__category-nav::-webkit-scrollbar {
  display: none;
}

.study-program-hero__category-item {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: clamp(11px, 1.05vw, 15px);
  font-weight: 500;
  line-height: 1.15;
  padding: 7px 12px;
  border-radius: 9999px;
  border: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
  text-align: center;
}

.study-program-hero__category-item.is-active,
.study-program-hero__category-item:hover,
.study-program-hero__category-item:focus-visible {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.95);
  outline: none;
}

.study-program-hero__program-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateY(50%);
}

.study-program-hero__program-nav {
  display: flex;
  width: 100%;
  background: #FBFBFB;
  border-radius: 1.125rem;
  overflow: hidden;
  box-shadow: 0px 4px 8px 0px #0D153240;
  border: 1px solid rgba(44, 46, 131, 0.14);
}

.study-program-hero__program-item {
  flex: 1 1 0;
  text-align: center;
  text-decoration: none;
  color: var(--color-primary, #2C2E83);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(44, 46, 131, 0.14);
  position: relative;
  isolation: isolate;
}

.study-program-hero__program-item:last-child {
  border-right: 0;
}

.study-program-hero__program-item > span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.study-program-hero__program-nav[data-count="8"],
.study-program-hero__program-nav[data-count="9"],
.study-program-hero__program-nav[data-count="10"],
.study-program-hero__program-nav[data-count="11"],
.study-program-hero__program-nav[data-count="12"] { overflow-x: auto; overflow-y: visible; }

.study-program-hero__program-nav[data-count="8"] .study-program-hero__program-item,
.study-program-hero__program-nav[data-count="9"] .study-program-hero__program-item,
.study-program-hero__program-nav[data-count="10"] .study-program-hero__program-item,
.study-program-hero__program-nav[data-count="11"] .study-program-hero__program-item,
.study-program-hero__program-nav[data-count="12"] .study-program-hero__program-item { flex: 0 0 auto; }

.study-program-hero__program-item.is-active {
  background: none;
  color: #FFFFFF;
}

.study-program-hero__program-item.is-active::before {
  content: '';
  position: absolute;
  inset: 5px;
  background: linear-gradient(321.06deg, #2D2E83 -40.98%, #0D1532 157.1%);
  z-index: -1;
}

/* Match nav's outer border-radius (1.125rem = 18px) minus the 5px inset = 13px on outer corners */
.study-program-hero__program-item:first-child.is-active::before {
  border-radius: 13px 0 0 13px;
}

.study-program-hero__program-item:last-child.is-active::before {
  border-radius: 0 13px 13px 0;
}

.node-study-program {
  /* section wrapper already adds pt-16 (4rem ≈ 3.9375rem Figma target); only clear the nav overlap here */
  padding-top: var(--study-program-nav-half);
  padding-bottom: 3rem;
}

.node-study-program__inner {
  display: grid;
  grid-template-columns: minmax(0, 463fr) minmax(0, 437fr);
  gap: 40px;
  align-items: start;
}

.node-study-program__image-wrap {
  border-radius: 20px;
  overflow: hidden;
}

.node-study-program__image-wrap--placeholder {
  aspect-ratio: 926 / 768;
  background-image: radial-gradient(120% 110% at 18% 20%, rgba(45, 46, 131, 0.06) 0%, rgba(45, 46, 131, 0) 58%),
                    radial-gradient(90% 90% at 82% 78%, rgba(13, 21, 50, 0.05) 0%, rgba(13, 21, 50, 0) 62%);
}

.node-study-program__image {
  width: 100%;
  height: auto;
  display: block;
}

.node-study-program__title {
  margin: 0;
  color: var(--color-text, #0D1532);
  font-size: 60px;
  line-height: 0.98;
  font-weight: 700;
}

.node-study-program__content {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.node-study-program__header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.node-study-program__description {
  font-size: 17px;
  font-weight: 400;
  color: rgba(13, 21, 50, 0.8);
  line-height: 1.2;
  margin: 0;
}

.node-study-program__stats {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.node-study-program__stat {
  display: flex;
  align-items: center;
  gap: 24px;
}

.node-study-program__stat-icon {
  flex-shrink: 0;
  width: 69px;
  height: 69px;
}

.node-study-program__stat-text {
  font-size: 21px;
  font-weight: 700;
  color: #0D1532;
  line-height: 1.1;
  margin: 0;
}

.node-study-program__note {
  display: flex;
  align-items: center;
  border-left: 4px solid #0D1532;
  background: linear-gradient(90deg, rgba(44, 46, 131, 0.38) 0%, rgba(44, 46, 131, 0) 100%);
  min-height: 69px;
  padding: 15px 70px 15px 23px;
  font-size: 18px;
  color: rgba(13, 21, 50, 0.8);
  line-height: 1.2;
  margin: 0;
}

.node-study-program__cta {
  align-self: start;
}

@media (min-width: 768px) {
  .node-study-program {
    padding-bottom: 3rem;
  }
}

@media (max-width: 767px) {
  .study-program-hero {
    min-height: 380px;
  }

  .study-program-hero__inner {
    min-height: 380px;
  }

  .study-program-hero__fade {
    height: 75%;
  }

  .study-program-hero__nav-stack {
    padding-bottom: 0;
  }

  .study-program-hero__title {
    font-size: 1.875rem;
  }

  .study-program-hero__category-band .site-container {
    padding-left: 0;
    padding-right: 0;
  }

  .study-program-hero__category-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: stretch;
    gap: 8px;
    padding: 8px;
    overflow: visible;
  }

  .study-program-hero__category-item {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.4375rem, 2.4vw, 0.875rem);
    line-height: 1.2;
    padding: 10px 8px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    text-align: center;
  }

  .study-program-hero__category-item.is-active {
    border-radius: 0.5rem;
    border: 1px solid rgba(251, 251, 251, 0.80);
    background: #FBFBFB;
    color: #0D1532;
    box-shadow: 0 0.981px 3.434px 0 rgba(13, 21, 50, 0.80);
  }

  .study-program-hero__category-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  /* Program-wrap: flush to bottom of hero, full-bleed, no translateY */
  .study-program-hero__program-wrap {
    position: static;
    transform: none;
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;
  }

  .study-program-hero__program-nav {
    border-radius: 0;
    box-shadow: none;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    justify-content: safe center;
  }

  .study-program-hero__program-nav::-webkit-scrollbar {
    display: none;
  }

  .study-program-hero__program-item,
  .study-program-hero__program-nav[data-count] .study-program-hero__program-item {
    flex: 0 0 auto;
    font-size: 16px;
    padding: 14px 20px;
    white-space: nowrap;
  }

  .node-study-program {
    /* section wrapper already adds pt-12 (3rem); no extra padding needed on mobile */
    padding-top: 0;
  }

  .node-study-program__inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .node-study-program__title {
    font-size: 45px;
  }

  .node-study-program__stat-icon {
    width: 56px;
    height: 56px;
  }

  .node-study-program__stat-text {
    font-size: 18px;
  }

  .node-study-program__content {
    gap: 20px;
  }

  .node-study-program__note {
    min-height: auto;
    padding: 12px 20px 12px 18px;
    font-size: 17px;
  }
}
