/* Accessibility layer on top of the Webflow export. Loaded after the Webflow stylesheet. */

/* Visually hidden, still read by screen readers. */
.a11y-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link: hidden until it receives keyboard focus. */
.a11y-skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000000;
  padding: 12px 18px;
  background: #10131b;
  color: #fff;
  font-family: Raleway, sans-serif;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
  transform: translateY(-200%);
}
.a11y-skip:focus {
  transform: none;
}

/* 404 heading keeps the look of the original h2. */
h1.a11y-h {
  font-size: 32px;
  line-height: 36px;
  margin-top: 20px;
  margin-bottom: 10px;
}

/* Visible keyboard focus on any background: dark ring with a white halo. */
:focus-visible {
  outline: 3px solid #10131b !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 3px #fff !important;
}
main:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* Text contrast (WCAG 1.4.3, 4.5:1). Shades are the closest passing values to the brand colours. */
.project-card-justeat,
.casestudy-hero.justeat,
.case-content.justeat,
.case-role-content.justeat,
.break.white.justeat {
  background-color: #177f97;
}
.case-role-tag.invert {
  color: #16748a;
}
.footer.case.public {
  background-color: #cd4909;
}
.footer.case.userfeel {
  background-color: #d9382a;
}

/* Pause/play control for the hero carousel (WCAG 2.2.2). */
.a11y-pause {
  position: fixed;
  left: 40px;
  bottom: 40px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 19, 27, 0.75);
  color: #fff;
  cursor: pointer;
}
.a11y-pause[hidden] {
  display: none;
}
.a11y-pause:hover {
  background: rgba(16, 19, 27, 0.95);
}
.a11y-pause svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

@media screen and (max-width: 479px) {
  /* Keep the pause button and scroll hint above the fixed "Let's talk" bar. */
  .a11y-pause {
    left: 20px;
    bottom: 76px;
  }
  .hero-mouse {
    bottom: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
}

/* Intro "read more" preview is a control. */
.text-intro-hidden-container[role="button"] {
  cursor: pointer;
}
.text-intro-open:focus {
  outline: none;
}

/* Intro block: a little wider on desktop (was 60%). */
@media screen and (min-width: 992px) {
  .intro-paragraph,
  .intro-photo,
  .intro-cta,
  .text-intro-open,
  .text-intro-hidden-container {
    width: 68%;
  }
}

/* Links inside the intro text. */
.intro-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Contact popup: one card that is clipped to the bar when closed and grows into the full card.
   The card header ("Let's talk!" and the arrow button) is the same element in both states:
   it slides from the bar to the top of the card, changes colour, and the arrow flips.
   a11y.js toggles .is-open on the holder and sets --bar, --box-inset and --hdr-shift. */
.contact-box-holder.a11y-morph {
  --morph: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.contact-box-holder.a11y-morph .contact-box-opened-state {
  display: block !important;
  position: absolute;
  left: var(--box-inset, 0px);
  right: var(--box-inset, 0px);
  bottom: 0;
  z-index: 11;
  width: auto;
  margin: 0;
  background-color: var(--brand);
  border-color: var(--brand);
  height: var(--bar, 56px);
  overflow: hidden;
  transition: height var(--morph), background-color var(--morph);
}
.contact-box-holder.a11y-morph.is-open .contact-box-opened-state {
  background-color: var(--white);
  height: var(--full, auto);
}
/* Shared header */
.contact-box-holder.a11y-morph .contact-box-header {
  position: relative;
  z-index: 2;
  transform: translateY(var(--hdr-shift, 0px));
  color: var(--white);
  transition: transform var(--morph), color var(--morph);
}
.contact-box-holder.a11y-morph.is-open .contact-box-header {
  transform: none;
  color: var(--brand);
}
.contact-box-holder.a11y-morph .contact-box-close {
  transform: rotate(180deg);
  transition: transform var(--morph), background-color 0.2s linear;
}
.contact-box-holder.a11y-morph.is-open .contact-box-close {
  transform: none;
}
/* Body content appears once the card has mostly grown */
.contact-box-holder.a11y-morph .contact-box-text,
.contact-box-holder.a11y-morph .contact-box-opened-state .letstalk {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, visibility 0s linear 0.12s;
}
.contact-box-holder.a11y-morph.is-open .contact-box-text,
.contact-box-holder.a11y-morph.is-open .contact-box-opened-state .letstalk {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease 0.15s, visibility 0s;
}
/* The original bar stays as the click target for the closed state, drawn by the card instead */
.contact-box-holder.a11y-morph .contact-box-closed-state {
  position: relative;
  z-index: 12;
  background-color: transparent !important;
  border-color: transparent !important;
}
.contact-box-holder.a11y-morph .contact-box-closed-state .contact-box-header-closed {
  opacity: 0; /* drawn by the card header; kept for the button's accessible name */
}
.contact-box-holder.a11y-morph.is-open .contact-box-closed-state {
  pointer-events: none;
}
/* Hover on the closed bar: same inversion as before */
.contact-box-holder.a11y-morph:not(.is-open):has(.contact-box-closed-state:hover) .contact-box-opened-state {
  background-color: var(--white);
}
.contact-box-holder.a11y-morph:not(.is-open):has(.contact-box-closed-state:hover) .contact-box-header {
  color: var(--brand);
}

@media (prefers-reduced-motion: reduce) {
  .contact-box-holder.a11y-morph {
    --morph: 0.01s linear;
  }
}

/* Home: project showcases take the height of their content instead of a full screen,
   with the same gap between each of them. */
@media screen and (min-width: 768px) {
  .project-section-hsbcmx,
  .project-section-hsbccm,
  .project-section-justeat {
    height: auto;
  }
  .project-section-container + .break,
  .break.beforelast {
    height: 100px;
  }
}
