/* Mobile navigation (template-parts/header/mobile-nav.php, js/mobile-nav.js), up to 1000px.
   Same look as the Mobile Menu plugin it replaces: a light blue panel sliding in from the right
   over 85% of the screen, white Cera items, navy close button and open parent. */
.mobile-nav__toggle,
.mobile-nav,
.mobile-nav__backdrop {
  display: none;
}

@media screen and (max-width: 1000px) {
  .mobile-nav__toggle {
    position: fixed;
    top: 0;
    left: 90%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 39px;
    height: 56px;
    padding: 0;
    border: 0;
    background: none;
    color: #64bed2;
    cursor: pointer;
  }

  .mobile-nav__toggle svg {
    fill: currentColor;
    transition: transform 0.2s ease-out;
  }

  /* The theme's generic button hover (white text) must not reach these buttons: on white pages it
     made the menu button disappear. Colours stay put; a mouse hover only scales the icon a bit. */
  button.mobile-nav__toggle:is(:hover, :focus, :active) {
    background: none;
    color: #64bed2;
  }

  button.mobile-nav__close:is(:hover, :focus, :active) {
    background: none;
    color: #1f3764;
  }

  button.mobile-nav__sub-toggle:is(:hover, :focus, :active) {
    background: none;
    color: #fff;
  }

  .mobile-nav__close {
    transition: transform 0.2s ease-out;
  }

  @media (hover: hover) {
    .mobile-nav__toggle:hover svg,
    .mobile-nav__close:hover {
      transform: scale(1.12);
    }
  }

  .mobile-nav__backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: block;
    background: rgba(15, 27, 50, 0);
    transition: background-color 0.5s;
  }

  .mobile-nav-open .mobile-nav__backdrop {
    background: rgba(15, 27, 50, 0.35);
  }

  .mobile-nav:not([hidden]) {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1002;
    display: block;
    width: 85%;
    padding: 55px 0 40px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #64bed2;
    color: #fff;
    transform: translateX(100%);
    transition: transform 0.5s;
  }

  .mobile-nav-open .mobile-nav {
    transform: none;
  }

  .mobile-nav-open,
  .mobile-nav-open body {
    overflow: hidden;
  }

  .mobile-nav__close {
    position: absolute;
    top: 0;
    right: 0;
    width: 72px;
    height: 65px;
    padding: 15px;
    border: 0;
    background: none;
    color: #1f3764;
    font: 400 44px/1 Inter, sans-serif;
    cursor: pointer;
  }

  .mobile-nav__menu,
  .mobile-nav__menu .sub-menu {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .mobile-nav__menu > li {
    position: relative;
  }

  .mobile-nav__menu a {
    display: block;
    padding: 10px 20px;
    color: #fff;
    font: 400 32px/48px CeraStencilPro-Light, Arial, sans-serif;
    text-decoration: none;
  }

  .mobile-nav__menu > li.menu-item-has-children > a {
    padding-right: 72px;
  }

  .mobile-nav__menu a:hover,
  .mobile-nav__menu a:focus-visible {
    background: #1f3764;
  }

  .mobile-nav__menu .sub-menu {
    display: none;
  }

  .mobile-nav__menu > li.is-open {
    background: #1f3764;
  }

  .mobile-nav__menu > li.is-open > .sub-menu {
    display: block;
  }

  .mobile-nav__menu .sub-menu a {
    padding-left: 15%;
    font-size: 16px;
    line-height: 24px;
  }

  /* Caret like the plugin's, as an SVG mask (same shape as the desktop menu caret). */
  .mobile-nav__sub-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 72px;
    height: 68px;
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    cursor: pointer;
  }

  .mobile-nav__sub-toggle::before {
    content: "";
    display: inline-block;
    width: 12.5px;
    height: 20px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z'/%3E%3C/svg%3E") center/contain no-repeat;
  }

  .mobile-nav__sub-toggle[aria-expanded="true"]::before {
    transform: rotate(180deg);
  }

  .mobile-nav button:focus-visible,
  .mobile-nav__toggle:focus-visible {
    outline: 2px solid #1f3764;
    outline-offset: -4px;
  }

  /* Language switcher: "PL / ENG" in one line under the menu. */
  .mobile-nav__menu > li.lang-item {
    display: inline-block;
    margin-top: 50px;
  }

  .mobile-nav__menu > li.lang-item a {
    display: inline-block;
  }
}

@media screen and (max-width: 680px) {
  .mobile-nav__menu a {
    font-size: 22px;
    line-height: 33px;
  }

  .mobile-nav__sub-toggle {
    height: 53px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav__toggle svg,
  .mobile-nav__close,
  .mobile-nav:not([hidden]),
  .mobile-nav__backdrop:not([hidden]) {
    transition: none;
  }
}
