/* ==========================================================
   SITE MENU
   The "header" template part is the menu: the brand, the "menü" button, and the panel they open,
   with the Navigation block in it. How it all looks — colours, fonts, spacing, the panel's width
   at each screen size, the current page in yellow — is Von Block's, on those blocks, and is edited
   in the Site Editor. inc/site-header.php prints the part once on every page, in a layer of its
   own that covers the window. This file is how it sits there and how it opens (only there: in the
   Site Editor the part is shown as it is, open); script.js opens and closes it.
   ========================================================== */

/* ---- What sits inside the header's blocks (moved from their custom styles, 2026-10-17) ---- */

/* the "menü" and "zurück" buttons: a word and an 18px dot, no button look */
:is(.kloos-menu-trigger, .kloos-menu-close) .wp-block-button .wp-block-button__link { display: inline-flex; align-items: center; justify-content: center; gap: 14px; background: transparent; border: 0; border-radius: 0; box-shadow: none; cursor: pointer; }
:is(.kloos-menu-trigger, .kloos-menu-close) .wp-block-button .wp-block-button__link::after { content: ""; flex-grow: 0; flex-shrink: 0; flex-basis: 18px; width: 18px; height: 18px; border-radius: 50%; background: currentColor; }
:is(.kloos-menu-trigger, .kloos-menu-close) .wp-block-button .wp-block-button__link:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.kloos-menu-trigger .wp-block-button .wp-block-button__link { padding: 20px 26px; }
@container (max-width: 768px) { .kloos-menu-trigger .wp-block-button .wp-block-button__link { padding: 16px 20px; } }
.kloos-menu-close .wp-block-button .wp-block-button__link { color: inherit; padding: 0; }

/* the navigation */
.kloos-site-menu .kloos-menu-nav .wp-block-navigation__container { gap: 1px; }
.kloos-site-menu .kloos-menu-nav .wp-block-navigation__container > .has-child { flex-wrap: wrap; }
.kloos-site-menu .kloos-menu-nav .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content { padding: 1px 0; }
.kloos-site-menu .kloos-menu-nav .current-menu-item > .wp-block-navigation-item__content { color: var(--mcg-color-accent); }
.kloos-site-menu .kloos-menu-nav .current-menu-ancestor > .wp-block-navigation-item__content { color: var(--mcg-color-accent); }
.kloos-site-menu .kloos-menu-nav .current-menu-ancestor > .wp-block-navigation__submenu-icon { color: var(--mcg-color-accent); }
.kloos-site-menu .kloos-menu-nav .has-child > .wp-block-navigation__submenu-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; }
.kloos-site-menu .kloos-menu-nav .open-on-click > .wp-block-navigation-item__content + .wp-block-navigation__submenu-icon { margin: 0 0 0 5px; }
.kloos-site-menu .kloos-menu-nav .has-child > .wp-block-navigation__submenu-icon svg { display: none; }
.kloos-site-menu .kloos-menu-nav .has-child > .wp-block-navigation__submenu-icon::before { content: ""; display: block; width: 9px; height: 9px; margin-top: -5px; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: rotate(45deg); transition: transform 260ms ease, margin 260ms ease; }
.kloos-site-menu .kloos-menu-nav .has-child.is-submenu-open > .wp-block-navigation__submenu-icon::before { margin-top: 5px; transform: rotate(225deg); }
.kloos-site-menu .kloos-menu-nav .has-child .wp-block-navigation__submenu-container { display: block; padding: 0 0 0 28px; list-style: disc outside; }
.kloos-site-menu .kloos-menu-nav .has-child.is-submenu-open > .wp-block-navigation__submenu-container { margin: 4px 0 8px; }
/* a submenu item: a list item (its type: the typography style menu-sub on the link block) */
.kloos-site-menu .kloos-menu-nav .wp-block-navigation__submenu-container > .wp-block-navigation-item { display: list-item; list-style: inherit; margin: 0 0 4px; padding: 0 0 0 4px; }
.kloos-site-menu .kloos-menu-nav .wp-block-navigation__submenu-container > .wp-block-navigation-item::marker { font-size: 11.5px; }
.kloos-site-menu .kloos-menu-nav .wp-block-navigation__submenu-container > .wp-block-navigation-item.current-menu-item { color: var(--mcg-color-accent); }
/* (.has-child twice: over the Navigation block's own padding/size for submenu links) */
.kloos-site-menu .kloos-menu-nav .has-child.has-child > * > .wp-block-navigation-item > .wp-block-navigation-item__content { display: inline-block; padding: 2px 0; font-size: inherit; line-height: inherit; }
.kloos-site-menu .kloos-menu-nav a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.kloos-site-menu .kloos-menu-nav button:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
@container (max-width: 768px) { .kloos-site-menu .kloos-menu-nav .has-child .wp-block-navigation__submenu-container { padding-left: 30px; } }

