/* ============================================================
   SDM School — Academics
   Figma: SDM School Website Final / ACADEMICS DESIGN (1441 × 8486)
   Shared tokens, header, pills, CTA and footer live in styles.css.

   --u is one design pixel: 1px on the 1440 frame, scaling down with the
   screen. Positions and the big vertical gaps use it so the layout keeps
   the frame's proportions; text sizes use clamp() so copy stays legible.
   ============================================================ */

.page-academics {
  --nav-ink: #3934c9;                       /* the Academics frame sets its menu in blue */
  --u: calc(min(100vw, 1440px) / 1440);
  --a-grey: #606060;
}

/* Line art and the hero photo run past the frame on purpose. */
.page-academics main { overflow-x: clip; }

.t-blue   { color: var(--blue); }
.t-pink   { color: var(--pink); }
.t-red    { color: var(--orange); }
.t-orange { color: var(--tangerine); }
.a-title-navy { color: var(--navy); }

/* Faint line art that sweeps behind a section. Each line is placed by
   its centre on the 1440 frame and rotated, as in Figma. */
.a-lines {
  position: absolute;
  inset: var(--lines-top, 0) 0 auto 0;
  z-index: -1;
  pointer-events: none;
}
.a-line {
  position: absolute;
  left: calc(50% + (var(--x) - 720) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  max-width: none;
  height: auto;
  rotate: var(--r, 0deg);
}
.a-line--flip { scale: 1 -1; }

/* ============================================================
   Hero — the corridor photo, headline in its bright top-left
   ============================================================ */
.a-hero { padding-top: var(--hero-gap); }   /* clears the header bar */

/* The banner art is 2009 wide, starting 319px left of the frame. */
.a-hero-stage {
  position: relative;
  aspect-ratio: 1440 / 1214;
  overflow: hidden;
}
.a-hero-img,
.a-hero-stage::after {
  position: absolute;
  top: 0;
  left: -22.15%;
  width: 139.51%;
  max-width: none;
  height: 100%;
}
.a-hero-img { object-fit: cover; }
/* Figma's white wash over the top-left corner, beneath the copy. */
.a-hero-stage::after {
  content: '';
  background: linear-gradient(164.35deg, rgba(255, 255, 255, 0.7) 17.79%, rgba(255, 255, 255, 0) 37.18%);
  pointer-events: none;
}

.a-hero-copy {
  position: absolute;
  z-index: 1;
  left: calc(55 * var(--u));
  top: calc(135 * var(--u));
  right: 20px;
}
.a-hero-title {
  max-width: calc(824 * var(--u));
  font-size: var(--fs-title);
  line-height: 1.073;
  color: var(--orange);
}
.a-hero-sub {
  max-width: max(320px, calc(791 * var(--u)));
  margin-top: calc(21 * var(--u));
  font-size: var(--fs-lede);
  font-weight: 600;
  line-height: 1.22;
  color: var(--orange);
}

/* ============================================================
   Three stages, every step matters
   ============================================================ */
.a-stages { padding-top: calc(40 * var(--u)); }

.a-stages-character {
  width: max(130px, calc(252 * var(--u)));
  height: auto;
  margin-left: calc(344 * var(--u));
}

.a-stages-title {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  column-gap: max(10px, calc(76 * var(--u)));
  margin-top: calc(-38 * var(--u));
  padding: 0 20px 0 calc(86 * var(--u));
  font-size: var(--fs-title);
  line-height: 1.15;
}

.a-stage-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, calc(384 * var(--u))));
  justify-content: center;
  column-gap: calc(59 * var(--u));
  margin-top: max(16px, calc(22 * var(--u)));
  text-align: center;
}
.a-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Each photo is cropped exactly as its Figma mask crops it: --w is the
   image's width and --x/--y its offset, as a share of the 384 × 264 box. */
.a-stage-media {
  position: relative;
  width: 100%;
  aspect-ratio: 384 / 264;
  overflow: hidden;
  border-radius: max(18px, calc(30 * var(--u))) 0;
}
.a-stage-media img {
  position: absolute;
  left: var(--x, 0%);
  top: var(--y, 0%);
  width: var(--w, 100%);
  max-width: none;
  height: auto;
  transition: transform 0.6s var(--ease-out);
}
.a-stage:hover .a-stage-media img { transform: scale(1.04); }
.a-stage--prek   { --w: 108.4%; --x: -3.4%;  --y: -11.4%; }
.a-stage--middle { --w: 105.5%; }
.a-stage--senior { --w: 136.2%; --x: -16.2%; }

