/**
 * Homepage video banner ([mandp_hero_video], inc/hero-video.php).
 *
 * The banner is wider than the 16:9 film (21:9), and it also stops growing
 * before it would push the links below the fold, so the film is cropped top
 * and bottom. The crop sits a little above the middle so that the logo card
 * and the team's faces stay whole. On a phone the banner keeps the film's
 * own 16:9 shape.
 *
 * The links sit bottom left, stacked so they stay clear of the logo card's
 * tagline (centred, low down); the Call Us line joins them above once the
 * film has ended (.is-at-end), over the empty wall in the last frame. Their
 * left edge lines up with the logo that stays in the last frame: it starts
 * 7.5% of the way across the film, and the film always fills the banner's
 * width, so 7.5cqw of the banner puts them under it at any width. Their
 * sizes are in cqw too, so they grow and shrink with the film and keep the
 * same gap to the tagline. Below 1024px (tablets and phones) there is no room
 * beside the tagline: they move under the film and Call Us always shows.
 * Skip, Sound and
 * pause sit top right, away from the WhatsApp button fixed to the bottom
 * right of the window.
 *
 * Selectors carry an element name or a second class because the Elementor
 * kit styles every button and link on the site.
 */

.mandp-hero {
  --mandp-blue: var(--e-global-color-primary, #1155d6);
  --mandp-blue-dark: #0c3f9e;
  --mandp-green: var(--e-global-color-accent, #8ac829);
  position: relative;
  /* cqw units below are a share of the banner's width. */
  container-type: inline-size;
  font-family: var(--e-global-typography-primary-font-family, "Poppins"), "Helvetica Neue", Arial, sans-serif;
}

.mandp-hero__media {
  position: relative;
  overflow: hidden;
  /* A set width keeps max-height from narrowing the banner through the
     aspect ratio: the film is cropped instead. */
  width: 100%;
  aspect-ratio: 21 / 9;
  /* The header is about 200px tall on a laptop; leave some page below. */
  max-height: max(320px, calc(100vh - 280px));
  max-height: max(320px, calc(100svh - 280px));
  /* On short screens, keep enough of the film for the final logo at the
     top and the links under the logo card's "M" at the bottom. */
  min-height: 38cqw;
}

.mandp-hero__video,
.mandp-hero__still,
.mandp-hero__still img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
}

.mandp-hero__still {
  z-index: 1;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

.mandp-hero.is-started .mandp-hero__still {
  opacity: 0;
  visibility: hidden;
}

/* Call Us and the two links, on the film. */
.mandp-hero__links {
  position: absolute;
  z-index: 2;
  left: clamp(16px, 4vw, 56px);
  /* The left edge of the logo in the film's last frame. */
  left: 7.5cqw;
  bottom: clamp(16px, 3vw, 40px);
  /* Low enough that the links pass under the logo card's big "M". */
  bottom: clamp(10px, 1.1cqw, 20px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.mandp-hero__buttons {
  display: grid;
  gap: 10px;
  gap: clamp(6px, 0.6cqw, 10px);
}

.mandp-hero .mandp-hero__links a.mandp-hero__call {
  color: var(--mandp-blue);
  font-family: inherit;
  font-size: clamp(16px, 1.8vw, 30px);
  /* About as wide as the logo above it. */
  font-size: clamp(16px, 1.95cqw, 40px);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  /* A white edge, as on the film's own titles. */
  text-shadow:
    -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 2px 2px 0 #fff,
    0 -2px 0 #fff, 0 2px 0 #fff, -2px 0 0 #fff, 2px 0 0 #fff,
    0 3px 10px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0s linear 0.5s;
}

.mandp-hero.is-at-end .mandp-hero__links a.mandp-hero__call {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0s;
}

.mandp-hero .mandp-hero__links a.mandp-hero__call:hover {
  color: var(--mandp-blue-dark);
}

.mandp-hero .mandp-hero__links a.mandp-hero__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  padding: 0.8cqw 1.95cqw;
  border-radius: 3px;
  font-family: inherit;
  font-size: 15px;
  /* 15px on a 1366px laptop. */
  font-size: clamp(11px, 1.12cqw, 16px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.mandp-hero .mandp-hero__links a.mandp-hero__button--primary {
  background: var(--mandp-blue);
  color: #fff;
}

.mandp-hero .mandp-hero__links a.mandp-hero__button--light {
  background: #fff;
  color: var(--mandp-blue);
}

.mandp-hero .mandp-hero__links a.mandp-hero__button--primary:hover,
.mandp-hero .mandp-hero__links a.mandp-hero__button--light:hover {
  background: var(--mandp-blue-dark);
  color: #fff;
}

.mandp-hero .mandp-hero__links a:focus-visible {
  outline: 3px solid var(--mandp-green);
  outline-offset: 2px;
}

/* Skip, Sound and pause / play again, top right. */
.mandp-hero__controls {
  position: absolute;
  z-index: 2;
  top: clamp(12px, 2.5vw, 32px);
  right: clamp(12px, 3vw, 40px);
  display: flex;
  align-items: center;
  gap: 10px;
}

.mandp-hero .mandp-hero__controls button.mandp-hero__toggle,
.mandp-hero .mandp-hero__controls button.mandp-hero__sound,
.mandp-hero .mandp-hero__controls button.mandp-hero__skip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  background: rgba(10, 18, 32, 0.5);
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mandp-hero .mandp-hero__controls button.mandp-hero__toggle {
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 50%;
}

.mandp-hero .mandp-hero__controls button.mandp-hero__sound,
.mandp-hero .mandp-hero__controls button.mandp-hero__skip {
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mandp-hero .mandp-hero__controls button:hover,
.mandp-hero .mandp-hero__controls button:focus {
  background: rgba(10, 18, 32, 0.8);
  color: #fff;
}

.mandp-hero .mandp-hero__controls button:focus-visible {
  outline: 3px solid var(--mandp-green);
  outline-offset: 2px;
}

.mandp-hero .mandp-hero__controls button[hidden] {
  display: none;
}

.mandp-hero__icon,
.mandp-hero__sound-icon {
  display: flex;
}

.mandp-hero__icon--pause,
.mandp-hero__icon--replay,
.mandp-hero__toggle.is-playing .mandp-hero__icon--play,
.mandp-hero__toggle.is-ended .mandp-hero__icon--play,
.mandp-hero__sound-icon--on,
.mandp-hero__sound[aria-pressed="true"] .mandp-hero__sound-icon--off {
  display: none;
}

.mandp-hero__toggle.is-playing .mandp-hero__icon--pause,
.mandp-hero__toggle.is-ended .mandp-hero__icon--replay,
.mandp-hero__sound[aria-pressed="true"] .mandp-hero__sound-icon--on {
  display: flex;
}

/* Tablets and phones: the links go under the film, with Call Us always
   above them. */
@media (max-width: 1023px) {
  .mandp-hero__links {
    position: static;
    align-items: stretch;
    padding: 12px 0 4px;
    gap: 10px;
  }

  .mandp-hero .mandp-hero__links a.mandp-hero__call {
    align-self: center;
    font-size: 20px;
    text-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .mandp-hero__buttons {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mandp-hero .mandp-hero__links a.mandp-hero__button {
    padding: 13px 10px;
    font-size: 13px;
    text-align: center;
  }
}

/* Phones: the film keeps its own 16:9 shape and the controls get smaller. */
@media (max-width: 767px) {
  .mandp-hero__media {
    aspect-ratio: 16 / 9;
  }

  .mandp-hero__controls {
    top: 10px;
    right: 10px;
    gap: 8px;
  }

  .mandp-hero .mandp-hero__controls button.mandp-hero__toggle {
    width: 40px;
    height: 40px;
  }

  .mandp-hero .mandp-hero__controls button.mandp-hero__skip {
    height: 34px;
    padding: 0 12px;
    font-size: 11px;
  }

  /* Round, icon only: the word stays for screen readers. */
  .mandp-hero .mandp-hero__controls button.mandp-hero__sound {
    width: 40px;
    height: 40px;
    padding: 0;
  }

  .mandp-hero__sound-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mandp-hero__still,
  .mandp-hero .mandp-hero__links a,
  .mandp-hero .mandp-hero__controls button {
    transition: none;
  }

  .mandp-hero.is-at-end .mandp-hero__links a.mandp-hero__call {
    transition: none;
  }
}
