/* ==========================================================================
   Academics page (app/views/pages/academics.php)
   Stages of schooling and the board, how we teach, a school day,
   activities, assessment. Everything is scoped with an .acad- prefix;
   shared classes come from site.css.
   ========================================================================== */

/* Sections the Academics menu links to (#stages, #approach, …). html already
   has scroll-padding-top for the sticky header; this adds a little air above. */
.acad-anchor {
  scroll-margin-top: 1rem;
}

/* The last section before the closing band: its own bottom padding plus the
   band's would leave too wide a gap. */
.acad-before-cta {
  padding-bottom: clamp(1.5rem, 1rem + 2vw, 3rem);
}

.acad-nowrap {
  white-space: nowrap;
}

/* The hero photo is a collage: zoomed in a little (and clipped) so its white
   outer border doesn't show along the edge of the page. */
.acad-hero .page-hero__photo {
  overflow: hidden;
}
.acad-hero .page-hero__photo img {
  transform: scale(1.04);
}

/* Stages of schooling ------------------------------------------------------ */
.acad-stages__body {
  margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
}
.acad-stages__grid {
  display: grid;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.acad-stage {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  border: 1px solid rgb(232 224 207 / 0.9);
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.5s var(--ease-out),
    box-shadow 0.5s var(--ease-out);
}
.acad-stage:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

/* Coloured top: tone gradient, turning rays and the compass star; the
   panel's course photo covers them when there is one. */
.acad-stage__media {
  --stage-bg: linear-gradient(150deg, var(--gold-200), var(--gold-400));
  --stage-ink: var(--navy-900);
  --stage-rays: var(--white);
  --stage-star: var(--navy-800);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 5 / 3;
  background: var(--stage-bg);
}
.acad-stage--tone-2 .acad-stage__media {
  --stage-bg: linear-gradient(150deg, var(--navy-500), var(--navy-700));
  --stage-ink: var(--white);
  --stage-rays: var(--gold-400);
  --stage-star: var(--gold-300);
}
.acad-stage--tone-3 .acad-stage__media {
  --stage-bg: linear-gradient(150deg, var(--navy-700), var(--navy-900));
  --stage-ink: var(--white);
  --stage-rays: var(--gold-500);
  --stage-star: var(--gold-400);
}
.acad-stage--tone-4 .acad-stage__media {
  --stage-bg: linear-gradient(150deg, var(--navy-900), var(--navy-950));
  --stage-ink: var(--gold-300);
  --stage-rays: var(--gold-500);
  --stage-star: var(--gold-400);
}
.acad-stage__rays {
  position: absolute;
  top: 62%;
  left: 78%;
  width: 115%;
  max-width: none; /* site.css caps svg at 100% */
  height: auto;
  aspect-ratio: 1;
  color: var(--stage-rays);
  opacity: 0.3;
  transform: translate(-50%, -50%);
  -webkit-mask-image: radial-gradient(circle closest-side, black 10%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, black 10%, transparent 100%);
  animation: turn 140s linear infinite;
}
.acad-stage__star {
  position: absolute;
  top: 62%;
  left: 78%;
  width: 20%;
  height: auto;
  aspect-ratio: 1;
  color: var(--stage-star);
  opacity: 0.85;
  transform: translate(-50%, -50%);
}
/* If a course photo fails to load, nothing shows (no broken-image icon or
   alt text) and the card's own colours stay visible underneath. */
.acad-stage__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  color: transparent;
  font-size: 0;
}
/* Darkens the top of a course photo so the number stays readable. */
.acad-stage--photo .acad-stage__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(5 15 42 / 0.6) 0%, rgb(5 15 42 / 0) 55%);
}
.acad-stage--photo .acad-stage__num {
  color: var(--white);
  text-shadow: 0 2px 14px rgb(5 15 42 / 0.55);
}
.acad-stage__num {
  position: absolute;
  top: 0.9rem;
  left: 1.25rem;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 2.9rem;
  font-weight: 500;
  line-height: 1;
  color: var(--stage-ink);
}
.acad-stage__classes {
  position: absolute;
  bottom: 0.9rem;
  left: 1.1rem;
  z-index: 1;
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.94);
  box-shadow: 0 6px 16px -8px rgb(5 15 42 / 0.45);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--navy-800);
  white-space: nowrap;
}
.acad-stage__body {
  flex: 1;
  padding: 1.4rem 1.5rem 1.7rem;
}
.acad-stage__title {
  font-size: 1.45rem;
  font-weight: 540;
}
.acad-stage__text {
  margin-top: 0.65rem;
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.acad-stage__text + .acad-stage__text {
  margin-top: 0.5rem;
}

/* The board the school is affiliated to */
.acad-board {
  display: flex;
  align-items: center;
  gap: 1rem 1.25rem;
  max-width: 50rem;
  margin: 2.5rem auto 0;
  padding: 1.15rem 1.5rem 1.15rem 1.15rem;
  border: 1px solid rgb(232 224 207 / 0.95);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}
.acad-board__text {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}
.acad-board__name {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  font-weight: 560;
  line-height: 1.3;
  color: var(--ink);
}
.acad-board__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.75rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.acad-board__meta > span:not(:first-child)::before {
  content: "·";
  margin-right: 0.75rem;
  color: var(--gold-700);
}

@media (min-width: 30rem) {
  .acad-stages__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}
@media (min-width: 64rem) {
  /* One column per stage (up to four). Cards stay at most 24rem wide, so one
     or two panel courses don't stretch across the page. */
  .acad-stages__grid {
    grid-template-columns: repeat(var(--acad-cols, 4), minmax(0, 1fr));
    gap: 1.25rem;
    max-width: calc(var(--acad-cols, 4) * 24rem + (var(--acad-cols, 4) - 1) * 1.25rem);
    margin-inline: auto;
  }
}

/* How we teach ------------------------------------------------------------- */
.acad-approach__grid {
  display: grid;
  gap: 3rem;
}
.acad-approach__cards {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.acad-way {
  height: 100%;
}
.acad-way__title {
  margin-top: 1.2rem;
  font-size: 1.3rem;
  font-weight: 540;
}
.acad-way__body {
  margin-top: 0.5rem;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ink-soft);
  text-wrap: pretty;
}

@media (min-width: 48rem) {
  .acad-approach__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 64rem) {
  .acad-approach__grid {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: clamp(3.5rem, 6vw, 6rem);
    align-items: start;
  }
  .acad-approach__intro {
    position: sticky;
    top: 8rem;
  }
}

/* A school day (navy) --------------------------------------------------------- */
.acad-day {
  overflow: hidden;
  isolation: isolate;
}
.acad-day__rays {
  position: absolute;
  top: -30rem;
  left: 50%;
  z-index: -1;
  width: 58rem;
  max-width: none; /* site.css caps svg at 100% */
  height: 58rem;
  color: var(--gold-500);
  opacity: 0.12;
  transform: translateX(-50%);
  -webkit-mask-image: radial-gradient(circle closest-side, black 0%, rgb(0 0 0 / 0.5) 50%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, black 0%, rgb(0 0 0 / 0.5) 50%, transparent 100%);
  animation: turn 160s linear infinite;
}
.acad-day__steps {
  position: relative;
  display: grid;
  gap: 2rem;
  max-width: 34rem;
  margin: 3.5rem auto 0;
  padding: 0;
  list-style: none;
}
/* The line joining the numbers: down the side on phones, across on large screens. */
.acad-day__steps::before {
  content: "";
  position: absolute;
  top: 1.5rem;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 1px;
  background: linear-gradient(180deg, rgb(240 180 0 / 0), rgb(240 180 0 / 0.55) 10%, rgb(240 180 0 / 0.55) 90%, rgb(240 180 0 / 0));
}
.acad-day__step {
  position: relative;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 1.1rem;
  align-content: start;
  align-items: start;
}
.acad-day__num {
  position: relative;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy-950);
  box-shadow:
    0 0 0 6px var(--navy-950),
    0 10px 30px -8px rgb(240 180 0 / 0.7);
}
.acad-day__text {
  padding-top: 0.45rem;
}
.acad-day__title {
  font-size: 1.3rem;
  font-weight: 540;
  color: var(--white);
}
.acad-day__body {
  margin-top: 0.4rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgb(255 255 255 / 0.74);
  text-wrap: pretty;
}
.acad-day__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
  font-size: 0.9rem;
  color: rgb(255 255 255 / 0.72);
  text-align: center;
}
.acad-day__note .icon {
  color: var(--gold-400);
}

