/* vertical-menu.css — the motion and states of the main menu (Q82) that components.generated.css does not hold: the
   generated rules are the measured resting states (closed, open, current); the slide of the overlay, the X of
   the burger and the open submenus are added here, with the values measured on the former site. Script:
   assets/js/vertical-menu.js; markup: inc/vertical-menu.php. Loads after components.css. */

/* open: the page stops scrolling and becomes a layer under the overlay (measured open state of html, body and
   .sm-pusher; the generated rules write it as «body.sm-open html/body», which never matches) */
html.sm-full-344,
html.sm-full-344 body {
  overflow: hidden;
}
html.sm-full-344 body > .sm-pusher {
  box-sizing: border-box;
  position: relative;
  z-index: 99;
  height: 100%;
  overflow: hidden;
}
html.sm-full-344 .sm-pusher > .sm-content {
  box-sizing: border-box;
  overflow: auto;
}
html.sm-full-344 .sm-content > .sm-content-inner {
  box-sizing: border-box;
  position: relative;
}

/* the page's shade (measured: hidden while closed, so it never takes the clicks; 0.2 black under the open overlay) */
body > .sm-pusher::after {
  visibility: hidden;
  transition: opacity 0.5s ease;
}
html.sm-full-344 body > .sm-pusher::after {
  visibility: visible;
}
body.sm-open-344 > .sm-pusher::after {
  opacity: 0.2;
}

/* overlay: shown while body.sm-effect-1 (the script adds it with sm-open), above the viewport until sm-open-344
   slides it in; the transition itself (transform .5s ease) is in the generated rule of [class^="sm-overlay-"] */
body.sm-effect-1 .sm-overlay-344 {
  display: block;
  transform: translateY(-100%);
}
body.sm-effect-1.sm-open-344 .sm-overlay-344 {
  transform: none;
}

/* the nav is centred in the window by an inline-block strut (measured: vertical-align middle) */
.sm-overlay-win::after {
  vertical-align: middle;
}

/* «stay safe» banner of the top: measured translateX(200%) of its own width, 166% up to 800px (the generated open
   state holds the 375px value only) */
body.sm-open nav[id^="off-menu_"] .covid-19-menu-wrapper {
  transform: translateX(200%);
}
@media (max-width: 800px) {
  body.sm-open nav[id^="off-menu_"] .covid-19-menu-wrapper {
    transform: translateX(166%);
  }
}

/* the data-text copies of the labels (opacity 0) take the size of their link */
body nav[id^="off-menu_"] dl[class] > dt[class] .inner .link a::before,
body nav[id^="off-menu_"] dl[class] > dt[class] .inner .link a::after {
  font-size: inherit;
  top: 0;
  bottom: 0;
}

/* burger: bars while the overlay slides, X once it has arrived (.sm-close), as on the live */
body.sm-open .sm-btn-344:not(.sm-close) .menu-icon3 > span:nth-child(1),
body.sm-open .sm-btn-344:not(.sm-close) .menu-icon3 > span:nth-child(3) {
  transform: none;
}
body.sm-open .sm-btn-344:not(.sm-close) .menu-icon3 > span:nth-child(2) {
  opacity: 1;
}
/* measured: rotate ±45° and a shift of 5.44px for the 21×2.8 bars (375px), 7.78px for the 30×4 bars (768px and up),
   i.e. translate(18.33% of the width, 137.5% of the height) */
body .sm-btn-344.sm-close .menu-icon3 > span:nth-child(1) {
  transform: rotate(45deg) translate(18.3333%, 137.5%);
}
body .sm-btn-344.sm-close .menu-icon3 > span:nth-child(2) {
  opacity: 0;
}
body .sm-btn-344.sm-close .menu-icon3 > span:nth-child(3) {
  transform: rotate(-45deg) translate(18.3333%, -137.5%);
}
@media screen and (orientation: portrait) and (min-width: 450px) and (max-width: 960px) {
  .menu-icon-cont.sm-btn-344.sm-close {
    margin: 15px 48px 0 0;
  }
}

/* open submenu (measured on the live; the generated rules have no state for it) */
body nav[id^="off-menu_"].sm-menu dl[class] > dt[class].parent.opened {
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
}
body nav[id^="off-menu_"].sm-tree dl[class] > [class].opened::before,
body nav[id^="off-menu_"].sm-tree dl[class] > [class].opened::after {
  background-position: right center;
  transform: rotate(90deg);
}
/* up to 1259px the submenu is shown at once at its full height (only its closing is animated) */
@media (max-width: 1259px) {
  nav[id^="off-menu_"] .parent.opened {
    height: auto !important;
    display: block !important;
  }
}
@media screen and (orientation: portrait) and (min-width: 450px) and (max-width: 960px) {
  body nav[id^="off-menu_"].sm-menu dl[class] > dd.level1.parent.opened {
    margin-left: 25px;
  }
}

/* Registration form pages (body .proengrafh without .kdap: /proeggrafes, /eggrafi-kdap): the generated rules hold the
   closed menu of those pages with an extra class (.proengrafh:not(.kdap) …, display none), which outweighs the open-state
   rules above and in components.generated.css, so the burger greyed the page and showed no menu (Gate 5, found by
   tools/qa/xbrowser-check.mjs; the live opens the same menu as on the other pages: nav 1366×560 at y 104). The open-state
   rules again, with the same weight as the form-page ones. */
body.sm-effect-1.proengrafh:not(.kdap) .sm-overlay-344 { display: block; }
body.sm-open.proengrafh:not(.kdap) nav[id^="off-menu_"] { margin-right: 0px; margin-left: 0px; display: inline-block; z-index: 99; vertical-align: middle; }
body.sm-open.proengrafh:not(.kdap) .menu-icon-cont[class*="sm-btn-"] { position: absolute; transform: none; }
body.sm-open.proengrafh:not(.kdap) .menu-icon3 > span:nth-child(1) { transform: matrix(0.707107, 0.707107, -0.707107, 0.707107, 0, 5.44472); }
body.sm-open.proengrafh:not(.kdap) .menu-icon3 > span:nth-child(2) { opacity: 0; }
body.sm-open.proengrafh:not(.kdap) .menu-icon3 > span:nth-child(3) { transform: matrix(0.707107, -0.707107, 0.707107, 0.707107, 0, -5.44472); }
body.sm-open.proengrafh:not(.kdap) nav[id^="off-menu_"] .sm-levels,
body.sm-open.proengrafh:not(.kdap) nav[id^="off-menu_"] .sm-level.level1,
body.sm-open.proengrafh:not(.kdap) nav[id^="off-menu_"] dl.level1,
body.sm-open.proengrafh:not(.kdap) nav[id^="off-menu_"] .sm-levels > div.sm-level.level2 { max-height: 844px; }
/* … and the «stay safe» banner of the open menu sits at 4% from the top above 800px, as on the other pages (measured on
   the live /proeggrafes at 1366: top 30.7px; the form-page rule «top: auto» held it 73px lower) */
@media (min-width: 801px) {
  .proengrafh:not(.kdap) nav[id^="off-menu_"] .covid-19-menu-wrapper { top: 4%; }
}
