/* 在这里覆盖参考样式。区块 ID 与两个 HTML 文件中的 id 一致。
   常用入口：#hero 首屏，#courses 课程，#by-age 年龄分组，
   #why-xly 品牌介绍，#campuses 校园，#consultation 英文咨询。 */

[data-mobile-drawer][hidden] {
  display: none;
}

/* 常用配色。修改下列值可同时更新中英文页面。 */
:root {
  --color-oxford: #002147;
  --color-night: #081122;
  --color-gold: #b9975b;
  --color-gold-light: #d6bd8c;
  --color-mist: #f5f6f9;
  --color-line: #e3e7ee;
  --color-slate: #4a5a72;
  --site-card-radius: 12px;
}

/* Round the homepage's boxed links, callouts and information cards. */
:is(main, header) a:is(.bg-gold, .bg-oxford, .bg-night, .bg-navy, .border):not([class*="rounded"]) {
  border-radius: 8px;
}
header [class*="min-w-[270px]"].bg-white,
#hero > div:nth-child(2) > a,
#courses a.bg-navy,
#consultation .ring-1.bg-white,
#china-programme dl.bg-white\/15,
#why-xly figure > .overflow-hidden {
  border-radius: var(--site-card-radius);
}
#hero > div:nth-child(2) > a > span:first-child { border-radius: 6px; }
#china-programme dl.bg-white\/15 { overflow: hidden; }
#by-age .grid.border-l {
  gap: 12px;
  border: 0;
}
#by-age .grid.border-l > .border-r {
  border: 1px solid rgb(255 255 255 / .16);
  border-radius: var(--site-card-radius);
}

/* Editorial type scale for the multilingual homepages. */
main {
  --editorial-sans: var(--font-sans, system-ui, sans-serif);
  --editorial-heading: clamp(30px, 3.65vw, 54px);
}
main :is(h1, h2, h3) {
  font-family: var(--editorial-sans);
  font-weight: 700;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
main h2 {
  font-size: var(--editorial-heading);
  line-height: 1.13;
}
main h3 { line-height: 1.24; }
main :is(h1, h2):not(:lang(zh), :lang(ja), :lang(ko)) { letter-spacing: -.035em; }
main :is(dt, dd) { overflow-wrap: anywhere; }
#hero dt {
  font-size: clamp(23px, 2.5vw, 34px);
  line-height: 1.2;
}


.site-home-utility,
.site-home-nav-row {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(16px, 2.1vw, 32px);
}

.site-home-utility {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 36px;
  padding-block: 4px;
}

.site-home-utility > span {
  min-width: 0;
  text-wrap: pretty;
}

.site-home-booking {
  display: inline-flex;
  flex: none;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border-radius: 6px;
  background: #fff;
  color: var(--color-oxford);
  font: inherit;
  white-space: nowrap;
}

.site-home-booking:hover,
.site-home-booking:focus-visible { background: #e8edf5; }

.site-home-nav {
  border-bottom: 1px solid var(--color-line);
  background: #f5f6f8;
}

.site-home-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding-block: 10px;
}

.site-home-nav-row > a {
  min-width: 0;
  flex-shrink: 1;
}

.site-home-nav-row > a > span > span:first-child {
  white-space: normal;
  text-wrap: balance;
}

.site-home-crest {
  width: 48px;
  height: 48px;
  flex: none;
}

.site-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  color: #fff;
  text-decoration: none;
}

.site-footer-crest {
  width: clamp(46px, 5vw, 60px);
  height: auto;
  flex: none;
}

.site-footer-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  line-height: 1.2;
}

