/* AplusGen — Programs page sections */

/* ============================================================
   1. Hero — copy left, three angled photo panels right
   ============================================================ */
.phero { position: relative; overflow: hidden; padding-block: var(--sp-12) 0; }
.phero__grid {
  display: grid;
  /* Copy column is sized to its content, not to a fraction. A fr-based column
     handed the copy more width than it used, and the leftover pooled between
     the text and the photos — that was the gap, not the grid gap. Sizing to
     content also means the button pair can never wrap, whatever the viewport,
     because the column simply grows to fit it. */
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-4);
}
.phero__copy {
  padding-left: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
  padding-right: var(--sp-2);
}
.phero__title { font-size: var(--fs-hero); font-weight: 700; letter-spacing: -0.015em; }
.phero__sub { display: block; color: var(--navy); font-size: 0.62em; font-weight: 600; margin-top: 4px; }
.phero__lead { margin-top: var(--sp-4); max-width: 46ch; color: var(--muted); font-size: var(--fs-lead); }
.phero__actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-6); flex-wrap: wrap; }

.phero__media {
  display: grid;
  /* The group's right edge lines up with the container, so the third panel
     sits flush with 'Future Ready' in the path below. Doing it with the same
     padding expression the container uses makes the alignment structural — it
     holds at any width and does not depend on how wide the copy happens to
     render. Panels then take whatever is left, which works out to ~202px at
     1200 and stays there as the viewport grows. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-right: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
  gap: var(--sp-2);
  align-items: start;
}
/* The mock slants these panels; a shared skew keeps the angle consistent and
   the counter-skew keeps the photo itself upright. */
/* All three are the same height. They previously carried aspect-ratio plus a
   staggered margin-top, but grid stretch overrode the ratio and the margins
   then ate different amounts off each one — so they rendered at three
   different heights. Height is now explicit and the stagger is gone.
   Sized to sit alongside the copy block rather than tower over it. */
.phero__panel {
  position: relative;
  margin: 0;
  height: clamp(215px, 23vw, 280px);
  border-radius: var(--r-lg);
  overflow: hidden;
  transform: skewX(-5deg);
}
.phero__image {
  position: absolute;
  inset: -2% -7%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  transform: skewX(5deg);
}
.phero__image--learn { background-image: url("../../assets/img/Program/programs-hero-learn.webp"); }
.phero__image--think { background-image: url("../../assets/img/Program/programs-hero-think.webp"); }
.phero__image--create { background-image: url("../../assets/img/Program/programs-hero-create.webp"); }

.phero__tag {
  position: absolute;
  left: 8px; bottom: 10px;
  transform: skewX(5deg);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px 12px 6px 6px;
  background: #fff;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md);
  font-size: var(--fs-xs);
  line-height: 1.25;
  color: var(--navy);
}

/* ============================================================
   2. Learning path — accessible HTML over the supplied hill artwork
   ============================================================ */
.learning-path .section-head { position: relative; z-index: 2; margin-bottom: 0; }
.path-scene {
  min-height: 560px;
  margin-top: calc(var(--sp-8) * -1);
  padding: 245px var(--sp-4) var(--sp-6);
  background-image: url("../../assets/img/Program/programs-empty-hillclimbing.webp");
  background-repeat: no-repeat;
  /* Lift the hill artwork by roughly 1/4 of a path-card height. */
  background-position: center -48px;
  background-size: 100% auto;
}
.path {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: var(--sp-3);
}
.path__step {
  min-height: 242px;
  padding: var(--sp-4);
  border: 1px solid rgba(203, 215, 234, 0.85);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(3px);
}
.path__head { display: flex; align-items: flex-start; gap: var(--sp-3); }
.path__head .ibadge { flex: none; background: #fff; box-shadow: var(--shadow-sm); }

.path__title { font-size: var(--fs-h3); font-weight: 600; }
.path__step--green  .path__title { color: var(--green-ink); }
.path__step--blue   .path__title { color: var(--blue-ink); }
.path__step--purple .path__title { color: var(--purple-ink); }

.path__lead {
  margin-top: 2px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.35;
}
.path__list { display: grid; gap: var(--sp-2); margin-top: var(--sp-6); }
.path__list li {
  display: flex;
  gap: var(--sp-2);
  color: var(--ink);
  font-size: var(--fs-xs);
  line-height: 1.4;
}
.path__list li::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  margin-top: 5px;
  border-radius: 50%;
  background: currentColor;
}
.path__step--green .path__list li::before { background: var(--green-ink); }
.path__step--blue .path__list li::before { background: var(--blue-ink); }
.path__step--purple .path__list li::before { background: var(--purple-ink); }

/* ============================================================
   3. Core program cards
   ============================================================ */
.progs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }

.prog {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.prog:hover, .prog:focus-within { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.prog__media {
  position: relative;
  aspect-ratio: 16 / 10;
  /* The image itself is bounded by its absolute inset; allow the circular
     program badge to cross the lower edge without losing its bottom half. */
  overflow: visible;
  background: var(--bg-tint);
}
.prog__image {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
.prog__image--singapore {
  background-image: url("../../assets/img/Program/programs-card-singapore-math.webp");
  background-size: 130% auto;
}
.prog__image--ap {
  background-image: url("../../assets/img/Program/programs-card-ap.webp");
  background-size: 130% auto;
}
.prog__image--sat {
  background-image: url("../../assets/img/Program/programs-card-sat.webp");
  background-size: 130% auto;
}
.prog__image--competition {
  background-image: url("../../assets/img/Program/programs-card-competition.webp");
}
.prog__badge {
  position: absolute;
  left: var(--sp-4); bottom: calc(var(--sp-6) * -1);
  z-index: 2;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.prog__body { display: flex; flex-direction: column; flex: 1; padding: var(--sp-8) var(--sp-4) var(--sp-4); }
.prog__head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.prog__title { font-size: var(--fs-h3); font-weight: 600; }
.prog__title--green  { color: var(--green-ink); }
.prog__title--blue   { color: var(--blue-ink); }
.prog__title--purple { color: var(--purple-ink); }
.prog__title--orange { color: var(--orange-ink); }
.prog__text { font-size: var(--fs-sm); color: var(--muted); }

.prog__list { margin-top: var(--sp-4); display: grid; gap: 7px; }
.prog__list li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--ink);
}
.prog__list svg { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.prog__list--green  svg { color: var(--green-ink); }
.prog__list--blue   svg { color: var(--blue-ink); }
.prog__list--purple svg { color: var(--purple-ink); }
.prog__list--orange svg { color: var(--orange-ink); }

.prog .arrow-link { margin-top: auto; padding-top: var(--sp-3); }

/* ============================================================
   4. Curriculum entry and readable course tables
   ============================================================ */
.curriculum {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.curriculum-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-4);
  min-height: 100px;
  padding: var(--sp-5) var(--sp-6);
  border-left: 4px solid var(--green-ink);
  color: var(--navy);
  cursor: pointer;
  list-style: none;
  scroll-margin-top: var(--sp-4);
}
.curriculum-card::-webkit-details-marker { display: none; }
.curriculum-card::marker { content: ""; }
.curriculum-card:hover,
.curriculum[open] > .curriculum-card { background: var(--tint-green); }
.curriculum[open] > .curriculum-card { border-bottom: 1px solid var(--line); }
.curriculum-card:focus-visible { outline-offset: -4px; }
.curriculum-card__copy { display: grid; gap: var(--sp-1); }
.curriculum-card__title { font-size: var(--fs-h3); font-weight: 600; line-height: 1.35; }
.curriculum-card__meta { color: var(--muted); font-size: var(--fs-sm); }
.curriculum-card__action {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--green-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.curriculum-card__action svg { width: 16px; height: 16px; flex: none; }
.curriculum-card__when-open { display: none; }
.curriculum[open] .curriculum-card__when-closed { display: none; }
.curriculum[open] .curriculum-card__when-open { display: inline; }
.curriculum[open] .curriculum-card__action svg { transform: rotate(180deg); }
.curriculum-panel { padding: var(--sp-6); }
.curriculum-panel__head,
.curriculum-panel__foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-4);
}
.curriculum-panel__head { margin-bottom: var(--sp-4); }
.curriculum-panel__foot { margin-top: var(--sp-6); align-items: center; }
.curriculum-panel__title { color: var(--navy); font-size: var(--fs-h3); font-weight: 600; }
.curriculum-close {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--navy);
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
}
.curriculum-close:hover { border-color: var(--green-ink); }
.curriculum-close svg { width: 14px; height: 14px; transform: rotate(180deg); }
.curriculum-close[hidden] { display: none; }
.curriculum-jumps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-4);
  font-size: var(--fs-sm);
}
.curriculum-jumps a { font-weight: 600; }
.curriculum-jumps > span { color: var(--muted); }
.curriculum-intro { max-width: 900px; color: var(--muted); line-height: 1.65; }
.curriculum-stage { margin-top: var(--sp-8); scroll-margin-top: var(--sp-4); }
.curriculum-stage__title { color: var(--navy); font-size: var(--fs-h3); font-weight: 600; }
.curriculum-stage__tagline { margin-top: var(--sp-2); color: var(--muted); font-size: var(--fs-sm); line-height: 1.55; }
.curriculum-table {
  width: 100%;
  margin-top: var(--sp-4);
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--ink);
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.curriculum-table th,
.curriculum-table td {
  padding: var(--sp-3);
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.curriculum-table thead th { background: var(--tint-blue); color: var(--navy); font-weight: 600; }
.curriculum-table tbody th { color: var(--navy); font-weight: 600; }
.curriculum-table tbody tr:nth-child(even) { background: var(--bg-tint); }

@media (max-width: 900px) {
  .curriculum-table,
  .curriculum-table tbody { display: block; }
  .curriculum-table colgroup { display: none; }
  .curriculum-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .curriculum-table tbody { display: grid; gap: var(--sp-4); }
  .curriculum-table tbody tr {
    display: block;
    padding: var(--sp-4);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: #fff;
  }
  .curriculum-table tbody th {
    display: block;
    padding: 0 0 var(--sp-3);
    border: 0;
    border-bottom: 1px solid var(--line);
    font-size: var(--fs-body);
  }
  .curriculum-table tbody th::before { content: attr(data-label) " "; }
  .curriculum-table tbody td {
    display: grid;
    grid-template-columns: minmax(110px, 0.35fr) minmax(0, 0.65fr);
    gap: var(--sp-3);
    padding: var(--sp-3) 0 0;
    border: 0;
    font-size: var(--fs-body);
  }
  .curriculum-table tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: var(--fs-sm);
    font-weight: 600;
  }
}

