/* ==================================================
   DESKTOP + TABLET
   ================================================== */

/* Base / desktop surfaces and page rhythm */
main {
  --program-border: rgba(7, 20, 47, 0.13);
  --program-border-strong: rgba(7, 20, 47, 0.2);
  --program-shadow: 0 12px 30px rgba(7, 20, 47, 0.075);
  --program-shadow-hover: 0 20px 42px rgba(7, 20, 47, 0.13);
  --program-ease: 280ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.programs-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(72px, 6.5vw, 94px);
  isolation: isolate;
}

.programs-hero::before {
  position: absolute;
  z-index: -1;
  inset: auto -8% -45% auto;
  width: clamp(340px, 52vw, 780px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255, 255, 255, 0.025), 0 0 0 140px rgba(255, 255, 255, 0.018);
  content: "";
  pointer-events: none;
}

.programs-hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(circle at 72% 24%, rgba(243, 107, 19, 0.11), transparent 30%);
  content: "";
  pointer-events: none;
}

.programs-hero__grid {
  display: grid;
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(0, 1.16fr) minmax(350px, 0.84fr);
  align-items: center;
  gap: clamp(38px, 5vw, 72px);
}

.programs-hero__copy {
  max-width: 820px;
}

.programs-hero h1 {
  max-width: 760px;
  margin-bottom: 20px;
}

.programs-hero p {
  max-width: 730px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.04rem;
}

.programs-hero__points,
.programs-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.programs-hero__actions {
  margin-top: 30px;
}

.programs-hero__points span {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.8rem;
  font-weight: 800;
}

.program-finder {
  display: grid;
  gap: 14px;
  padding: clamp(26px, 3vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055));
  box-shadow: 0 24px 64px rgba(3, 12, 30, 0.28);
  backdrop-filter: blur(10px);
}

.program-finder__heading {
  display: grid;
  gap: 5px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.program-finder__heading span {
  color: var(--fx-orange-500);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.program-finder__heading strong {
  color: #fff;
  font-size: 1.3rem;
}

.program-finder label {
  color: #fff;
  font-weight: 800;
}

.program-finder input,
.program-sort select {
  min-height: 50px;
  padding: 11px 14px;
  border: 1px solid var(--fx-line);
  border-radius: 10px;
  background: #fff;
}

.program-finder input:focus-visible,
.program-sort select:focus-visible,
.program-filter button:focus-visible,
.course-table-wrap:focus-visible {
  outline: 3px solid rgba(243, 107, 19, 0.38);
  outline-offset: 3px;
}

.program-finder p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
}

.program-finder__steps {
  display: grid;
  gap: 8px;
}

.program-finder__steps span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.85rem;
  font-weight: 700;
}

.program-finder__steps b {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--fx-navy-950);
  background: var(--fx-orange-500);
  font-size: 0.7rem;
}

.program-snapshot {
  position: relative;
  z-index: 2;
  margin-top: -1px;
  color: #fff;
  background: linear-gradient(90deg, var(--fx-navy-950), var(--fx-navy-900));
  box-shadow: 0 14px 34px rgba(3, 12, 30, 0.16);
}

.program-snapshot__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.program-snapshot__grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 22px clamp(14px, 2.5vw, 30px);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.program-snapshot__grid div:last-child {
  border: 0;
}

.program-snapshot strong {
  color: var(--fx-orange-500);
  font-size: 1.15rem;
}

.program-snapshot span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
}

.program-choice {
  padding-block: clamp(58px, 5.2vw, 74px);
  background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
}

.program-choice .section-heading {
  margin-bottom: clamp(26px, 3vw, 38px);
}

.program-choice__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 20px;
}

.program-choice article {
  position: relative;
  height: 100%;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--program-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--program-shadow);
  transition: transform var(--program-ease), border-color 280ms ease, box-shadow 280ms ease;
}

.program-choice article::after {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--fx-orange-500), rgba(243, 107, 19, 0.16));
  content: "";
}

.program-choice article > span {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(243, 107, 19, 0.2);
  border-radius: 50%;
  color: var(--fx-orange-600);
  background: var(--fx-orange-100);
  font-size: 0.75rem;
  font-weight: 900;
}

.program-choice h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.program-choice p {
  margin: 0;
  font-size: 0.88rem;
}

