/* ==========================================================================
   Home "A program for every age" (home-programs), detail-first options.

   Every program shows age, what it is, where, when and the fee, with a solid
   "See program" button or a whole-row link. All age stages show at once.
     1  Detailed cards   photo cards per age stage
     2  Compare list     one row per program, facts in aligned columns
     3  Age columns      one column per stage, compact program rows
   Ground: pastel grey band (distinct from the cream sections around it).
   Stage colours: Early Years terracotta, Primary sage, Secondary amber.
   ========================================================================== */
.hpx { background: var(--sage-tint); }
.hpx .section-head { margin-bottom: clamp(18px, 2.2vw, 26px); }
.hpx .section-more { margin-top: clamp(20px, 2.4vw, 28px); text-align: center; }
.hpx a:focus-visible { outline: 2px solid var(--brand-dark); outline-offset: 2px; }
.hpx h3, .hpx h4 { margin: 0; }

.hpx-s--0 { --sc: var(--brand);      --sd: var(--brand-dark); }
.hpx-s--1 { --sc: var(--sage-deep);  --sd: var(--sage-deep); }
.hpx-s--2 { --sc: var(--accent-sun); --sd: var(--ink); }

/* Photos fill their frame (own class, so the site's card-photo rules stay out). */
.hpx-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.hpx-age { margin: 0; font: 800 .82rem/1.3 var(--font-head); color: var(--sd); letter-spacing: .01em; }

/* Schedule on one line, how you enrol on a quieter line below. */
.hpx-when, .hpx-term { display: block; }
.hpx-term { font-size: .92em; color: var(--muted); }

/* ---- 1 Detailed cards ---------------------------------------------------- */
.hpx-stage + .hpx-stage { margin-top: clamp(24px, 3vw, 36px); }
.hpx-stage__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 3px solid var(--sc); }
.hpx-stage__head h3 { font-size: clamp(1.15rem, 1.5vw, 1.3rem); color: var(--ink); }
.hpx-stage__head h3 span { margin-left: 6px; font: 700 .92rem var(--font-head); color: var(--sd); }
.hpx-stage__head a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font: 700 .9rem var(--font-head); color: var(--sd); text-decoration: none; }
.hpx-stage__head a:hover { text-decoration: underline; text-underline-offset: 3px; }
.hpx-stage__head svg { width: 16px; height: 16px; }