.a-stage-name {
  margin-top: max(14px, calc(24 * var(--u)));
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
}
.a-stage-grade {
  margin-top: 4px;
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--a-grey);
}
.a-stage-text {
  max-width: 330px;
  margin-top: max(8px, calc(14 * var(--u)));
  font-size: var(--fs-lede);
  line-height: 1.22;
  color: var(--a-grey);
}

/* Explore — the design's 130 × 30 pale-blue pill */
.a-explore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 130px;
  min-height: 30px;
  margin-top: auto;            /* lines the three pills up across the row */
  padding: 4px 20px;
  border-radius: 15px;
  background: var(--mist-line);
  font-size: var(--fs-body-sm);
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.a-stage-text { margin-bottom: max(16px, calc(30 * var(--u))); }
.a-explore:hover {
  background: var(--navy);
  color: #fff;
  transform: translateY(-2px);
}

/* ============================================================
   Why SDM — a collage of four photos, laid out on the frame
   ============================================================ */
.a-why {
  position: relative;
  isolation: isolate;
  padding-top: max(56px, calc(177 * var(--u)));
  --lines-top: max(56px, calc(177 * var(--u)));
}

/* A 1440 × 1165 slice of the frame; children are placed in --u. */
.a-why-stage { height: calc(1165 * var(--u)); }
.a-why-stage > * { position: absolute; }

.a-why-title {
  left: calc(993 * var(--u));
  top: calc(368 * var(--u));
  font-size: var(--fs-title-xl);
  line-height: 0.975;
  color: var(--navy);
}
.a-why-title span {
  display: block;
  font-size: 0.6em;            /* "Why" is 48 against "SDM." at 80 */
  line-height: 1.15;
}

.a-why-item { width: calc(var(--w) * var(--u)); left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u)); }
.a-why-item img {
  width: 100%;
  height: calc(var(--h) * var(--u));
  object-fit: cover;
  border-radius: calc(60 * var(--u));
  transition: transform 0.6s var(--ease-out);
}
.a-why-item:hover img { transform: translateY(-6px); }
.a-why-item figcaption {
  margin-top: calc(12 * var(--u));
  font-size: var(--fs-h5);
  font-style: italic;
  font-weight: 500;
  line-height: 1.24;
  color: var(--a-grey);
  text-align: center;
}
.a-why--learning { --x: 473.6; --y: 0;   --w: 470; --h: 462; }
.a-why--learning img { object-position: 75% 50%; }
.a-why--clubs    { --x: 63.6;  --y: 212; --w: 374; --h: 540; }
.a-why--support  { --x: 487.6; --y: 580; --w: 341; --h: 511; }
.a-why--sports   { --x: 879.6; --y: 538; --w: 478; --h: 319; }

/* ============================================================
   The SDM Pedagogy — five ideas, three then two
   ============================================================ */
.a-ped {
  padding-top: max(64px, calc(202 * var(--u)));
  text-align: center;
}

.a-ped-tag {
  margin-top: -4px;
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--a-grey);
}
.a-ped-lede {
  max-width: 540px;
  margin: max(16px, calc(37 * var(--u))) auto 0;
  padding-inline: 20px;
  font-size: var(--fs-lede);
  line-height: 1.22;
  color: var(--grey);
  box-sizing: content-box;
}

.a-ped-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  row-gap: max(32px, calc(56 * var(--u)));
  max-width: calc(1239 * var(--u) + 40px);
  margin: max(32px, calc(71 * var(--u))) auto 0;
  padding-inline: 20px;
}
.a-ped-list li {
  flex: 0 0 calc(413 * var(--u));
  display: flex;
  flex-direction: column;
  align-items: center;
}
.a-ped-list img {
  width: max(150px, calc(227 * var(--u)));
  height: auto;
  transition: transform 0.6s var(--ease-out);
}
.a-ped-list li:hover img { transform: translateY(-6px) scale(1.03); }
.a-ped-list h3 {
  font-size: var(--fs-h4);
  font-weight: 700;
  line-height: 1.22;
  color: var(--navy);
}
.a-ped-list p {
  margin-top: 10px;
  font-size: var(--fs-small);
  line-height: 1.22;
  color: var(--a-grey);
}

/* ============================================================
   SDM Achievers — six winners on a pair of line sweeps
   ============================================================ */
.a-ach {
  position: relative;
  isolation: isolate;
  padding-top: max(72px, calc(193 * var(--u)));
  text-align: center;
}

.a-ach-title {
  font-size: var(--fs-title);
  line-height: 1.15;
  color: var(--orange);
}
.a-ach-title span {
  display: block;
  font-size: 2em;              /* "SDM" is 96 against "Achievers." at 48 */
  line-height: 0.75;
}