.program-controls {
  position: relative;
  z-index: 3;
  padding-block: clamp(46px, 4.3vw, 60px);
  border-block: 1px solid var(--fx-line);
  background: linear-gradient(180deg, #f6f8fb, #fff);
}

.program-controls__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
}

.program-controls__heading h2 {
  margin-bottom: 0;
}

.program-controls__heading > p {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid rgba(243, 107, 19, 0.18);
  border-radius: 999px;
  color: var(--fx-navy-800);
  background: var(--fx-orange-100);
  font-size: 0.82rem;
  font-weight: 900;
}

.program-controls__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--program-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 26px rgba(7, 20, 47, 0.06);
}

.program-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.program-filter button {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--fx-line);
  border-radius: 999px;
  color: var(--fx-navy-800);
  background: #fff;
  font-weight: 800;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.program-filter button.is-active {
  border-color: var(--fx-navy-950);
  color: #fff;
  background: var(--fx-navy-950);
  box-shadow: inset 0 -3px 0 var(--fx-orange-500);
}

.program-sort {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  color: var(--fx-muted);
  font-weight: 800;
}

.program-sort select {
  min-width: 188px;
  color: var(--fx-navy-900);
  font-weight: 700;
}

.program-catalogue-section {
  padding-block: clamp(62px, 5.4vw, 78px);
  background: linear-gradient(180deg, #f3f6fa 0%, #f8fafc 52%, #fff 100%);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 24px;
}

.course-card,
.course-status {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--program-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--program-shadow);
}

.course-card {
  display: flex;
  flex-direction: column;
  transition: transform var(--program-ease), border-color 280ms ease, box-shadow 280ms ease;
}

/* Desktop + tablet program image rules */
.course-card__media {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--fx-navy-950);
}

.course-card__media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.course-card__media::after {
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  background: linear-gradient(transparent, rgba(7, 20, 47, 0.34));
  content: "";
  pointer-events: none;
}

.course-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 360ms ease;
}

.course-card__number,
.course-card__tag {
  position: absolute;
  z-index: 1;
  top: 14px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #fff;
  background: rgba(7, 20, 47, 0.88);
  font-size: 0.7rem;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(3, 12, 30, 0.16);
}

.course-card__number {
  left: 14px;
}

.course-card__tag {
  right: 14px;
  border-color: rgba(243, 107, 19, 0.44);
  background: var(--fx-orange-500);
}

.course-card__body {
  display: grid;
  flex: 1;
  gap: 14px;
  padding: 22px;
}

.course-card__body > p {
  margin: 0;
  font-size: 0.9rem;
}

.course-card__heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.course-card__heading h3 {
  margin: 4px 0 0;
  font-size: 1.08rem;
  line-height: 1.3;
}

.course-card__fit {
  margin: 0;
  color: var(--fx-orange-600);
  font-size: 0.7rem !important;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.45;
  text-transform: uppercase;
}

.course-card__price {
  white-space: nowrap;
  color: var(--fx-navy-950);
  font-size: 1.08rem;
}

.course-card__outcomes {
  display: grid;
  gap: 7px;
}

.course-card__outcomes span {
  position: relative;
  padding-left: 20px;
  color: var(--fx-navy-800);
  font-size: 0.8rem;
  font-weight: 700;
}

.course-card__outcomes span::before {
  position: absolute;
  left: 0;
  color: var(--fx-orange-600);
  content: "✓";
  font-weight: 900;
}

.course-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.course-card__meta span {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(7, 20, 47, 0.055);
  border-radius: 10px;
  color: var(--fx-muted);
  background: var(--fx-soft);
  font-size: 0.7rem;
}

.course-card__meta strong {
  display: block;
  margin-top: 3px;
  color: var(--fx-navy-950);
  font-size: 0.82rem;
  line-height: 1.35;
}

.course-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: auto;
  padding-top: 2px;
}

.course-card__actions .button {
  min-width: 0;
  padding-inline: 12px;
  text-align: center;
}

.course-status {
  grid-column: 1 / -1;
  padding: 32px;
  text-align: center;
}

.program-comparison-section {
  padding-block: clamp(62px, 5.4vw, 78px);
  background: #fff;
}

.program-comparison-section .section-heading {
  max-width: 980px;
  margin-bottom: clamp(26px, 3vw, 38px);
}