@media (min-width: 64rem) {
  .acad-day__steps {
    max-width: none;
    grid-template-columns: repeat(var(--acad-steps, 5), minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 4rem;
  }
  .acad-day__steps::before {
    top: 1.5rem;
    right: 10%;
    bottom: auto;
    left: 10%;
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, rgb(240 180 0 / 0), rgb(240 180 0 / 0.55) 10%, rgb(240 180 0 / 0.55) 90%, rgb(240 180 0 / 0));
  }
  .acad-day__step {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 1.35rem;
    text-align: center;
  }
  .acad-day__text {
    padding-top: 0;
  }
}

/* Activities --------------------------------------------------------------- */
.acad-activities__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}
.acad-activities__grid {
  display: grid;
  gap: 1.25rem;
  margin: clamp(2.5rem, 2rem + 2vw, 3.5rem) 0 0;
  padding: 0;
  list-style: none;
}
.acad-activity {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  border: 1px solid rgb(232 224 207 / 0.9);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.5s var(--ease-out),
    box-shadow 0.5s var(--ease-out);
}
.acad-activity:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}
.acad-activity__media {
  position: relative;
  isolation: isolate;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--paper-2);
}
/* Zoomed in a little, so a collage's white outer border never shows at the edges. */
.acad-activity__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 1s var(--ease-out);
}
.acad-activity__media:hover img,
.acad-activity__media:focus-visible img {
  transform: scale(1.09);
}
/* The card clips its corners, so the focus ring is drawn inside the photo,
   above it (an inset outline would be painted under the image): navy with a
   white edge, visible on any photo. */
