/* ============================================================
   SDM School - Grade pages (Pre K - Grade 5, Grade 6 - 8, Grade 9 - 10)
   Figma: PRE K / Grade 6 - 8 / Grade 9 - 10 frames (1440 x 1131).
   Shared tokens, header and footer live in styles.css.

   Each page is one hero: the artwork (1440 x 810 on the frame, its left
   side left white) with the heading, tagline, line of copy and an Apply
   button over that white space. --u is one design pixel.
   ============================================================ */

.page-grade {
  --u: calc(min(100vw, 1440px) / 1440);
  --nav-ink: #3934c9;
}
.page-grade main { overflow-x: clip; }

/* Per page: heading and button colours, and where the copy sits
   (measured from the artwork's top-left corner, in design pixels). */
.grade--prek { --grade-ink: var(--pink);      --btn-bg: var(--pink);      --btn-ink: #fff;        --btn-hover: var(--pink-deep); --copy-x: 82; --copy-y: 183; }
.grade--6-8  { --grade-ink: var(--tangerine); --btn-bg: var(--orange);    --btn-ink: #fff;        --btn-hover: #c93d2a;          --copy-x: 70; --copy-y: 233; }
.grade--9-10 { --grade-ink: var(--blue);      --btn-bg: var(--mist-line); --btn-ink: var(--navy); --btn-hover: var(--sky-deep);  --copy-x: 70; --copy-y: 233; }

.grade-hero {
  position: relative;
  padding-top: var(--hero-gap);          /* clears the header bar */
}

.grade-art {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1440 / 810;
  object-fit: cover;
}

.grade-copy {
  position: absolute;
  left: calc(var(--copy-x) * var(--u));
  top: calc(var(--hero-gap) + var(--copy-y) * var(--u));
  max-width: calc(560 * var(--u));
}

.grade-title {
  font-size: var(--fs-title);
  line-height: 1.15;
  color: var(--grade-ink);
}
.grade-tag {
  margin-top: calc(10 * var(--u));
  font-size: clamp(18px, 2.08vw, 30px);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--grey-dark);
}
.grade-text {
  margin-top: calc(22 * var(--u));
  font-size: var(--fs-lede);
  line-height: 1.22;
  color: var(--grey);
}

.grade-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 111px;
  min-height: 37px;
  margin-top: calc(26 * var(--u));
  padding: 6px 26px;
  border-radius: 59px;
  background: var(--btn-bg);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--btn-ink);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    scale 0.15s var(--ease-out);
}
.grade-apply:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -10px rgba(55, 76, 159, 0.6);
}
.grade-apply:active { scale: 0.96; }

/* The artwork settles in gently on arrival. */
@media (prefers-reduced-motion: no-preference) {
  .grade-art { animation: gradeArtIn 1s var(--ease-out) 0.1s backwards; }
  .grade-copy > * { animation: gradeCopyIn 0.8s var(--ease-out) backwards; }
  .grade-copy > :nth-child(2) { animation-delay: 0.08s; }
  .grade-copy > :nth-child(3) { animation-delay: 0.16s; }
  .grade-copy > :nth-child(4) { animation-delay: 0.24s; }
  html.vt-in .grade-art,
  html.vt-in .grade-copy > * { animation: none; }
}
@keyframes gradeArtIn { from { opacity: 0; transform: translateY(24px); } }
@keyframes gradeCopyIn { from { opacity: 0; transform: translateY(14px); } }

/* Below 900px the copy keeps its readable size while the artwork
   shrinks, so it would run into the photos: stack the copy above, and
   crop the artwork to its photo half so the children stay large. */
@media (max-width: 900px) {
  .grade-hero { display: flex; flex-direction: column; padding-top: var(--hero-gap-phone); }
  .grade-copy {
    position: static;
    order: -1;                           /* heading first, then the artwork */
    max-width: none;
    padding: 4px 20px 8px;
  }
  .grade-tag { margin-top: 6px; }
  .grade-text { margin-top: 14px; }
  .grade-apply { margin-top: 18px; min-height: 42px; }
  .grade-art {
    aspect-ratio: 1 / 1;
    object-position: 82% bottom;
  }
}
@media (min-width: 640px) and (max-width: 900px) {
  .grade-art { aspect-ratio: 4 / 3; object-position: 90% bottom; }
}