@media (max-width: 640px) {
  .curriculum-card { padding: var(--sp-4); gap: var(--sp-3); }
  .curriculum-card__action { grid-column: 2 / -1; }
  .curriculum-panel { padding: var(--sp-4); }
  .curriculum-panel__head,
  .curriculum-panel__foot { flex-direction: column; }
  .curriculum-table tbody td { grid-template-columns: 1fr; gap: var(--sp-1); }
}

/* ============================================================
   5. Why students thrive
   ============================================================ */
.thrive { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-4); }
.thrive__item { text-align: center; padding-inline: var(--sp-2); position: relative; }
.thrive__item + .thrive__item::before {
  content: "";
  position: absolute;
  left: calc(var(--sp-4) * -0.5);
  top: 12%; bottom: 12%;
  border-left: 1px solid var(--line);
}
.thrive .ibadge { margin: 0 auto var(--sp-3); }
.thrive__title { font-size: var(--fs-body); font-weight: 600; margin-bottom: var(--sp-2); }
.thrive__title--green  { color: var(--green-ink); }
.thrive__title--blue   { color: var(--blue-ink); }
.thrive__title--purple { color: var(--purple-ink); }
.thrive__title--orange { color: var(--orange-ink); }
.thrive__title--teal   { color: var(--teal-ink); }
.thrive__text { font-size: var(--fs-xs); color: var(--muted); line-height: 1.55; }

/* ============================================================
   6. Advisor CTA
   ============================================================ */