/* ---- */

/* The window, minus the admin bar when logged in. A Von Block container, so the blocks inside
   find their screen sizes against it; the page itself is not in it, so nothing here is held in
   the page's box. Two classes: over the framework's own container width. */
.vonblock-container.kloos-site-menu-layer {
  position: fixed;
  inset: var(--wp-admin--admin-bar--height, 0px) 0 0;
  z-index: 999999;
  max-width: none;
  margin: 0;
  pointer-events: none;
}

.kloos-site-menu-layer > .kloos-site-menu {
  margin: 0;
}

.kloos-site-menu-layer .kloos-global-brand,
.kloos-site-menu-layer .kloos-menu-trigger {
  position: absolute;
  z-index: 2;
  margin: 0;
  pointer-events: auto;
}

/* Where the brand sits is its own (a custom style), the button sits in the corner */
.kloos-site-menu-layer .kloos-global-brand {
  transition: color 220ms ease;
}

.kloos-site-menu-layer .kloos-menu-trigger {
  top: 0;
  right: 0;
}

body.kloos-menu-open .kloos-site-menu-layer .kloos-global-brand {
  color: var(--mcg-color-text-on-dark);
}

body.kloos-menu-open .kloos-site-menu-layer .kloos-menu-trigger {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ----------------------------------------------------------
   The panel slides in from the right over a dimmed page
   ---------------------------------------------------------- */
.kloos-site-menu-layer .kloos-menu-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 360ms cubic-bezier(.22, .61, .36, 1), visibility 360ms cubic-bezier(.22, .61, .36, 1);
}

.kloos-site-menu-layer .kloos-menu-overlay[hidden] {
  display: none;
}

.kloos-site-menu-layer .kloos-menu-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.kloos-site-menu-layer .kloos-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  /* No wider than the window without its scrollbar: on phones the panel is 100vw (Von Block
     kloos-menu-panel), which counts a classic scrollbar too (desktop browsers made narrow, Windows),
     so it reached 15px past the left edge and its left padding all but vanished */
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  transition: transform 360ms cubic-bezier(.22, .61, .36, 1);
}

.kloos-site-menu-layer .kloos-menu-overlay.is-open .kloos-menu-panel {
  transform: translateX(0);
}

body.kloos-menu-open {
  overflow: hidden;
  touch-action: none;
}

/* ----------------------------------------------------------
   Submenus open in place, smoothly, rather than as core's dropdowns; script.js sets
   .is-submenu-open and --kloos-submenu-height
   ---------------------------------------------------------- */
/* The second selector is over core's rules for an open submenu, which let it overflow */
.kloos-site-menu-layer .kloos-menu-nav .has-child .wp-block-navigation__submenu-container,
.kloos-site-menu-layer .kloos-menu-nav .has-child > [aria-expanded] ~ .wp-block-navigation__submenu-container {
  position: static;
  width: 100%;
  min-width: 0;
  height: auto;
  max-height: 0;
  overflow: hidden;
  visibility: visible;
  opacity: 0;
  border: 0;
  background: none;
  transition:
    max-height 340ms cubic-bezier(.22, .61, .36, 1),
    opacity 220ms ease,
    margin 340ms cubic-bezier(.22, .61, .36, 1);
}

/* The submenus take the menu's own colour (its Von Block colour class). Core paints them black
   when the Navigation block has no WordPress text colour (.wp-block-navigation:not(.has-text-color)
   .wp-block-navigation__submenu-container), so this is one class more specific than that */
.kloos-site-menu-layer .kloos-menu-nav.wp-block-navigation .has-child .wp-block-navigation__submenu-container {
  color: inherit;
}

.kloos-site-menu-layer .kloos-menu-nav .has-child.is-submenu-open > .wp-block-navigation__submenu-container {
  max-height: var(--kloos-submenu-height, 600px);
  opacity: 1;
}

