/* Offcanvas menu of the menu theme tworow below 1466px (template: www.sw-bb.de):
   blue panel from the left, tabs for the 1st level, 2nd level as list, 3rd level opens with a toggle button */
.offcanvas {
  --offcanvas-width: 275px;
  --offcanvas-border: #004076;
  --offcanvas-light: #33a2ff;
  --offcanvas-duration: .4s;

  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 2001;
  width: var(--offcanvas-width);
  max-width: calc(100vw - var(--base-size-double));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--blue);
  box-shadow: 0 0 3px 1px rgba(128, 128, 128, .3);
  color: var(--white);
  font-family: var(--menu-font-family);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform var(--offcanvas-duration) ease-in-out, visibility 0s linear var(--offcanvas-duration);
}

.offcanvas-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, .4);
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s ease-in-out, visibility 0s linear .4s;
}

.offcanvas-open {
  overflow: hidden;
}

.offcanvas-open .offcanvas {
  transform: none;
  visibility: visible;
  transition: transform var(--offcanvas-duration) ease-in-out;
}

.offcanvas-open .offcanvas-overlay {
  opacity: 1;
  visibility: visible;
  transition: opacity .4s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  .offcanvas,
  .offcanvas-open .offcanvas,
  .offcanvas-overlay,
  .offcanvas-open .offcanvas-overlay {
    transition: none;
  }
}

.offcanvas ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* general.css adds a padding below every li */
.offcanvas-level2 li {
  padding-bottom: 0;
}

.offcanvas a {
  text-decoration: none;
}

/* links and buttons have "transition: all" in the general styles, this would also animate the inherited
   visibility, so they could not get the focus right after the panel is opened */
.offcanvas :is(a, button) {
  transition-property: color, background-color;
}

.offcanvas :is(a, button):focus-visible {
  outline: 2px solid var(--white);
  outline-offset: -2px;
}

/* close button */
.offcanvas-head {
  display: flex;
  justify-content: flex-end;
}

.offcanvas-close {
  width: var(--base-size-double);
  height: var(--base-size-double);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

/* tabs: 1st level */
.offcanvas-tabs {
  display: flex;
}

.offcanvas-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 21px 6px;
  border: 0;
  background: var(--white);
  color: #666;
  font-family: inherit;
  font-size: .7rem;
  line-height: 1.2;
  text-align: center;
  hyphens: auto;
  cursor: pointer;
}

.offcanvas-tab + .offcanvas-tab {
  border-left: 1px solid #d7d7d7;
}

.offcanvas-tab:hover {
  color: var(--blue);
}

.offcanvas-tab[aria-selected="true"] {
  background: var(--blue);
  color: var(--white);
  font-weight: 600;
}

/* 2nd level: link and toggle button side by side, the 3rd level below */
.offcanvas-level2 > li {
  display: grid;
  grid-template-columns: 1fr 45px;
  border-top: 1px solid var(--offcanvas-border);
}

.offcanvas-level2 > li:last-child {
  border-bottom: 1px solid var(--offcanvas-border);
}

.offcanvas-level2 > li > a {
  grid-column: 1 / -1;
  padding: 18px 10px;
  color: var(--white);
  font-size: .938rem;
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
}

.offcanvas-level2 > li:has(> .offcanvas-sub-toggle) > a {
  grid-column: 1;
}

.offcanvas-level2 > li > a:hover,
.offcanvas-level2 > li > a.current {
  color: var(--offcanvas-light);
}

.offcanvas-sub-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--offcanvas-border);
  background: var(--blue);
  color: var(--white);
  cursor: pointer;
}

.offcanvas-level2 > li.is-active > .offcanvas-sub-toggle {
  background: var(--offcanvas-light);
}

.offcanvas-sub-toggle:hover {
  background: var(--white);
  color: var(--offcanvas-light);
}

/* chevron, points up when the 3rd level is open */
.offcanvas-sub-toggle > span {
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s ease-in-out;
}

.offcanvas-sub-toggle[aria-expanded="true"] > span {
  margin-top: 5px;
  transform: rotate(-135deg);
}

/* 3rd and 4th level: slide open with max-height like contentCollapse.js (the height is set by
   offcanvas.js), visibility keeps the links of a closed list out of the tab order */
.offcanvas-sublist {
  grid-column: 1 / -1;
  max-height: 0;
  overflow: hidden;
  background: var(--white);
  visibility: hidden;
  transition: max-height var(--transition), visibility 0s linear .3s;
}

.offcanvas-sublist.is-open {
  visibility: visible;
  transition: max-height var(--transition);
}

/* open when the page is loaded (active page), no height from the script yet */
.offcanvas-sublist.is-open:not([style*="max-height"]) {
  max-height: none;
}

@media (prefers-reduced-motion: reduce) {
  .offcanvas-sublist,
  .offcanvas-sublist.is-open {
    transition: none;
  }
}

.offcanvas-sublist a {
  display: block;
  color: #333;
  font-size: .875rem;
  line-height: 24px;
}

.offcanvas-sublist a:hover,
.offcanvas-sublist a.current {
  color: var(--offcanvas-light);
}

.offcanvas-sublist a.current {
  font-weight: 500;
}

.offcanvas .offcanvas-sublist :is(a, button):focus-visible {
  outline-color: var(--blue);
}

/* 3rd level: white rows, link and toggle button side by side, the 4th level below */
.offcanvas-level3 > li {
  display: grid;
  grid-template-columns: 1fr 45px;
  border-top: 1px solid #a0b1bf;
}

.offcanvas-level3 > li > a {
  grid-column: 1 / -1;
  padding: 12px 45px 12px 10px;
}

.offcanvas-level3 > li:has(> .offcanvas-sub-toggle) > a {
  grid-column: 1;
  padding-right: 10px;
}

.offcanvas-level3 .offcanvas-sub-toggle,
.offcanvas-level3 > li.is-active > .offcanvas-sub-toggle {
  border-left: 0;
  background: var(--white);
  color: var(--blue);
}

.offcanvas-level3 .offcanvas-sub-toggle:hover {
  color: var(--offcanvas-light);
}

/* 4th level: indented links, the space above and below is inside the list, so scrollHeight contains it */
/* only when open, a closed list would keep a 1px line */
.offcanvas-level4.is-open {
  border-top: 1px solid #a0b1bf;
}

.offcanvas-level4 > li:first-child {
  padding-top: 5px;
}

.offcanvas-level4 > li:last-child {
  padding-bottom: 5px;
}

.offcanvas-level4 a {
  padding: 10px 20px;
}

/* 1st level pages without subpages (e.g. "Karriere") */
.offcanvas-meta {
  margin-top: 20px;
}

.offcanvas-meta li {
    padding-bottom: 0;
}

.offcanvas-meta a {
  display: block;
  padding: 10px 20px;
  color: var(--white);
  font-size: .75rem;
  text-transform: uppercase;
}

.offcanvas-meta a:hover,
.offcanvas-meta a.current {
  color: var(--offcanvas-light);
}

/* the desktop menu is shown from 1466px */
@media screen and (min-width: 1466px) {
  .offcanvas,
  .offcanvas-overlay {
    display: none;
  }
}