.hpx1__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 20px); }
.hpx1__card { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.hpx1__media { position: relative; display: block; aspect-ratio: 2 / 1; background: var(--canvas-2); }
.hpx1__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hpx1__body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.hpx1__t { margin-top: 3px !important; font-size: 1.08rem; line-height: 1.25; }
.hpx1__t a { color: var(--ink); text-decoration: none; }
.hpx1__t a:hover { text-decoration: underline; text-underline-offset: 3px; }
.hpx1__line { margin: 6px 0 0; font-size: .9rem; line-height: 1.5; color: var(--ink-soft); }
.hpx-facts { display: grid; gap: 5px; margin: 12px 0 14px; padding: 10px 0 0; border-top: 1px solid var(--line); }
.hpx-facts > div { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 8px; font-size: .85rem; line-height: 1.4; }
.hpx-facts dt { font: 700 .74rem/1.6 var(--font-head); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.hpx-facts dd { margin: 0; color: var(--ink); }
.hpx1__btn { margin-top: auto; width: 100%; }

/* ---- 2 Compare list ------------------------------------------------------ */
.hpx2 { --cols: 96px minmax(0, 2.2fr) 64px minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, .95fr) auto; padding: 6px clamp(14px, 1.8vw, 22px) 10px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.hpx2__cols, .hpx2__row { display: grid; grid-template-columns: var(--cols); column-gap: 16px; align-items: center; }
.hpx2__cols { padding: 10px 0 8px; font: 700 .74rem var(--font-head); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hpx2__cols span:first-child { grid-column: 1 / 3; }
.hpx2__group { padding-top: 8px; }
.hpx2__stage { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--sc); color: #fff; font-size: 1rem; }
.hpx-s--2 .hpx2__stage { color: var(--ink); }
.hpx2__stage span { font: 600 .86rem var(--font-head); opacity: .92; }
.hpx2__rows { list-style: none; margin: 0; padding: 0; }
.hpx2__row { padding: 12px 0; }
.hpx2__row + .hpx2__row { border-top: 1px solid var(--line); }
.hpx2__media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r-sm); background: var(--canvas-2); }
.hpx2__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hpx2__name h4 { font-size: 1rem; line-height: 1.25; }
.hpx2__name h4 a { color: var(--ink); text-decoration: none; }
.hpx2__name h4 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.hpx2__name p { margin: 3px 0 0; font-size: .86rem; line-height: 1.45; color: var(--ink-soft); }
.hpx2__f { margin: 0; font-size: .86rem; line-height: 1.4; color: var(--ink); }
.hpx2__f--age { font: 800 .95rem var(--font-head); color: var(--sd); }
.hpx2__f > span:first-child { display: none; }
.hpx2__btn { white-space: nowrap; }

@media (max-width: 1080px) {
  .hpx2 { --cols: 80px minmax(0, 2fr) 56px minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, .9fr) auto; }
  .hpx2__btn { padding-inline: 14px; }
}
@media (max-width: 899px) {
  .hpx2 { padding: 4px 14px 8px; }
  .hpx2__cols { display: none; }
  .hpx2__media { grid-area: m; align-self: start; }
  .hpx2__name { grid-area: n; }
  .hpx2__row { grid-template-columns: 88px minmax(0, 1fr); grid-template-areas: "m n" "a a" "w w" "t t" "p p" "b b"; row-gap: 4px; }
  .hpx2__f { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; }
  .hpx2__f > span:first-child { display: block; font: 700 .72rem/1.7 var(--font-head); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
  .hpx2__f--age { grid-area: a; margin-top: 8px; }
  .hpx2__f:nth-of-type(2) { grid-area: w; }
  .hpx2__f:nth-of-type(3) { grid-area: t; }
  .hpx2__f:nth-of-type(4) { grid-area: p; }
  .hpx2__btn { grid-area: b; margin-top: 8px; width: 100%; }
}

/* ---- 3 Age rows --------------------------------------------------------- */
.hpx3 { display: grid; gap: clamp(14px, 1.8vw, 20px); }
.hpx3__row { display: grid; grid-template-columns: 220px minmax(0, 1fr); overflow: hidden; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.hpx3__head { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 20px; background: var(--sc); color: #fff; }
.hpx-s--2 .hpx3__head { color: var(--ink); }
.hpx3__head h3 { font-size: 1.25rem; color: inherit; }
.hpx3__ages { margin: 0; font: 700 .95rem var(--font-head); }
.hpx3__all { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: auto; padding: 8px 16px; border-radius: var(--r-pill); background: var(--surface); color: var(--sd); font: 700 .88rem var(--font-head); text-decoration: none; }
.hpx3__all:hover { background: var(--canvas-2); }
.hpx3__all svg { width: 16px; height: 16px; }
.hpx3__list { list-style: none; margin: 0; padding: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 8px; align-content: start; }
.hpx3__item { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 14px; align-items: start; height: 100%; padding: 12px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; transition: background var(--fast) var(--ease); }
.hpx3__item:hover { background: var(--canvas-2); }
.hpx3__item:hover .hpx3__t { text-decoration: underline; text-underline-offset: 3px; }
.hpx3__media { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-sm); background: var(--canvas-2); }
.hpx3__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hpx3__copy { display: grid; gap: 3px; min-width: 0; }
.hpx3__t { font: 800 1rem/1.25 var(--font-head); }
.hpx3__line { font-size: .86rem; line-height: 1.45; color: var(--ink-soft); }
.hpx3__meta { display: grid; gap: 3px; margin-top: 4px; font-size: .8rem; line-height: 1.4; color: var(--ink-soft); }
.hpx3__when { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 6px; }
.hpx3__when .mm-ico { width: 14px; height: 14px; margin-top: 2px; color: var(--sd); }
.hpx3__when > span { display: grid; }
.hpx3__fee { padding-left: 20px; font-weight: 700; color: var(--ink); }

/* ---- Shared phone and tablet stacking ------------------------------------ */
@media (max-width: 1080px) {
  .hpx1__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .hpx3__row { grid-template-columns: 1fr; }
  .hpx3__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 12px; padding: 14px 16px; }
  .hpx3__ages { grid-row: 2; }
  .hpx3__all { grid-row: 1 / 3; grid-column: 2; margin: 0; }
  .hpx3__list { grid-template-columns: 1fr; }
}
@media (max-width: 599px) {
  .hpx1__grid { grid-template-columns: 1fr; }
  .hpx1__media { aspect-ratio: 5 / 2; }
  .hpx-stage__head { flex-wrap: wrap; row-gap: 0; }
  .hpx3__item { grid-template-columns: 72px minmax(0, 1fr); padding-inline: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .hpx3__item { transition: none; }
}