.advisor {
  display: grid;
  grid-template-columns: 1.1fr 0.95fr 0.9fr;
  align-items: center;
  gap: var(--sp-8);
  padding: var(--sp-6) 0 var(--sp-6) var(--sp-8);
  background: var(--tint-blue);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.advisor__title { font-size: var(--fs-h2-sm); font-weight: 600; }
.advisor__text { margin-top: var(--sp-3); color: var(--muted); font-size: var(--fs-sm); max-width: 42ch; }
.advisor__copy .btn { margin-top: var(--sp-6); }

.advisor__points { display: grid; gap: var(--sp-4); }
.advisor__points li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.35;
}
.advisor__points .ibadge { background: #fff; }

.advisor__media {
  align-self: stretch;
  position: relative;
  min-height: 200px;
  overflow: hidden;
}
.advisor__image {
  position: absolute;
  inset: 0;
  background-image: url("../../assets/img/Program/programs-advisor.webp");
  background-repeat: no-repeat;
  background-position: 82% center;
  background-size: cover;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .progs { grid-template-columns: repeat(2, 1fr); }
  .thrive { grid-template-columns: repeat(3, 1fr); row-gap: var(--sp-6); }
  .thrive__item:nth-child(3n + 1)::before { display: none; }
  .advisor { grid-template-columns: 1fr 1fr; padding: var(--sp-6); }
  .advisor__media { display: none; }
}

@media (max-width: 900px) {
  .phero { padding-block: var(--sp-8) 0; }
  .phero__grid { grid-template-columns: 1fr; }
  .phero__copy { padding: 0 var(--gutter); }
  .phero__lead { max-width: none; }
  .phero__panel:nth-child(2),
  .phero__panel:nth-child(3) { margin-top: 0; }
  .phero__media { padding: 0 var(--gutter); }
  .path-scene {
    min-height: 0;
    margin-top: 0;
    padding: 190px 0 0;
    background-size: auto 230px;
    background-position: center -36px;
  }
  .path { grid-template-columns: repeat(2, 1fr); align-items: stretch; gap: var(--sp-4); }
  .path__step { min-height: 0; }
}

@media (max-width: 640px) {
  .progs { grid-template-columns: 1fr; }
  .thrive { grid-template-columns: 1fr; }
  .thrive__item::before { display: none !important; }
  .path { grid-template-columns: 1fr; }
  .advisor { grid-template-columns: 1fr; padding: var(--sp-6); }
  .phero__actions .btn { width: 100%; }
  .phero__media {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: var(--sp-3);
    padding-bottom: var(--sp-2);
    scrollbar-width: none;
  }
  .phero__media::-webkit-scrollbar { display: none; }
  .phero__panel { flex: 0 0 72%; height: 300px; scroll-snap-align: center; }
}

/* New core programs */
.prog__title--teal, .prog__list--teal svg, .prog .arrow-link--teal, .prog__badge.ibadge--teal { color: #087eaa; }
.prog__title--rose, .prog__list--rose svg, .prog .arrow-link--rose, .prog__badge.ibadge--rose { color: #be3455; }
.prog__title--amber, .prog__list--amber svg, .prog .arrow-link--amber, .prog__badge.ibadge--amber { color: #087d66; }
.prog__image--python { background-image: url("../../assets/img/Program/programs-card-python-v10.webp"); }
.prog__image--chinese { background-image: url("../../assets/img/Program/programs-card-chinese-v10.webp"); }
.prog__image--innovation { background-image: url("../../assets/img/Program/programs-card-innovation-v10.webp"); }

.prog__image--future { background-image: url("../../assets/img/Program/programs-card-future-v10.webp"); }
.prog__title--future, .prog__list--future svg, .prog .arrow-link--future, .prog__badge.ibadge--future { color: #7044ba; }
.prog__examples { display:grid; gap: 8px; margin: 0 0 16px; padding:0; list-style:none; }
.prog__examples li { display:flex; align-items:center; gap:8px; font-size: 0.875rem; line-height:1.35; }
.prog__examples img { width:56px; height:42px; object-fit:cover; border-radius:5px; flex:none; }