.a-ach-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, calc(250 * var(--u))));
  justify-content: center;
  column-gap: calc(110 * var(--u));
  row-gap: max(32px, calc(58 * var(--u)));
  margin-top: max(24px, calc(58 * var(--u)));
  padding-inline: 20px;
}
.a-ach-list img {
  width: 100%;
  aspect-ratio: 250 / 375;
  object-fit: cover;
  /* Outer columns round top-left and bottom-right; the middle one mirrors. */
  border-radius: max(18px, calc(30 * var(--u))) 0;
  transition: transform 0.6s var(--ease-out);
}
.a-ach-list li:nth-child(3n + 2) img { border-radius: 0 max(18px, calc(30 * var(--u))); }
.a-ach-list li:hover img { transform: translateY(-6px); }
.a-ach-list span {
  display: block;
  margin-top: max(12px, calc(23 * var(--u)));
  font-size: var(--fs-lede);
  color: var(--grey);
}

/* ============================================================
   A year full of learning — date tiles and the event they show
   ============================================================ */
.a-year { padding-top: max(80px, calc(381 * var(--u))); }

.a-year-inner { padding-inline: calc(150 * var(--u)) 20px; }

.a-year-title {
  font-size: var(--fs-title);
  line-height: 1.15;
  color: var(--navy);
}

.a-year-body {
  display: flex;
  align-items: flex-start;
  gap: calc(61 * var(--u));
  margin-top: max(24px, calc(52 * var(--u)));
}

.a-cal {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, calc(198 * var(--u)));
  column-gap: calc(44.5 * var(--u));
  row-gap: calc(52 * var(--u));
}

.a-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 198 / 178;
  padding: 0;
  border: 0;
  border-radius: max(12px, calc(17 * var(--u)));
  background: var(--mist-line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 6px 2px rgba(0, 0, 0, 0.15);
  font-family: var(--font-body);
  font-size: clamp(30px, 4.44vw, 64px);
  font-weight: 700;
  line-height: 0.82;
  row-gap: 0.3em;
  color: var(--a-grey);
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.a-day span {
  font-size: 0.4375em;         /* the month: 28 against the day at 64 */
  line-height: 0.82;
}
.a-day:hover {
  transform: translateY(-4px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25), 0 10px 20px -4px rgba(55, 76, 159, 0.35);
}
.a-day[aria-pressed="true"] {
  background: var(--pink);
  color: #fff;
}

.a-event {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}
.a-event-date {
  font-size: var(--fs-h4);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--a-grey);
}
.a-event-title {
  margin-top: 2px;
  font-size: var(--fs-h4);
  font-weight: 700;
  line-height: 1.22;
  color: var(--tangerine);
}
.a-event-copy.is-changing > * { animation: eventIn 0.5s var(--ease-out); }
@keyframes eventIn { from { opacity: 0; transform: translateY(8px); } }

.a-event-character {
  width: max(150px, calc(276 * var(--u)));
  height: auto;
  margin: calc(220 * var(--u)) 0 0 calc(63 * var(--u));
}

/* ============================================================
   Meet the people who make learning matter
   ============================================================ */
.a-people {
  padding-top: max(72px, calc(238 * var(--u)));
  text-align: center;
}

.a-people-title {
  font-size: var(--fs-title);
  line-height: 1.15;
  color: var(--orange);
}

