/* Education and Student Experience — prototype-aligned page */

.education-page {
  --strategy-theme: var(--e);
  --education-ink: var(--neutral-black);
  --education-paper: var(--purple-milky);
  --education-gold: var(--gold-royal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--education-ink);
  background: var(--education-paper);
}

.education-page main {
  flex: 1 0 auto;
}

.education-page .nav-link.active {
  color: var(--cuhk-purple);
}

.education-strategy-kicker {
  margin: 0 0 24px;
  color: var(--e);
  font-size: clamp(20px, 2vw, 28px);
  font-weight: var(--fw-medium);
  letter-spacing: -.03em;
}

.education-page .education-page-content {
  overflow: clip;
}

.education-hero {
  position: relative;
  background: #fff;
  isolation: isolate;
}

.education-hero-inner {
  position: relative;
  width: min(100%, var(--max));
  min-height: clamp(500px, 50vw, 642px);
  margin: 0 auto;
  padding: 0 var(--content-inset);
  display: grid;
  grid-template-columns: minmax(0, 49%) minmax(0, 51%);
  align-items: stretch;
  overflow: hidden;
}

.education-hero-copy {
  position: relative;
  z-index: 3;
  align-self: center;
  max-width: 590px;
}

.education-hero h1 {
  max-width: 590px;
  margin: 0;
  color: var(--e);
  font-size: clamp(54px, 5.3vw, 88px);
  font-weight: var(--fw-medium);
  letter-spacing: -.055em;
  line-height: .99;
  text-wrap: balance;
}

.education-hero h1 span {
  display: block;
}

.education-hero-message {
  max-width: 35ch;
  margin: clamp(34px, 4vw, 48px) 0 0;
  color: var(--education-ink);
  font-size: 18px;
  font-weight: var(--fw-light);
  line-height: 24px;
}

.education-hero-visual {
  position: relative;
  min-height: 0;
  margin: 0 calc(-1 * var(--content-inset)) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  pointer-events: none;
}

.education-hero-backdrop,
.education-hero-art {
  position: absolute;
  width: min(100%, 555px);
  height: auto;
  object-fit: contain;
}

.education-hero-backdrop {
  z-index: 0;
  width: min(100%, 458px);
  max-height: 590px;
  opacity: .96;
}

.education-hero-art {
  z-index: 1;
  width: min(100%, 604px);
  max-height: 590px;
}

.education-hero-prev,
.education-hero-next {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 50px;
  height: 50px;
  text-decoration: none;
  transform: translateY(-50%);
}

.education-hero-prev { left: clamp(24px, 3.4vw, 44px); }
.education-hero-next { right: clamp(24px, 3.4vw, 44px); }

.education-hero-arrow-icon {
  display: block;
  width: 50px;
  height: 50px;
}

.education-hero-prev .education-hero-arrow-icon { transform: rotate(180deg); }

.education-hero-prev:hover .education-hero-arrow-icon path,
.education-hero-next:hover .education-hero-arrow-icon path,
.education-hero-prev:focus-visible .education-hero-arrow-icon path,
.education-hero-next:focus-visible .education-hero-arrow-icon path {
  fill: var(--e);
}

.education-strategy-section {
  padding: var(--section-padding);
  background: var(--education-paper);
}

.education-strategy-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 0;
}

.education-strategy-grid {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(288px, auto);
  gap: 28px 24px;
}

.education-strategy-card {
  position: relative;
  min-height: 288px;
  padding: 28px;
  border: 2px solid transparent;
  border-radius: 18px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(150deg, var(--e) 35%, var(--education-gold) 100%) border-box;
}

.education-strategy-card-number {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--e);
  box-shadow: 0 3px 6px rgba(37, 22, 45, .18);
  font-size: 20px;
  font-weight: var(--fw-medium);
  line-height: 1;
}

