/* Hand-made changes to the rebuilt site. Loaded last on every page. */

/* The contact popup sat below the fixed header (z-index 9999), which could cover its close button
   once the popup grew taller, e.g. when the form notice appears. */
.book-demo-popup { z-index: 10000; }

/* On short screens (phones held sideways) the popup was taller than the screen, with the close and
   submit buttons out of reach. It now scrolls; when it fits it stays centred. */
.book-demo-popup { overflow-y: auto; overscroll-behavior: contain; align-items: flex-start; }
.book-demo-popup > .book-demo-container { margin-top: auto; margin-bottom: auto; flex-shrink: 0; }

/* The original brochure link is only transparent, so it could be clicked before filling the form.
   The download button added by js/form-guard.js replaces it. */
.brochure-link { display: none; }
.brochure-download { margin-bottom: 1rem; }
.foms-success-wrap .form-success-state .brochure-download + .demo-close { margin-top: 0; }

/* German program page: the hero text had a fixed 55rem width, which cut the heading off on tablets. */
.programs-hero-left { max-width: 100%; }
/* ...and its partner logo ran off the card on phones (seen in iPhone Safari). */
.program-heading-card .cw-uni-logo { max-width: 12rem; min-width: 0; height: auto; }
@media screen and (max-width: 479px) {
  .program-heading-card { flex-direction: column; align-items: flex-start; }
  .program-heading-card .cw-uni-logo { max-width: 9rem; }
}

/* iPhone Safari zooms the page when a field with text under 16px is tapped. */
@media (pointer: coarse) {
  input:not([type="submit"]):not([type="radio"]):not([type="checkbox"]),
  textarea,
  select { font-size: 16px !important; }
}
.book-demo-popup [role="dialog"]:focus { outline: none; }

/* ---- Thank-you message after a form (built by js/form-guard.js) ---- */
.cw-thanks-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--base-color-brand--yellow-neutral, #ffcd59);
  box-shadow: 0 0 0 .625rem rgba(255, 205, 89, .28);
  animation: cw-pop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