.a-people-list {
  display: grid;
  grid-template-columns: repeat(3, max(110px, calc(232 * var(--u))));
  justify-content: center;
  margin-top: max(28px, calc(73 * var(--u)));
  padding-left: calc(4 * var(--u));
}
.a-people-list li {
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* Captions share a two-line box so a one-line name centres against
   the name-and-role pairs beside it. */
.a-people-list p {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 2.44em;
  margin-top: max(12px, calc(28 * var(--u)));
  padding-inline: 6px;
  font-size: var(--fs-small);
  line-height: 1.22;
  color: var(--a-grey);
}
.a-people-list strong { display: block; font-weight: 500; }
.a-people-list em { display: block; font-style: italic; }

/* Each portrait is cropped as Figma crops it inside the 171 × 168 circle. */
.a-avatar {
  position: relative;
  width: max(96px, calc(171 * var(--u)));
  aspect-ratio: 171 / 168;
  overflow: hidden;
  border-radius: 50%;
  background: #727272;
  transition: transform 0.6s var(--ease-out);
}
.a-people-list li:hover .a-avatar { transform: translateY(-6px); }
.a-avatar img {
  position: absolute;
  left: var(--x, 0%);
  top: var(--y, 0%);
  width: var(--w, 100%);
  max-width: none;
  height: auto;
}
.a-avatar--heggade img { height: 100%; object-fit: cover; }
.a-avatar--shrutha { --w: 107%; }
.a-avatar--joy     { --w: 201.8%; --x: -81.9%; --y: -20.2%; }

/* ============================================================
   Take the next step — the shared CTA, on the About wave
   ============================================================ */
.join--academics {
  margin-top: max(48px, calc(100 * var(--u)));
  padding: 170px 20px 106px;
}
.join--academics::before {
  left: -33.3%;
  width: 172.8%;
  --join-wave: url('../assets/figma/about/cta-wave.svg');
}
.join--academics .join-copyright { top: 120px; }

.a-join-sub { max-width: 390px; margin-inline: auto; }

.join-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px 88px;
  margin-top: 30px;
}
.join-actions .pill { margin-top: 0; }
.join-btn {
  min-width: 160px;
  min-height: 53px;
  padding: 12px 22px;
  font-size: var(--fs-ui);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1000px) {
  .join-actions { column-gap: 20px; }
  /* The CTA wave scales with the width here (styles.css); start the
     copy on its solid fill. */
  .join--academics { padding-top: calc(var(--join-fill) + 24px); }

  .a-year-body { flex-direction: column; gap: 32px; }
  .a-cal {
    grid-template-columns: repeat(3, minmax(0, 150px));
    gap: 20px;
  }
  .a-day { font-size: clamp(30px, 5vw, 48px); }
  .a-event { display: flex; align-items: center; gap: 24px; }
  .a-event-character { order: -1; width: 140px; margin: 0; }
}

/* Below 900px the copy keeps its readable minimum size while the photo
   shrinks, so it would run over the model plane: stack it above instead. */
@media (max-width: 900px) {
  .a-hero { padding-top: var(--hero-gap-phone); }
  .a-hero-stage { aspect-ratio: auto; display: flex; flex-direction: column; overflow: visible; }
  .a-hero-stage::after { display: none; }
  .a-hero-copy { position: static; order: 1; padding: 4px 20px 18px; }
  .a-hero-title, .a-hero-sub { max-width: none; }
  .a-hero-sub { max-width: 640px; margin-top: 10px; }
  .a-hero-img {
    position: static;
    order: 2;
    width: 100%;
    height: auto;
    aspect-ratio: 1440 / 1100;
    object-position: 58% center;
  }
}

@media (max-width: 760px) {
  .a-lines { display: none; }

  .a-stages-character { margin-inline: auto; }
  .a-stages-title { justify-content: center; margin-top: -12px; padding-inline: 20px; column-gap: 12px; }
  .a-explore { min-height: 40px; border-radius: 20px; }   /* a comfortable tap height */
  .a-stage-list {
    grid-template-columns: minmax(0, 384px);
    row-gap: 48px;
    padding-inline: 20px;
  }

  /* Why SDM: title, then the photos in a two-column grid. */
  .a-why { padding-top: 72px; }
  .a-why-stage {
    height: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 16px;
    max-width: 560px;
    padding-inline: 20px;
  }
  .a-why-stage > * { position: static; }
  .a-why-title { grid-column: 1 / -1; text-align: center; }
  .a-why-item { width: auto; }
  .a-why-item img { height: auto; aspect-ratio: 4 / 5; border-radius: 28px; }
  .a-why-item figcaption { margin-top: 10px; }

  .a-ped-tag { margin-top: 6px; }
  .a-ped-list li { flex-basis: 100%; }
  .a-ped-list li:nth-child(n) br { display: none; }
  .a-ped-list p { max-width: 260px; }

  .a-ach-list { grid-template-columns: repeat(2, minmax(0, 220px)); column-gap: 16px; }
  .a-ach-list li:nth-child(n) img { border-radius: 22px 0; }
  .a-ach-list li:nth-child(even) img { border-radius: 0 22px; }

  .a-year-inner { padding-inline: 20px; }
  .a-year-title { text-align: center; }
  .a-cal { width: 100%; max-width: 420px; margin-inline: auto; gap: 14px; }
  .a-event { width: 100%; max-width: 420px; margin-inline: auto; }

  .a-people-title br { display: none; }
  .a-people-list { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-inline: 12px; }
  .a-people-list p { font-size: var(--fs-ui); }
}

@media (max-width: 420px) {
  .a-event-character { width: 110px; }
  .a-ach-list { column-gap: 12px; }
}