/* The chevron is a button of its own here (core's lets clicks through) */
.kloos-site-menu-layer .kloos-menu-nav .has-child.open-on-click > .wp-block-navigation-submenu__toggle + .wp-block-navigation__submenu-icon {
  pointer-events: auto;
  cursor: pointer;
}

/* ----------------------------------------------------------
   The "menü" button's label and dot in white where the page behind the button is dark: a white
   copy on top, which script.js masks to the dark parts (a gradient, band by band)
   ---------------------------------------------------------- */
.kloos-site-menu-layer .kloos-menu-trigger .wp-block-button__link {
  position: relative;
  isolation: isolate;
}

.kloos-menu-trigger__contrast {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: inherit;
  box-sizing: border-box;
  padding: inherit;
  color: var(--mcg-color-text-on-dark);
  pointer-events: none;
  user-select: none;
  mask-repeat: no-repeat;
  mask-position: 0 0;
  mask-size: 100% 100%;
}

/* The brand the same way: a white copy of ".kloos" over its link, masked by script.js to the parts with
   something dark behind (a dark section, a photo). Open, the menu turns the brand white itself. */
.kloos-site-menu-layer .kloos-global-brand a {
  position: relative;
}

.kloos-global-brand__contrast {
  position: absolute;
  inset: 0;
  color: var(--mcg-color-text-on-dark);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

/* The brand is the .kloos logo (assets/icons/kloos-logo.svg, the Figma rebrush's own), 79×21 as there. The
   word ".kloos" stays the link's text — its name for a screen reader — but is not drawn: the logo is a
   ::before filled with the link's colour through the logo as a mask, so it turns white as the word did
   (the white copy has the same ::before; the open menu turns the link white). On ::before rather than
   on the link, so the link's focus ring is not masked away. */
.kloos-site-menu .kloos-global-brand a {
  display: block;
  color: inherit;
  text-decoration: none;
  width: 79px;
  height: 21px;
  font-size: 0;
  line-height: 0;
}

.kloos-site-menu .kloos-global-brand a::before,
.kloos-global-brand__contrast::before {
  content: "";
  display: block;
  width: 79px;
  height: 21px;
  background-color: currentColor;
  mask: url("../../assets/icons/kloos-logo.svg") no-repeat 0 0 / contain;
}

body.kloos-menu-open .kloos-global-brand__contrast {
  display: none;
}

/* The same dot as the button's own (its ::after), at the same size for the same type */
.kloos-menu-trigger__contrast::after {
  content: "";
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: .72em;
  width: .72em;
  height: .72em;
  border-radius: 50%;
  background: currentColor;
}

/* ----------------------------------------------------------
   Scrolled (script.js puts .kloos-scrolled on the body once the page has moved): the word "menü"
   folds away and the circle is left on its own. The word stays the button's name for a screen
   reader (font-size 0 hides it from the eye only). Over dark sections the white copy turns the
   circle white, as it does the word and the circle at rest (script.js masks it to the dark parts
   with a gradient). The circle keeps its distance from the right: the pill's padding plus its offset from the
   corner is the button's own padding at rest (26px, 20px from sm). On a wide screen the pill rises a
   little closer to the top (14px) than the circle sat.
   ---------------------------------------------------------- */
.kloos-site-menu-layer .kloos-menu-trigger .wp-block-button__link {
  transition: background-color 200ms ease, padding 200ms ease, margin 200ms ease, gap 200ms ease, font-size 150ms ease;
}

body.kloos-scrolled .kloos-site-menu-layer .kloos-menu-trigger .wp-block-button__link {
  font-size: 0;
  line-height: 0;
  gap: 0;
  padding: 9px 12px;
  margin: 14px 14px 0 0;
  border-radius: 9999px;
  color: var(--mcg-color-text-main);
}

/* The white copy follows: the word gone (its font-size is the button's, 0), the circle at the end,
   where the button's own is, and at its 18px rather than .72em of nothing */
body.kloos-scrolled .kloos-site-menu-layer .kloos-menu-trigger .kloos-menu-trigger__contrast {
  justify-content: flex-end;
}

body.kloos-scrolled .kloos-site-menu-layer .kloos-menu-trigger .kloos-menu-trigger__contrast::after {
  flex-basis: 18px;
  width: 18px;
  height: 18px;
}

@container (max-width: 768px) {
  body.kloos-scrolled .kloos-site-menu-layer .kloos-menu-trigger .wp-block-button__link {
    margin: 17px 8px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kloos-site-menu-layer .kloos-menu-trigger .wp-block-button__link {
    transition: none;
  }

  .kloos-site-menu-layer .kloos-menu-overlay,
  .kloos-site-menu-layer .kloos-menu-panel,
  .kloos-site-menu-layer .kloos-menu-nav .has-child .wp-block-navigation__submenu-container {
    transition-duration: 1ms;
  }
}

/* ---- The language switcher (was the Global CSS entry "language-switcher") ---- */

/* The WPML language switcher at the bottom left of the menu panel (group kloos-menu-panel-bottom,
   after the navigation; it was at the top until 2026-11-03, where the .kloos logo covered it on
   phones): pushed down to the panel's end, as wide as it needs (WPML makes it 100% !important) and
   in the menu's type, white. Here and not classes on the block: WPML's block leaves out the classes
   it is given */
.kloos-menu-panel-bottom {
  margin-top: auto;
  padding-top: 40px;
}
.kloos-menu-panel-bottom .wpml-language-switcher-block {
  width: auto !important;
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: auto;
  min-height: 42px;
  align-items: center;
  font-family: inherit;
  font-size: var(--mcg-font-size-menu-toggle);
  font-weight: 700;
  line-height: 150%;
  color: var(--mcg-color-text-on-dark);
}
/* Its list of the other languages opens above it, each code straight above the current one (the Navigation block styles that
   would place it are not loaded), white on the panel, yellow on hover like the menu links */
.kloos-menu-panel-bottom .wpml-language-switcher-block .wp-block-navigation-submenu {
  position: relative;
}
/* As specific as WPML's own rules (and one class more), which set min-width, padding and background with !important */
.kloos-site-menu-layer .kloos-menu-panel-bottom .wpml-language-switcher-block .wpml-ls-dropdown ul li.wp-block-navigation-submenu ul.wp-block-navigation__submenu-container {
  position: absolute;
  top: auto;
  bottom: 100%;
  left: 0;
  right: auto;
  z-index: 10;
  width: max-content;
  height: auto; /* core's Navigation CSS gives a closed submenu height 0: anchored at its bottom, the words would hang down over the button */
  min-width: 0 !important;
  padding: 8px 0 4px !important;
  background-color: var(--mcg-color-surface-dark) !important;
  color: var(--mcg-color-text-on-dark);
  text-align: left;
}
/* Open on a tap too (script.js: WPML's opens on hover only) */
.kloos-site-menu-layer .kloos-menu-panel-bottom .wpml-language-switcher-block .wpml-ls-dropdown .has-child.is-open > .wp-block-navigation__submenu-container {
  display: block;
  visibility: visible;
  opacity: 1;
  overflow: visible;
}
/* (WPML gives the items the list's width with !important: as wide as their words instead) */
.kloos-site-menu-layer .kloos-menu-panel-bottom .wpml-language-switcher-block .wpml-ls-dropdown ul li button + .isHorizontal li {
  width: auto !important;
}
/* (the layer's class too: a Navigation rule gives these links 1px of padding, which put the codes 1px apart) */
.kloos-site-menu-layer .kloos-menu-panel-bottom .wpml-language-switcher-block .wp-block-navigation__submenu-container a {
  justify-content: flex-start;
  padding: 0;
  color: inherit;
  text-decoration: none;
}
.kloos-menu-panel-bottom .wpml-language-switcher-block .wp-block-navigation__submenu-container a:hover,
.kloos-menu-panel-bottom .wpml-language-switcher-block .wp-block-navigation__submenu-container a:focus-visible {
  color: var(--mcg-color-accent);
}

/* The "Case Studies" menu item is the current one on a case study tag's page too (the overview
   and a case study: Global CSS menu-active-case-studies) */
.tax-case_study_tag .kloos-site-menu .kloos-menu-nav a[href$="/case-studies/"] {
  color: var(--mcg-color-accent);
}

/* ----------------------------------------------------------
   The button's word: the part of the site the page is in (inc/site-header.php, Figma: "leistungen",
   "team" …) on larger screens, "menü" on phones; just "menü" where a page has no part
   ---------------------------------------------------------- */
.kloos-menu-trigger .kloos-menu-section {
  text-transform: lowercase;
}

.kloos-menu-trigger .kloos-menu-word {
  display: none;
}

@container (max-width: 768px) {
  .kloos-menu-trigger .kloos-menu-section {
    display: none;
  }

  .kloos-menu-trigger .kloos-menu-word {
    display: inline;
  }
}