/* the Webflow embed wrapper adds invisible boxes that would push the tick off centre */
.cw-thanks-icon::before, .cw-thanks-icon::after { content: none; }
.cw-thanks-icon svg {
  width: 2.25rem;
  height: 2.25rem;
  fill: none;
  stroke: #222;
  stroke-width: 2.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cw-thanks-icon path { stroke-dasharray: 24; animation: cw-draw .45s .25s ease-out both; }

/* inside the popup */
.foms-success-wrap .form-success-state { gap: 1.5rem; }
.foms-success-wrap .form-success-headimg { font-family: var(--font--headings), sans-serif; }
.foms-success-wrap .form-success-subtext { color: #444; }

/* inline apply form: a cream card in place of the grey box */
.program-apply-form-wrap .w-form-done { background: transparent; padding: 0; }
.program-apply-form-wrap.cw-sent:not(.fixed-bottom) .program-form-apply { background: transparent; padding: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.cw-thanks {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2.75rem 1.5rem 2.25rem;
  border-radius: 1rem;
  background: #f7f2e6;
  color: #222;
  text-align: center;
  box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, .28);
  animation: cw-rise .4s ease-out both;
}
.cw-thanks-title { margin: 0 0 .25rem; color: #222; font-family: var(--font--headings), sans-serif; font-size: 2.25rem; line-height: 1.2; }
.cw-thanks-text { margin: 0; color: #444; font-size: 1.0625rem; line-height: 1.45; }
.cw-thanks-again {
  padding: .75rem 1.5rem;
  border: 1px solid rgba(34, 34, 34, .35);
  border-radius: 10rem;
  background: transparent;
  color: #222;
  font: 600 .75rem/1 var(--font--body-font, sans-serif);
  letter-spacing: .02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease;
}
.cw-thanks-again:hover { border-color: #ffcd59; background: #ffcd59; }
.cw-thanks-again:focus-visible { outline: 2px solid #222; outline-offset: 2px; }

/* the slim bar that stays at the bottom of the screen: one compact row */
.program-apply-form-wrap.fixed-bottom .cw-thanks { flex-direction: row; gap: 1.25rem; padding: 1rem 1.5rem; text-align: left; }
.program-apply-form-wrap.fixed-bottom .cw-thanks-icon { width: 3rem; height: 3rem; box-shadow: 0 0 0 .375rem rgba(255, 205, 89, .28); }
.program-apply-form-wrap.fixed-bottom .cw-thanks-icon svg { width: 1.5rem; height: 1.5rem; }
.program-apply-form-wrap.fixed-bottom .cw-thanks-title { font-size: 1.375rem; }
.program-apply-form-wrap.fixed-bottom .cw-thanks-text { font-size: .9375rem; }
.program-apply-form-wrap.fixed-bottom .cw-thanks-again { margin-left: auto; }

@keyframes cw-rise { from { opacity: 0; transform: translateY(.75rem); } to { opacity: 1; transform: none; } }
@keyframes cw-pop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }
@keyframes cw-draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .cw-thanks, .cw-thanks-icon, .cw-thanks-icon path { animation: none; } }

/* ---- Programs dropdown, in the site theme (cream panel, yellow accent) ---- */
.navbar .nav-dd:hover .nav-dd-toggle,
.navbar .nav-dd-toggle.w--open { color: var(--base-color-brand--yellow-neutral); }

.navbar .nav-dd-list.w--open {
  min-width: 20rem;
  max-width: 24rem;
  margin-top: .75rem;
  padding: .5rem;
  border: 1px solid rgba(34, 34, 34, .08);
  border-radius: 1rem;
  background-color: #f7f2e6;
  box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, .28), 0 .25rem .75rem rgba(0, 0, 0, .12);
  animation: cw-dropdown-in .18s ease-out;
}
/* covers the gap, so the menu stays open while the pointer travels down to it */
.navbar .nav-dd-list.w--open::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: .875rem; }

.navbar .nav-program-item + .nav-program-item { margin-top: .125rem; }
.navbar .navbar1_dropdown-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem .875rem;
  border-radius: .625rem;
  color: var(--base-color-neutral--neutral-darker);
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  transition: background-color .18s ease, color .18s ease;
}
.navbar .navbar1_dropdown-link::after {
  content: "\2192";
  flex: none;
  opacity: 0;
  transform: translateX(-.375rem);
  transition: opacity .18s ease, transform .18s ease;
}
.navbar .navbar1_dropdown-link:hover,
.navbar .navbar1_dropdown-link:focus-visible {
  background-color: var(--base-color-brand--yellow-neutral);
  color: var(--base-color-neutral--neutral-darker);
  outline: none;
}
.navbar .navbar1_dropdown-link:focus-visible { box-shadow: inset 0 0 0 2px var(--base-color-neutral--neutral-darker); }
.navbar .navbar1_dropdown-link:hover::after,
.navbar .navbar1_dropdown-link:focus-visible::after { opacity: 1; transform: none; }
.navbar .navbar1_dropdown-link.w--current { background-color: rgba(255, 205, 89, .38); color: var(--base-color-neutral--neutral-darker); }
.navbar .navbar1_dropdown-link.w--current:hover { background-color: var(--base-color-brand--yellow-neutral); }

@keyframes cw-dropdown-in { from { opacity: 0; transform: translateY(-.375rem); } to { opacity: 1; transform: none; } }

/* on short screens the open menu scrolls, so the last program stays reachable */
@media screen and (max-width: 991px) {
  .navbar .w-nav-overlay [data-nav-menu-open] {
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* a solid top edge instead of padding, so rows cannot scroll underneath the logo */
    padding-top: 0;
    border-top: 5rem solid var(--background-color--background-primary);
  }
}

/* inside the phone / tablet menu */
@media screen and (max-width: 991px) {
  .navbar .nav-dd:hover .nav-dd-toggle { color: var(--base-color-neutral--neutral-darker); }
  .navbar .nav-dd-toggle.w--open { color: var(--base-color-neutral--neutral-darker); }
  .navbar .nav-dd-list.w--open {
    min-width: 0;
    max-width: none;
    margin: .25rem 0 .75rem;
    padding: .375rem;
    border: 0;
    box-shadow: none;
  }
  .navbar .nav-dd-list.w--open::before { content: none; }
  .navbar .navbar1_dropdown-link { padding: .875rem; font-size: 1rem; }
  .navbar .navbar1_dropdown-link::after { opacity: .55; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .navbar .nav-dd-list.w--open { animation: none; } }

/* Keyboard focus on sliders (arrow keys, see js/overrides.js) and the popup close button. */
.splide:focus-visible { outline: 2px solid #ffcd59; outline-offset: 4px; border-radius: 8px; }
.splide { overscroll-behavior-x: contain; }
.tml-avatar-item:focus-visible,
.map-img-left:focus-visible,
.map-img-right:focus-visible { outline: 2px solid #ffcd59; outline-offset: 2px; }
.section-student-tml.avatars { overscroll-behavior-x: contain; }
.demo-close-icon:focus-visible { outline: 2px solid #ffcd59; outline-offset: 2px; border-radius: 50%; }