.course-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--program-border-strong);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(7, 20, 47, 0.1);
  scrollbar-color: rgba(7, 20, 47, 0.35) transparent;
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
}

.course-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  background: #fff;
}

.course-table th,
.course-table td {
  padding: 16px;
  border-bottom: 1px solid var(--fx-line);
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
}

.course-table thead {
  color: #fff;
  background: linear-gradient(90deg, var(--fx-navy-950), var(--fx-navy-900));
}

.course-table thead th {
  border-bottom-color: rgba(255, 255, 255, 0.14);
  color: #fff;
  background: transparent;
  font-size: 0.78rem;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.course-table tbody th {
  min-width: 225px;
  color: var(--fx-navy-950);
}

.course-table tbody td {
  color: var(--fx-navy-800);
  font-size: 0.87rem;
}

.course-table tbody tr:nth-child(even) {
  background: #f7f9fc;
}

.course-table tbody tr {
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.course-table tbody tr:last-child > * {
  border-bottom: 0;
}

.course-table tbody th a:hover,
.course-table tbody th a:focus-visible {
  color: var(--fx-orange-600);
}

.course-table__plan-row th {
  position: relative;
  padding-left: 30px;
}

.course-table__plan-row th::before {
  position: absolute;
  top: 23px;
  left: 15px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fx-orange-500);
  content: "";
}

.course-table__plan-row--first > * {
  border-top: 2px solid rgba(243, 107, 19, 0.22);
}

.table-action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--fx-orange-500);
  border-radius: 8px;
  color: #fff;
  background: var(--fx-orange-500);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.section--cream {
  padding-block: clamp(56px, 4.8vw, 68px);
  background: linear-gradient(135deg, #f3f6fa 0%, #fff8f3 100%);
}

.programs-flexible {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  align-items: center;
  gap: clamp(34px, 5vw, 72px);
}

.programs-flexible > div {
  max-width: 610px;
}

.programs-flexible ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.programs-flexible li {
  display: flex;
  position: relative;
  min-height: 64px;
  align-items: center;
  padding: 13px 16px 13px 44px;
  border: 1px solid var(--program-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 9px 22px rgba(7, 20, 47, 0.055);
  font-weight: 800;
  transition: transform var(--program-ease), border-color 280ms ease, box-shadow 280ms ease;
}

.programs-flexible li::before {
  position: absolute;
  left: 17px;
  color: var(--fx-orange-600);
  content: "✓";
  font-weight: 900;
}

.programs-cta {
  padding-block: clamp(46px, 4.8vw, 68px);
}

.programs-cta .cta-band {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  box-shadow: 0 24px 56px rgba(7, 20, 47, 0.2);
}

/* Shared Programs interaction language */
.program-choice article[data-reveal],
.course-card[data-reveal],
.course-table-wrap[data-reveal],
.programs-flexible [data-reveal],
.programs-cta [data-reveal],
.program-controls__toolbar[data-reveal] {
  transition-duration: 520ms;
  transition-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (hover: hover) and (pointer: fine) {
  .program-choice article:hover,
  .has-js .program-choice article[data-reveal]:hover,
  .course-card:hover,
  .has-js .course-card[data-reveal]:hover,
  .programs-flexible li:hover {
    border-color: rgba(243, 107, 19, 0.4);
    box-shadow: var(--program-shadow-hover);
    transform: translateY(-5px);
  }

  .course-card:hover .course-card__media img,
  .course-card:focus-within .course-card__media img {
    transform: scale(1.018);
  }

  .program-filter button:hover {
    border-color: rgba(7, 20, 47, 0.34);
    background: var(--fx-soft);
  }

  .program-filter button.is-active:hover {
    border-color: var(--fx-navy-950);
    color: #fff;
    background: var(--fx-navy-950);
  }

  .course-table tbody tr:hover {
    background: var(--fx-cream);
    box-shadow: inset 3px 0 0 var(--fx-orange-500);
  }

  .table-action:hover,
  .table-action:focus-visible {
    background: var(--fx-orange-600);
    box-shadow: 0 8px 18px rgba(243, 107, 19, 0.22);
    transform: translateY(-1px);
  }
}

.course-card__actions a:active,
.table-action:active {
  transform: scale(0.99);
}

/* Tablet adjustments remain with desktop */
@media (max-width: 1080px) {
  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .program-controls__toolbar {
    display: block;
  }

  .program-sort {
    margin-top: 18px;
  }

  .course-card__heading {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .programs-hero {
    padding-block: 64px;
  }

  .programs-hero__grid,
  .programs-flexible {
    grid-template-columns: 1fr;
  }

  .program-finder {
    width: 100%;
    max-width: 720px;
  }

  .program-snapshot__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .program-snapshot__grid div:nth-child(2) {
    border-right: 0;
  }

  .program-snapshot__grid div:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .programs-flexible > div {
    max-width: 760px;
  }
}

@media (max-width: 860px) {
  .program-choice__grid {
    grid-template-columns: 1fr;
  }

  .program-choice article {
    min-height: 0;
  }
}

/* ==================================================
   MOBILE
   ================================================== */

@media (max-width: 650px) {
  .programs-hero {
    padding-block: 50px;
  }

  .programs-hero__grid {
    gap: 34px;
  }

  .programs-hero h1 {
    margin-bottom: 16px;
  }

  .programs-hero__actions {
    display: grid;
  }

  .program-finder {
    gap: 13px;
    padding: 22px;
    border-radius: 18px;
    backdrop-filter: none;
  }

  .program-snapshot__grid {
    grid-template-columns: 1fr 1fr;
  }

  .program-snapshot__grid div {
    padding: 17px 12px;
  }

  .program-snapshot strong {
    font-size: 1rem;
  }

  .program-choice,
  .program-controls,
  .program-catalogue-section,
  .program-comparison-section {
    padding-block: 48px;
  }

  .section--cream {
    padding-block: 48px 42px;
  }

  .program-choice article {
    padding: 22px;
  }

  .program-controls__heading {
    display: block;
  }

  .program-controls__heading > p {
    display: inline-flex;
    margin-top: 14px;
  }

  .program-controls__toolbar {
    margin-top: 20px;
    padding: 14px;
    border-radius: 16px;
  }

  .program-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 9px;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    overscroll-behavior-inline: contain;
  }

  .program-filter button {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .program-sort {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    width: 100%;
  }

  .program-sort select {
    min-width: 0;
    width: 100%;
  }

  .course-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .course-card {
    border-radius: 16px;
  }

  /* Mobile program image rules: the approved portrait artwork is preserved in full. */
  .course-card__media {
    aspect-ratio: 4 / 5;
  }

  .course-card__media img {
    object-fit: cover;
    object-position: center;
  }

  .course-card__body {
    padding: 20px;
  }

  .course-card__heading {
    grid-template-columns: 1fr;
  }

  .course-card__meta {
    grid-template-columns: 1fr 1fr;
  }

  .course-card__actions {
    grid-template-columns: 1fr;
  }

  .course-table-wrap {
    border-radius: 14px;
  }

  .course-table {
    min-width: 940px;
  }

  .course-table th,
  .course-table td {
    padding: 14px;
  }

  .course-table__plan-row th {
    padding-left: 28px;
  }

  .programs-flexible {
    gap: 28px;
  }

  .programs-flexible ul {
    grid-template-columns: 1fr;
  }

  .programs-flexible li {
    min-height: 58px;
  }

  .programs-cta {
    padding-block: 42px 56px;
  }

  .programs-cta .cta-band {
    border-radius: 18px;
  }
}

@media (max-width: 390px) {
  .program-finder {
    padding: 20px;
  }

  .program-snapshot__grid {
    grid-template-columns: 1fr;
  }

  .program-snapshot__grid div {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .program-snapshot__grid div:last-child {
    border-bottom: 0;
  }

  .course-card__meta {
    grid-template-columns: 1fr;
  }
}

/* Motion preference applies to both responsive parts. */
@media (prefers-reduced-motion: reduce) {
  .program-choice article,
  .course-card,
  .course-card__media img,
  .programs-flexible li,
  .course-table tbody tr,
  .table-action {
    transition: none;
    transform: none !important;
  }

  .program-choice article[data-reveal],
  .course-card[data-reveal],
  .course-table-wrap[data-reveal],
  .programs-flexible [data-reveal],
  .programs-cta [data-reveal],
  .program-controls__toolbar[data-reveal] {
    opacity: 1;
    transform: none;
  }
}
