/* Reading aids, independent from privacy and tracking settings. */
#cubo-a11y {
  --rail-bg: #211431;
  --rail-active: #493264;
  font: 400 1rem/1.45 system-ui, sans-serif;
  color: #fff;
}
#cubo-a11y button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: var(--rail-bg);
  color: #fff;
  padding: .45em;
  cursor: pointer;
  font-weight: 700;
}
#cubo-a11y button:hover,
#cubo-a11y button[aria-pressed="true"] { background: var(--rail-active); }
#cubo-a11y button[aria-disabled="true"] { color: #aaa; cursor: default; }
#cubo-a11y button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
#cubo-a11y button svg { flex: none; }
.cubo-a11y-rail, .cubo-a11y-mobile {
  position: fixed;
  z-index: 219;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 4px 20px #0004;
}
.cubo-a11y-rail {
  right: max(6px, env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
  display: grid;
}
#cubo-a11y .cubo-a11y-rail button {
  width: 44px;
  padding: 0;
  font-size: 14px;
}
#cubo-a11y .cubo-a11y-rail button + button { border-top: 1px solid var(--rail-active); }
.cubo-a11y-mobile { display: none; }
.cubo-a11y-status:not([hidden]) {
  position: fixed;
  z-index: 220;
  right: 56px;
  top: 50%;
  max-width: min(230px, 70vw);
  padding: .55em .75em;
  border-radius: 6px;
  color: #fff;
  background: #111;
  font-size: .875em;
  pointer-events: none;
  margin: 0;
}
@media (max-width: 760px), (max-height: 500px) {
  .cubo-a11y-rail { display: none; }
  .cubo-a11y-mobile {
    display: block;
    left: max(12px, env(safe-area-inset-left));
    bottom: max(18px, calc(env(safe-area-inset-bottom) + 8px));
  }
  .cubo-a11y-status:not([hidden]) { left: 12px; right: auto; top: auto; bottom: 68px; }
}
#cubo-a11y-dialog {
  width: min(480px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: clamp(12px, 4vw, 24px);
  border: 1px solid #aaa;
  border-radius: 12px;
  color: #fff;
  background: #111;
  overflow: auto;
  margin: auto;
  overflow-wrap: anywhere;
}
#cubo-a11y-dialog::backdrop { background: #0009; }
.cubo-a11y-heading, .cubo-a11y-size, .cubo-a11y-panel-actions {
  display: flex;
  align-items: center;
  gap: .5em;
}
.cubo-a11y-heading { justify-content: space-between; }
.cubo-a11y-heading h2 { font-size: 1.2em; line-height: 1.25; margin: 0; }
.cubo-a11y-size, .cubo-a11y-panel-actions { flex-wrap: wrap; margin: .5em 0; }
.cubo-a11y-size > span { flex: 1 0 50%; }
#cubo-a11y-dialog p { margin: .6em 0; }
.cubo-a11y-option { display: flex; align-items: center; gap: .65em; min-height: 44px; cursor: pointer; }
.cubo-a11y-option input { width: 1.15em; height: 1.15em; margin: 0; accent-color: #ffdf70; flex: none; }
#cubo-a11y .cubo-a11y-panel-actions button, #cubo-a11y .cubo-a11y-size button { border: 1px solid #777; border-radius: 5px; }
.cubo-a11y-dialog-status:empty { display: none; }

/* Apply preferences to both reading surfaces. The campaign welcome screen lives outside #app. */
html.cubo-a11y-size-adjusted body { font-size: calc(16px * var(--cubo-a11y-scale, 1)); }
html:is(.cubo-a11y-size-adjusted,.cubo-a11y-space-on) :is(#main,.site-footer,.prehome-copy,#cubo-a11y-dialog) {
  overflow-wrap: anywhere;
}
html.cubo-a11y-space-on :is(#main,.site-header,.site-top-menu,.site-footer,.prehome-overlay,#editorial-lightbox,#cubo-a11y-dialog,.floating-contact),
html.cubo-a11y-space-on :is(#main,.site-header,.site-top-menu,.site-footer,.prehome-overlay,#editorial-lightbox,#cubo-a11y-dialog,.floating-contact) :where(:not(svg,svg *,i)) {
  letter-spacing: .12em !important;
  word-spacing: .16em !important;
}
html.cubo-a11y-reading-on :is(#main,.site-header,.site-top-menu,.site-footer,.prehome-overlay,#editorial-lightbox,#cubo-a11y-dialog,.floating-contact)
  :where(h1,h2,h3,h4,h5,h6,p,li,blockquote,dd,figcaption,summary,label,button,a,small,span,strong,em) {
  line-height: 1.95 !important;
}
html.cubo-a11y-links-on :is(#app,.prehome-overlay) a[href],
html.cubo-a11y-links-on .skip-link {
  text-decoration: underline solid currentColor .12em !important;
  text-underline-offset: .2em;
}
html.cubo-a11y-links-on :is(#app,.prehome-overlay) a:has(img),
html.cubo-a11y-links-on .footer-social-icons a {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}
html.cubo-a11y-motion-on,
html.cubo-a11y-motion-on *,
html.cubo-a11y-motion-on *::before,
html.cubo-a11y-motion-on *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* Collapse photos together with their frames. Keep captions, video links and unit CTAs. */
html.cubo-a11y-images-on :is(#main,.prehome-overlay) :is(img,video,.hero-photo,.hero-scrim,.hero-shape,.prehome-photo,.curriculum-image,.experience-photo,.page-hero-image,.editorial-hero-photo,.editorial-hero-inset,.editorial-orbit,.editorial-story-image,.editorial-photo-corner,.editorial-gallery-open,.safeguarding-visual,.editorial-unit-card>a:first-child,.editorial-showcase-card figure) {
  display: none !important;
}
html.cubo-a11y-images-on :is(.prehome-overlay,.curriculum-section,.experience-section,.safeguarding-intro,.page-hero,.editorial-showcase-card) {
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: auto;
}
html.cubo-a11y-images-on .prehome-copy { width: min(100%, 56rem); margin: auto; }
html.cubo-a11y-images-on .welcome-visual { min-height: auto; height: auto; aspect-ratio: auto; }
html.cubo-a11y-images-on .welcome-visual :is(.visual-caption,.welcome-play),
html.cubo-a11y-images-on .editorial-hero-caption { position: static; max-width: none; }
html.cubo-a11y-images-on .editorial-hero-media,
html.cubo-a11y-images-on .editorial-story-figure { padding: 0; }
html.cubo-a11y-images-on .editorial-story-figure::before { display: none; }
html.cubo-a11y-images-on .image-card { min-height: auto; background: #352348; }
html.cubo-a11y-images-on .hero-home { background: #352348; }

/* Use the site's section and card structure to distinguish reading surfaces. */
html.cubo-a11y-contrast-on {
  color-scheme: dark;
  --hc-page: #181818;
  --hc-section: #262626;
  --hc-section-alt: #363636;
  --hc-card: #464646;
  --hc-control: #505050;
  --hc-edge: #a0a0a0;
  --hc-text: #fff;
  --hc-action: #ffe07a;
}
html.cubo-a11y-contrast-on body,
html.cubo-a11y-contrast-on :is(#app,#main,.site-top-menu,.site-footer,.skip-link) {
  color: var(--hc-text) !important;
  background: var(--hc-page) !important;
}
html.cubo-a11y-contrast-on #main > section,
html.cubo-a11y-contrast-on :is(.site-header,.prehome-overlay,#editorial-lightbox) {
  background: var(--hc-section) !important;
}
html.cubo-a11y-contrast-on #main > section:nth-of-type(even),
html.cubo-a11y-contrast-on :is(#app,.prehome-overlay) :where(.main-nav.is-open,.nav-panel,.prehome-copy,.editorial-jumpnav,.cta-panel,.contact-strip,.footer-social,.value-row,.purpose-band,.editorial-news-categories span) {
  background: var(--hc-section-alt) !important;
}
html.cubo-a11y-contrast-on :is(#main,.prehome-overlay,#editorial-lightbox,.site-header,.site-top-menu,.site-footer,.floating-contact),
html.cubo-a11y-contrast-on :is(#main,.prehome-overlay,#editorial-lightbox,.site-header,.site-top-menu,.site-footer,.floating-contact)
  :where(h1,h2,h3,h4,h5,h6,p,span,small,strong,b,i,em,label,li,legend,address,blockquote,figcaption,summary) {
  color: var(--hc-text) !important;
  text-shadow: none !important;
}
html.cubo-a11y-contrast-on #main :where(.differential-grid,.editorial-showcase-grid) { background: var(--hc-edge) !important; }
html.cubo-a11y-contrast-on #main :where(.differential-grid>a,.number-card,.news-card,.editorial-unit-card,.editorial-showcase-card,.principles-grid article,.testimonial-grid blockquote,.fact-panel,.history-box,.related-links a,.pathway>div,.assessment-list>div,.editorial-hero-form,.editorial-referral-form,.visual-caption,.language-grid span,.detail-chips span) {
  background: var(--hc-card) !important;
  border-color: var(--hc-edge) !important;
}
html.cubo-a11y-contrast-on #main :where(.editorial-feature,.editorial-answers details,.safeguarding-policies details,.safeguarding-practices>div,.editorial-link) { border-color: var(--hc-edge) !important; }
html.cubo-a11y-contrast-on :is(#main,.prehome-overlay,.site-header,.site-footer,#editorial-lightbox,.floating-contact)
  :where(button,input,select,option,textarea,.floating-contact-links a,.prehome-columns a,.welcome-play,.editorial-zoom,.safeguarding-policies summary:hover,.editorial-answers summary:hover) {
  background: var(--hc-control) !important;
  color: var(--hc-text) !important;
  border-color: var(--hc-edge) !important;
}
html.cubo-a11y-contrast-on :is(#app,.prehome-overlay,#editorial-lightbox) :where(a,summary,button),
html.cubo-a11y-contrast-on .skip-link { color: var(--hc-action) !important; }
html.cubo-a11y-contrast-on :is(#app,.prehome-overlay) a :where(span,i,b,strong,small,svg) { color: inherit !important; }
html.cubo-a11y-contrast-on :is(#app,.prehome-overlay) :where(.nav-cta,.button,.prehome-highlight,.safeguarding-button,.editorial-button,.editorial-referral-regulation,.enquiry-submit,.hero-actions a) {
  background: var(--hc-action) !important;
  color: var(--hc-page) !important;
  border-color: var(--hc-action) !important;
}
html.cubo-a11y-contrast-on #main .hero-actions a { border: 1px solid var(--hc-action); border-radius: 3px; padding: .85em 1.2em; min-height: 44px; }
/* One continuous scrim leaves the heading, paragraph and actions on the same photograph. */
html.cubo-a11y-contrast-on #main :is(.hero-scrim,.editorial-referral-shade) {
  background: linear-gradient(100deg, rgb(24 24 24 / 94%), rgb(32 32 32 / 85%) 52%, rgb(43 43 43 / 75%)) !important;
}
html.cubo-a11y-contrast-on #main .image-card::after { background: linear-gradient(to top, #202020 0%, rgb(32 32 32 / 85%) 63%, rgb(32 32 32 / 55%)) !important; }
html.cubo-a11y-contrast-on #main .hero-shape { opacity: 0; }
html.cubo-a11y-contrast-on #app .hero-dots button { background: var(--hc-control) !important; box-shadow: inset 0 0 0 1px var(--hc-edge); }
html.cubo-a11y-contrast-on #app .hero-dots button[aria-current="true"],
html.cubo-a11y-contrast-on #app .menu-toggle i { background: var(--hc-action) !important; }
html.cubo-a11y-contrast-on #app :where(.safeguarding-mark,.editorial-feature-mark,.editorial-hero-photo-edge,.editorial-photo-corner,.editorial-inset-mark) { background: var(--hc-card); border-color: var(--hc-edge); }
html.cubo-a11y-contrast-on #app .site-header .brand-logo { background: white; border-radius: 3px; }
html.cubo-a11y-contrast-on body:not(.page-interior) .header-layout-compact .brand-logo { background: transparent !important; }
html.cubo-a11y-contrast-on #cubo-a11y { --rail-bg: var(--hc-section); --rail-active: var(--hc-control); }
html.cubo-a11y-contrast-on #cubo-a11y-dialog { background: var(--hc-section); border-color: var(--hc-edge); }
html.cubo-a11y-contrast-on #cubo-a11y button[aria-pressed="true"] { box-shadow: inset 4px 0 var(--hc-action); }
html.cubo-a11y-contrast-on #cubo-a11y .cubo-a11y-option:has(input:checked) { color: var(--hc-action); }
html.cubo-a11y-contrast-on :focus-visible { outline: 3px solid var(--hc-action) !important; outline-offset: 2px; }


body:has(.prehome-overlay) :is(.cubo-a11y-rail,.cubo-a11y-mobile) { z-index: 9001; }
body:has(.prehome-overlay) .cubo-a11y-status { z-index: 9002; }
body:has(.prehome-overlay) { overflow: hidden; }
@media (max-width: 760px) {
  .prehome-overlay .prehome-copy { padding-bottom: max(5rem, env(safe-area-inset-bottom)); }
}
#cubo-a11y button[aria-pressed="true"] { box-shadow: inset 4px 0 #78e4d9; }
#cubo-a11y .cubo-a11y-option:has(input:checked) { color: #9df0e5; }
#cubo-a11y input:focus-visible { outline: 2px solid white; outline-offset: 3px; }
html.cubo-a11y-images-on :is(.site-header,.site-footer) :is(.brand-logo,.footer-cambridge-badge img) { display: none; }
html.cubo-a11y-images-on :is(.site-header,.site-footer) .brand::after { content: "Cubo Global School"; line-height: 1.15; }
html.cubo-a11y-images-on .footer-cambridge-badge { width: auto; height: auto; color: #152f37; }
html.cubo-a11y-images-on .footer-cambridge-badge::after { content: "Cambridge International Education"; }
html.cubo-a11y-contrast-on #app .footer-cambridge-badge { background: var(--hc-section); }
html:is(.cubo-a11y-size-adjusted,.cubo-a11y-space-on,.cubo-a11y-reading-on) .prehome-close { line-height: 1 !important; }
html:is(.cubo-a11y-size-adjusted,.cubo-a11y-space-on,.cubo-a11y-reading-on) .hero-home {
  height: auto;
  padding-block: calc(var(--header-h) + 3rem) 3rem;
}
html:is(.cubo-a11y-size-adjusted,.cubo-a11y-space-on,.cubo-a11y-reading-on) .hero-copy { margin-block: 0; }
html:is(.cubo-a11y-size-adjusted,.cubo-a11y-space-on,.cubo-a11y-reading-on) .footer-social { flex-wrap: wrap; }
@media (max-width: 760px) {
  html:is(.cubo-a11y-size-adjusted,.cubo-a11y-space-on,.cubo-a11y-reading-on) :is(.split-head,.footer-top) {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
  }
  html:is(.cubo-a11y-size-adjusted,.cubo-a11y-space-on,.cubo-a11y-reading-on) .hero-copy { width: calc(100% - 3.5rem); }
}
html:is(.cubo-a11y-size-adjusted,.cubo-a11y-space-on) :is(#main,.prehome-copy) :is(h1,h2,h3,p,a,summary) {
  overflow-wrap: anywhere;
}
html:is(.cubo-a11y-size-adjusted,.cubo-a11y-space-on) .editorial-hero-copy { min-width: 0; }

/* Large type needs the compact navigation before the site's usual mobile breakpoint. */
@media (min-width: 761px) and (max-width: 1500px) {
  html:is(.cubo-a11y-size-adjusted,.cubo-a11y-space-on) .site-header {
    & .menu-toggle {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 6px;
    }
    & .menu-toggle i { display: block; width: 20px; height: 2px; background: currentColor; }
    & .main-nav {
      display: none;
      position: absolute;
      inset: 100% 0 auto;
      max-height: calc(100dvh - var(--header-h) - 34px);
      overflow: auto;
      padding: 1rem var(--space);
      background: #fff;
      color: #352348;
      align-items: stretch;
      flex-direction: column;
      gap: 0;
    }
    & .main-nav.is-open { display: flex; }
    & .main-nav :is(a,summary) { padding: .65em; white-space: normal; }
    & .nav-panel { position: static; min-width: 0; box-shadow: none; }
  }
}

html.cubo-a11y-images-on .site-header .brand {
  min-width: 0;
  max-width: calc(100% - 64px);
  font-size: 1rem;
  overflow-wrap: anywhere;
}
html.cubo-a11y-images-on .site-header { gap: .5rem; }
html:is(.cubo-a11y-size-adjusted,.cubo-a11y-space-on) :is(.experience-copy,.curriculum-copy,.welcome-content) { min-width: 0; }
/* Only the visible contact controls should receive clicks over page content. */
.floating-contact { pointer-events: none; }
.floating-contact-trigger, .floating-contact.is-open .floating-contact-links a { pointer-events: auto; }
@media (min-width: 761px) and (min-height: 501px) {
  body:has(.floating-contact.is-open) .cubo-a11y-rail { left: 6px; right: auto; }
}
