.dmvh-home-hero .dmvh-hero-block {
  -webkit-mask: url("masks/home-hero.svg?v=3") center / 100% 100% no-repeat;
  mask: url("masks/home-hero.svg?v=3") center / 100% 100% no-repeat;
}

.dmvh-page-hero .dmvh-hero-block {
  -webkit-mask: url("masks/page-hero.svg?v=3") center / 100% 100% no-repeat;
  mask: url("masks/page-hero.svg?v=3") center / 100% 100% no-repeat;
}

.dmvh-theme:has(.dmvh-cta-module-inspiration) .dmvh-page-main,
.dmvh-theme:has(.dmvh-cta-module-inspiration) .dmvh-feature {
  position: relative;
  z-index: 1;
}

@media (max-width: 800px) {
  .dmvh-home-hero .dmvh-hero-block {
    -webkit-mask: url("masks/home-hero-mobile.svg?v=1") center / 100% 100% no-repeat;
    mask: url("masks/home-hero-mobile.svg?v=1") center / 100% 100% no-repeat;
  }

  .dmvh-hero:has(.dmvh-hero-height-compact) { height: 320px; min-height: 320px; }
  .dmvh-hero:has(.dmvh-hero-height-medium) { height: 400px; min-height: 400px; }
  .dmvh-hero:has(.dmvh-hero-height-tall) { height: 700px; min-height: 700px; }
  .dmvh-hero:has(.dmvh-hero-height-full) { height: 100vh; min-height: 100vh; }

  /* Image-only heroes follow the available width rather than desktop heights.
     Keep explicitly custom/full-screen heights and heroes containing copy intact. */
  .dmvh-hero:has(.dmvh-hero-module):not(:has(.dmvh-hero-copy, .dmvh-hero-height-custom, .dmvh-hero-height-full)) {
    height: auto;
    min-height: 0;
    aspect-ratio: var(--dmvh-mobile-hero-ratio, 3 / 2);
  }
  .dmvh-hero:has(.dmvh-hero-height-compact) { --dmvh-mobile-hero-ratio: 16 / 9; }
  .dmvh-hero:has(.dmvh-hero-height-medium) { --dmvh-mobile-hero-ratio: 3 / 2; }
  .dmvh-hero:has(.dmvh-hero-height-tall) { --dmvh-mobile-hero-ratio: 4 / 3; }

  .dmvh-hero .dmvh-hero-module:not(:has(.dmvh-hero-copy), .dmvh-hero-height-custom, .dmvh-hero-height-full) {
    min-height: 0;
  }

  /* Scale overlaps too, so the following heading stays below the shorter image. */
  .dmvh-hero:has(.dmvh-hero-module):not(:has(.dmvh-hero-copy, .dmvh-hero-height-custom, .dmvh-hero-height-full)):has(.dmvh-hero-overlap-overlap-sm) { margin-bottom: -20px !important; }
  .dmvh-hero:has(.dmvh-hero-module):not(:has(.dmvh-hero-copy, .dmvh-hero-height-custom, .dmvh-hero-height-full)):has(.dmvh-hero-overlap-overlap-md) { margin-bottom: -40px !important; }
  .dmvh-hero:has(.dmvh-hero-module):not(:has(.dmvh-hero-copy, .dmvh-hero-height-custom, .dmvh-hero-height-full)):has(.dmvh-hero-overlap-overlap-lg) { margin-bottom: -60px !important; }
  .dmvh-hero-mask-home {
    -webkit-mask: url("masks/home-hero-mobile.svg?v=1") center / 100% 100% no-repeat !important;
    mask: url("masks/home-hero-mobile.svg?v=1") center / 100% 100% no-repeat !important;
  }

  .dmvh-side-pane,
  .dmvh-main-pane {
    min-width: 0;
  }

  .dmvh-navigation .navbar-toggler-icon {
    background:
      linear-gradient(currentColor 0 0) top / 100% 2px no-repeat,
      linear-gradient(currentColor 0 0) center / 100% 2px no-repeat,
      linear-gradient(currentColor 0 0) bottom / 100% 2px no-repeat;
  }

  .dmvh-navigation .app-menu {
    position: static;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  /* Keep the panel out of header layout throughout Bootstrap's collapse transition. */
  .dmvh-navigation .navbar-collapse {
    position: absolute;
    top: var(--dmvh-header-mobile-dropdown-top, 78px);
    right: 0;
    left: 0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
    max-height: calc(100dvh - 130px);
    overflow: hidden;
  }

  .dmvh-navigation .navbar-collapse.show {
    overflow-y: auto;
  }

  /* Padding on the animated element would prevent it shrinking all the way to zero. */
  .dmvh-navigation .navbar-collapse > .navbar-nav {
    padding: 12px 22px 22px;
  }

  .dmvh-navigation .dmvh-nav-item-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .dmvh-navigation .dmvh-dropdown-toggle {
    flex: 0 0 48px;
    width: 48px;
    min-height: 48px;
    padding: 12px;
    margin-left: 0;
    border-left: 1px solid #e5edf3;
    border-radius: 6px;
    touch-action: manipulation;
  }

  .dmvh-navigation .dmvh-nav-item-wrapper > a {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .dmvh-navigation .navbar-nav {
    align-items: stretch;
    width: 100%;
  }

  .dmvh-navigation .dmvh-dropdown-toggle:focus-visible {
    outline: 2px solid var(--dmvh-blue);
    outline-offset: 2px;
  }

  .dmvh-navigation .dropdown-menu {
    display: none;
    position: static;
    float: none;
    width: 100%;
    margin: 0;
    padding: 0 0 8px 18px;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .dmvh-navigation .dmvh-submenu.show,
  .dmvh-navigation .dmvh-submenu.collapsing {
    display: block;
  }

  .dmvh-navigation .dropdown-item {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--dmvh-ink);
    text-decoration: none;
    border-radius: 4px;
    min-height: 44px;
    white-space: normal;
  }

  .dmvh-navigation .dropdown-item:hover,
  .dmvh-navigation .dropdown-item:focus,
  .dmvh-navigation .dropdown-item.active {
    background: rgba(41, 61, 91, 0.06);
    color: var(--dmvh-blue);
    text-decoration: none;
  }
}

.dmvh-navigation .dmvh-dropdown-toggle[aria-expanded="true"] .dmvh-dropdown-icon {
  transform: rotate(180deg);
}

@media (max-width: 800px) {
  .dmvh-navigation .nav-item.dropdown:hover .dmvh-dropdown-toggle[aria-expanded="false"] .dmvh-dropdown-icon {
    transform: none;
  }
  .dmvh-navigation .dmvh-dropdown-toggle[aria-expanded="true"] .dmvh-dropdown-icon {
    transform: rotate(180deg);
  }
}

@media (min-width: 801px) {
  .dmvh-navigation .dmvh-navbar-expand .navbar-collapse {
    display: flex !important;
    /* Bootstrap's navbar-nav-scroll must only constrain the mobile menu. */
    max-height: none;
    overflow: visible;
  }
  .dmvh-navigation .dmvh-navbar-expand .navbar-nav { flex-direction: row; }
  .dmvh-navigation .dropdown-submenu { position: relative; }
  .dmvh-navigation .dropdown-submenu > .dropdown-menu { top: 0; left: 100%; }
  .dmvh-navigation .dropdown-submenu:hover > .dropdown-menu,
  .dmvh-navigation .dropdown-submenu:focus-within > .dropdown-menu,
  .dmvh-navigation .dmvh-submenu.show { display: block; }
}