.site-footer-brand-name {
  font-size: clamp(15px, 1.55vw, 18px);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.site-footer-brand-subtitle {
  color: #e3edf7;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.site-footer-brand-subtitle:lang(zh) {
  font-size: clamp(17px, 1.6vw, 19px);
  letter-spacing: .12em;
}

.site-footer-brand:focus-visible {
  outline: 2px solid var(--color-gold-light);
  outline-offset: 5px;
}

.site-home-nav-row .site-mobile-menu-toggle {
  display: grid;
  grid-auto-flow: column;
  width: auto;
  height: auto;
  min-height: 44px;
  align-items: center;
  column-gap: 8px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--color-oxford);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.site-home-nav-row .site-mobile-menu-toggle:hover,
.site-home-nav-row .site-mobile-menu-toggle[aria-expanded="true"] { background: #173c66; }

.site-home-nav-row .site-mobile-menu-toggle svg { width: 19px; height: 19px; }

.site-home-booking:focus-visible,
.site-home-nav-row .site-mobile-menu-toggle:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
}

.site-home-nav-row > div > a {
  border-radius: 9px;
}

.site-home-header [data-mobile-drawer]:not([hidden]) {
  display: block;
  max-height: min(calc(100dvh - 112px), 480px);
}

.site-home-header .site-language-menu--drawer .site-language-options {
  position: static;
  margin-top: 5px;
}

.site-home-hero > img {
  object-position: center 50%;
}

.site-home-hero .ribbon {
  right: clamp(36px, 7vw, 106px);
  width: clamp(44px, 5.6vw, 80px);
  height: clamp(185px, 22.4vw, 320px);
  pointer-events: none;
}

.site-home-hero .ribbon > span {
  top: clamp(20px, 2.7vw, 40px);
  max-height: calc(100% - 64px);
  color: #fff;
  font-size: clamp(11px, 1.04vw, 15px);
  line-height: 1.2;
  letter-spacing: .23em;
  writing-mode: vertical-rl;
  text-wrap: pretty;
}

.site-home-hero-text {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding: 44px clamp(22px, 3.6vw, 60px) 132px;
  text-align: left;
}

.site-home-hero-mark {
  display: block;
  width: clamp(54px, 5.15vw, 74px);
  height: auto;
  margin-bottom: clamp(18px, 2.35vw, 34px);
}

.site-home-hero-mark + div {
  margin-bottom: 22px;
}

.site-home-hero-text > h1,
.site-home-hero-text > p {
  margin-inline: 0;
}

.site-home-hero-text > h1 {
  max-inline-size: 17ch;
  font-size: clamp(36px, 7vw, 66px);
  line-height: 1.06;
}

.site-home-hero-text > h1:is(:lang(zh), :lang(ja), :lang(ko)) {
  max-inline-size: 12em;
  font-size: clamp(42px, 8.8vw, 72px);
  line-height: 1.13;
}

.site-home-hero-text > p {
  max-inline-size: 44ch;
  color: #edf1f7;
  font-size: clamp(16px, 1.55vw, 20px);
  font-weight: 600;
  line-height: 1.65;
  text-wrap: pretty;
}

.site-home-hero-text > h1 + p + div {
  justify-content: flex-start;
  margin-top: 24px;
}

.site-home-hero-text > h1 + p + div + div {
  align-items: flex-start;
  margin-inline: 0;
  border-radius: 10px;
  background: rgb(87 89 95 / .72);
}

@media (max-width: 639px) {
  .site-home-nav-row {
    min-height: 66px;
    gap: 8px;
  }

  .site-home-nav-row > a {
    gap: 8px;
  }

  .site-home-nav-row > a > span > span:first-child {
    font-size: clamp(14px, 4vw, 19px);
  }

  .site-home-crest {
    width: 40px;
    height: 40px;
  }
}

@media (min-width: 1024px) {
  .site-home-hero {
    min-height: clamp(730px, 57vw, 920px);
  }

  .site-home-hero-text {
    display: grid;
    grid-template-columns: minmax(0, 1.88fr) minmax(0, 1fr);
    column-gap: clamp(32px, 5vw, 76px);
    padding-block-start: clamp(94px, 9.2vw, 140px);
    padding-inline-end: clamp(68px, 8.2vw, 118px);
  }

  .site-home-hero-mark,
  .site-home-hero-mark + div {
    grid-column: 1 / -1;
  }

  .site-home-hero-mark + div {
    margin-bottom: 28px;
    font-size: clamp(13px, 1.1vw, 16px);
  }

  .site-home-hero-text > h1 {
    grid-area: 3 / 1;
    align-self: end;
    font-size: clamp(52px, 5.3vw, 86px);
  }

  .site-home-hero-text > h1:lang(zh) {
    max-inline-size: 5.25em;
    font-size: clamp(62px, 6.25vw, 96px);
  }

  .site-home-hero-text > h1:is(:lang(ja), :lang(ko)) {
    font-size: clamp(58px, 5.8vw, 90px);
  }

  .site-home-hero-text > p {
    grid-area: 3 / 2;
    align-self: end;
    margin-block: 0 4px;
    padding-inline-start: clamp(18px, 2vw, 30px);
    border-inline-start: 1px solid #ffffff70;
  }

  .site-home-hero-text > p::before {
    content: "";
    float: inline-end;
    width: clamp(24px, 3vw, 42px);
    height: 1.7em;
  }

  .site-home-hero-text > h1 + p + div {
    grid-area: 4 / 1;
    align-self: start;
  }

  .site-home-hero-text > h1 + p + div > a {
    padding: 16px clamp(22px, 2.45vw, 36px);
    border-radius: 9px;
    font-size: clamp(16px, 1.45vw, 20px);
  }

  .site-home-hero-text > h1 + p + div + div {
    grid-area: 4 / 2;
    flex-direction: column;
    align-self: start;
    gap: 8px;
    margin-block-start: 24px;
    padding: 14px 17px;
    font-size: clamp(15px, 1.28vw, 18px);
  }
}

@media (min-width: 1350px) {
  .site-home-utility {
    min-height: 44px;
    font-size: 15px;
  }

  .site-home-nav-row {
    min-height: 94px;
  }

  .site-home-crest {
    width: 60px;
    height: 60px;
  }

  .site-home-nav-row > a > span > span:first-child {
    font-size: 23px;
  }

  .site-home-nav-row > div > a,
  .site-home-nav-row .site-mobile-menu-toggle {
    padding: 16px 23px;
    font-size: 17px;
  }
}

#hero > div:nth-child(2) > a > span:nth-child(2) {
  min-width: 0;
  overflow-wrap: anywhere;
}
#hero > div:nth-child(2) > a > span:nth-child(2) > span:first-child {
  font-family: var(--editorial-sans);
  font-weight: 700;
  line-height: 1.3;
}
#hero > div:nth-child(2) > a > span:nth-child(2) > span:nth-child(2) {
  color: #d3dce9;
}
#courses > div > div:first-child {
  border-block-start: 1px solid var(--color-line);
  padding-block-start: 20px;
}
main :is(#courses, #by-age, #china-programme, #why-xly, #campuses, #consultation) h2 + p {
  max-inline-size: 54ch;
  text-wrap: pretty;
}
#by-age h3 + p,
#why-xly h3 + p {
  color: #d3dce9;
  line-height: 1.65;
}
#by-age h3 + p,
#why-xly h3 + p,
#courses h3 + p { font-size: 16px; }

@media (max-width: 767px) {
  #hero > div:nth-child(2) { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 1024px) {
  #campuses > div:has(> div > h2) > div:has(> h2) {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: end;
    gap: 0 clamp(24px, 5vw, 70px);
  }
  #campuses > div > div:has(> h2) > div { grid-column: 1 / -1; }
  #campuses h2 + p {
    margin-block: 0;
    padding-inline-start: 20px;
    border-inline-start: 1px solid #ffffff45;
  }
  #why-xly div:has(> span + div > h3) > div {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr);
    gap: 16px;
  }
  #why-xly div:has(> span + div > h3) > div > p { margin-top: 0; }
}