.education-strategy-card h2 {
  margin: 0;
  color: var(--e);
  font-size: 24px;
  font-weight: var(--fw-medium);
  letter-spacing: -.025em;
  line-height: 1.08;
  text-wrap: balance;
}

.education-strategy-card p {
  max-width: 65ch;
  margin: 22px 0 0;
  color: var(--education-ink);
  font-size: 18px;
  font-weight: var(--fw-light);
  line-height: 24px;
}

.education-closing {
  background: #100a16;
}

.education-closing-image {
  position: relative;
  aspect-ratio: 1280 / 461;
  overflow: hidden;
  isolation: isolate;
}

.education-closing-image > img {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 1023px) {
  .education-hero-inner {
    grid-template-columns: minmax(0, 52%) minmax(0, 48%);
  }

  .education-hero-visual {
    margin-right: calc(-1 * var(--content-inset));
  }

  .education-hero-backdrop,
  .education-hero-art {
    width: min(112%, 604px);
  }

  .education-hero-backdrop {
    width: min(100%, 458px);
  }
}

@media (max-width: 767px) {
  .education-hero-inner {
    --education-hero-media-height: clamp(250px, 58vw, 330px);
    min-height: 0;
    display: block;
    padding: 0;
  }

  .education-hero-copy {
    --education-hero-arrow-clearance: clamp(56px, 14vw, 88px);
    width: calc(100% - var(--content-pad) - var(--education-hero-arrow-clearance));
    max-width: none;
    padding: clamp(32px, 7vw, 52px) 0 clamp(20px, 4vw, 32px) var(--content-pad);
  }

  .education-hero h1 {
    max-width: none;
    font-size: clamp(32px, 9vw, 46px);
    letter-spacing: -.045em;
    line-height: 1.05;
  }

  .education-hero-message {
    max-width: 32ch;
    margin-top: 24px;
    font-size: clamp(16px, 3.8vw, 18px);
    line-height: 1.55;
  }

  .education-hero-visual {
    width: auto;
    height: var(--education-hero-media-height);
    min-height: 0;
    margin: 0;
    align-items: center;
    overflow: hidden;
  }

  .education-hero-backdrop {
    width: min(86%, 458px);
    max-height: none;
  }

  .education-hero-art {
    width: min(86%, 604px);
    max-height: 100%;
  }

  .education-hero-prev,
  .education-hero-next {
    top: auto;
    bottom: calc(var(--education-hero-media-height) / 2);
  }

  .education-hero-prev { left: 4px; }
  .education-hero-next { right: 4px; }

  .education-strategy-inner {
    padding: 0;
  }

  .education-strategy-grid {
    gap: 24px 16px;
  }

  .education-strategy-card {
    min-height: 0;
    padding: 22px 20px;
    border-radius: 18px;
  }

  .education-strategy-card-number {
    width: 34px;
    height: 34px;
    margin-bottom: 10px;
    font-size: 17px;
  }

  .education-strategy-card h2 {
    font-size: clamp(16px, 4.2vw, 21px);
    letter-spacing: -.02em;
  }

  .education-strategy-card p {
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.45;
  }
}

@media (max-width: 399px) {
  .education-hero-copy {
    --education-hero-arrow-clearance: 54px;
    padding-top: 32px;
  }

  .education-hero h1 { font-size: clamp(32px, 11vw, 40px); }

  .education-hero-message {
    max-width: none;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.45;
  }

  .education-hero-backdrop,
  .education-hero-art {
    width: 88%;
  }

  .education-strategy-inner {
    padding: 0;
  }

  .education-strategy-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .education-strategy-card { padding: 22px; }
  .education-strategy-card h2 { font-size: 18px; }
  .education-strategy-card p { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .education-page a,
  .education-hero-art,
  .education-strategy-card {
    transition: none !important;
  }
}

.education-strategy-grid {
  grid-auto-rows: auto;
}

@media (max-width: 767px) {
  .education-strategy-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