.acad-activity__media:focus-visible {
  outline: none;
}
.acad-activity__media:focus-visible::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  box-shadow: inset 0 0 0 3px var(--focus-ring), inset 0 0 0 5px #fff;
  pointer-events: none;
}
.acad-activity__zoom {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.92);
  color: var(--navy-800);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: scale(0.85);
  transition:
    opacity 0.3s,
    transform 0.3s var(--ease-out);
}
.acad-activity__media:hover .acad-activity__zoom,
.acad-activity__media:focus-visible .acad-activity__zoom {
  opacity: 1;
  transform: none;
}
@media (hover: none) {
  .acad-activity__zoom {
    opacity: 1;
    transform: none;
  }
}
/* An activity without a photo yet */
.acad-activity__media--plain {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 120%, var(--navy-700), var(--navy-900) 60%, var(--navy-950));
}
.acad-activity__rays {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: 120%;
  max-width: none; /* site.css caps svg at 100% */
  height: auto;
  aspect-ratio: 1;
  color: var(--gold-500);
  opacity: 0.28;
  transform: translate(-50%, -50%);
  -webkit-mask-image: radial-gradient(circle closest-side, black 15%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, black 15%, transparent 100%);
  animation: turn 140s linear infinite;
}
.acad-activity__icon {
  width: 4rem;
  height: 4rem;
  border-radius: 1.25rem;
  box-shadow: 0 0 0 1px rgb(240 180 0 / 0.4), var(--shadow-gold);
}
.acad-activity__icon .icon {
  width: 1.75rem;
  height: 1.75rem;
}
.acad-activity__body {
  flex: 1;
  padding: 1.15rem 1.25rem 1.4rem;
}
.acad-activity__title {
  font-size: 1.18rem;
  font-weight: 560;
  line-height: 1.25;
}
.acad-activity__text {
  margin-top: 0.4rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: pretty;
}

@media (min-width: 30rem) {
  .acad-activities__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}
@media (min-width: 64rem) {
  .acad-activities__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

/* Assessment --------------------------------------------------------------- */
.acad-assess__grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
.acad-assess__links {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.acad-assess__link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.25rem 0.95rem 0.95rem;
  border: 1px solid rgb(232 224 207 / 0.95);
  border-radius: 1.25rem;
  background: var(--white);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  text-decoration: none;
  transition:
    transform 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out),
    border-color 0.35s;
}
.acad-assess__link:hover {
  transform: translateX(4px);
  border-color: rgb(240 180 0 / 0.55);
  box-shadow: var(--shadow-lift);
}
.acad-assess__label {
  display: grid;
  flex: 1;
  gap: 0.15rem;
  min-width: 0;
}
.acad-assess__title {
  font-weight: 750;
  line-height: 1.3;
}
.acad-assess__note {
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.acad-assess__arrow {
  color: var(--gold-700);
  transition: transform 0.3s var(--ease-out);
}
.acad-assess__link:hover .acad-assess__arrow {
  transform: translateX(3px);
}

@media (min-width: 64rem) {
  .acad-assess__grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 4rem;
  }
}

/* Reduced motion: no turning rays or hover movement. */
@media (prefers-reduced-motion: reduce) {
  .acad-stage__rays,
  .acad-day__rays,
  .acad-activity__rays {
    animation: none;
  }
  .acad-stage:hover,
  .acad-activity:hover,
  .acad-assess__link:hover,
  .acad-assess__link:hover .acad-assess__arrow {
    transform: none;
  }
  .acad-activity__media:hover img,
  .acad-activity__media:focus-visible img {
    transform: scale(1.04);
  }
}
