/* ==========================================================================
   BAM site header — Material Design 3
   Top app bar (64px) + utility strip; categories are disclosure panels on
   desktop and an accordion inside a modal drawer below 1200px.

   Every rule is `.bam-nav .bam-nav__x` (0,2,0) or stronger: the Elementor kit
   ships `.elementor-kit-5 a/button` (0,1,1) and Hello ships `[type=button]:focus`
   (0,2,0), so the interactive states list :hover and :focus explicitly.
   ========================================================================== */
.bam-nav {
  --bn-primary: hsl(174 62% 32%);
  --bn-primary-container: hsl(170 30% 92%);
  --bn-on-primary-container: hsl(174 62% 22%);
  --bn-accent: #ff6900;
  --bn-accent-hover: #e55d00;
  --bn-surface: #fff;
  --bn-surface-container: hsl(160 10% 96%);
  --bn-on-surface: hsl(200 20% 12%);
  --bn-on-surface-variant: hsl(200 10% 38%);
  --bn-inverse-surface: hsl(200 20% 14%);
  --bn-outline-variant: hsl(200 12% 90%);
  --bn-state-hover: color-mix(in srgb, var(--bn-on-surface) 8%, transparent);
  --bn-elevation-2: 0 1px 2px rgb(0 0 0 / 0.3), 0 2px 6px 2px rgb(0 0 0 / 0.15);
  --bn-bar-height: 64px;
  --bn-gutter: clamp(12px, 2vw, 24px);
  --bn-motion: 0.2s cubic-bezier(0.2, 0, 0, 1);

  /* The header box must not contain the sticky bar, or it would stop sticking after 100px. */
  display: contents;
  font-family: Poppins, system-ui, sans-serif;
}

html:has(.bam-nav) {
  scroll-padding-top: calc(64px + 16px);
}

.bam-nav .bam-nav__inner {
  display: flex;
  align-items: center;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--bn-gutter);
}

.bam-nav .bam-nav__icon {
  flex: none;
  width: 24px;
  height: 24px;
}

.bam-nav .bam-nav__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Campaign strip: scrolls away with the page --------------------------- */
.bam-nav .bam-nav__campaign {
  background: var(--bn-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.bam-nav .bam-nav__campaign .bam-nav__inner {
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 12px;
  min-height: 40px;
  margin-block: 0;
  padding-block: 6px;
  text-align: center;
}

.bam-nav .bam-nav__campaign-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bam-nav .bam-nav__campaign-link:is(:hover, :focus-visible) {
  color: #fff;
  text-decoration-thickness: 2px;
}

.bam-nav .bam-nav__campaign-link .bam-nav__icon {
  width: 18px;
  height: 18px;
}

/* --- Contact: a menu in the bar on desktop, the foot of the drawer below --- */
.bam-nav .bam-nav__contact-menu {
  position: relative;
}

.bam-nav summary.bam-nav__icon-button {
  list-style: none;
}

.bam-nav summary.bam-nav__icon-button::-webkit-details-marker {
  display: none;
}

.bam-nav .bam-nav__contact-menu[open] > summary {
  background: var(--bn-primary-container);
  color: var(--bn-on-primary-container);
}

.bam-nav .bam-nav__contact-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 2;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 8px;
  border-radius: 16px;
  background: var(--bn-surface);
  box-shadow: var(--bn-elevation-2);
}

.bam-nav .bam-nav__contact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bam-nav .bam-nav__contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--bn-on-surface);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.bam-nav .bam-nav__contact-link:is(:hover, :focus-visible) {
  background: var(--bn-state-hover);
  color: var(--bn-on-surface);
}

.bam-nav .bam-nav__contact-link .bam-nav__icon {
  width: 20px;
  height: 20px;
  color: var(--bn-primary);
}

/* --- Top app bar ----------------------------------------------------------- */
.bam-nav .bam-nav__bar {
  position: sticky;
  top: 0;
  z-index: 7500;
  background: var(--bn-surface);
  box-shadow: 0 1px 0 var(--bn-outline-variant), 0 2px 8px rgb(0 0 0 / 0.06);
}

.admin-bar .bam-nav .bam-nav__bar {
  top: var(--wp-admin--admin-bar--height, 32px);
}

/* Up to 600px WordPress stops fixing its admin bar: it scrolls away, so there is nothing to clear. */
@media (max-width: 600px) {
  .admin-bar .bam-nav .bam-nav__bar {
    top: 0;
  }
}

.bam-nav .bam-nav__bar .bam-nav__inner {
  position: relative;
  gap: 8px;
  height: var(--bn-bar-height);
}

.bam-nav .bam-nav__logo {
  display: flex;
  flex: none;
  margin-right: 8px;
  border-radius: 50%;
}

.bam-nav .bam-nav__logo img {
  display: block;
  width: 44px;
  height: 44px;
  max-width: none;
}

.bam-nav .bam-nav__list,
.bam-nav .bam-nav__sublist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bam-nav .bam-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--bn-on-surface);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--bn-motion);
}

.bam-nav summary.bam-nav__link {
  padding-right: 4px;
  list-style: none;
}

.bam-nav summary.bam-nav__link::-webkit-details-marker {
  display: none;
}

.bam-nav .bam-nav__link .bam-nav__icon {
  width: 20px;
  height: 20px;
  transition: transform var(--bn-motion);
}

.bam-nav .bam-nav__details[open] > .bam-nav__link .bam-nav__icon {
  transform: rotate(180deg);
}

.bam-nav .bam-nav__link:is(:hover, :focus-visible) {
  background: var(--bn-state-hover);
  color: var(--bn-on-surface);
}

.bam-nav .bam-nav__item--active > .bam-nav__link,
.bam-nav .bam-nav__item--active > .bam-nav__details > .bam-nav__link,
.bam-nav .bam-nav__details[open] > .bam-nav__link {
  background: var(--bn-primary-container);
  color: var(--bn-on-primary-container);
}

.bam-nav :is(a, summary, button):focus-visible {
  outline: 2px solid var(--bn-primary);
  outline-offset: 2px;
}

/* --- Category panel -------------------------------------------------------- */
.bam-nav .bam-nav__overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bn-primary-container);
  color: var(--bn-on-primary-container);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.bam-nav .bam-nav__overview:is(:hover, :focus-visible) {
  background: color-mix(in srgb, var(--bn-primary) 18%, var(--bn-surface));
  color: var(--bn-on-primary-container);
}

.bam-nav .bam-nav__overview .bam-nav__icon {
  width: 20px;
  height: 20px;
}

.bam-nav .bam-nav__sublist > li {
  break-inside: avoid;
}

.bam-nav .bam-nav__grouplist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bam-nav .bam-nav__group-title {
  margin: 0;
  padding: 12px 16px 4px;
  color: var(--bn-primary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
}

.bam-nav .bam-nav__sublink {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--bn-on-surface);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
  text-decoration: none;
}

.bam-nav .bam-nav__sublink:is(:hover, :focus-visible) {
  background: var(--bn-state-hover);
  color: var(--bn-on-surface);
}

.bam-nav .bam-nav__qualifier {
  margin-top: -2px;
  color: var(--bn-on-surface-variant);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.bam-nav .bam-nav__note {
  flex: none;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--bn-surface-container);
  color: var(--bn-on-surface-variant);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

.bam-nav .bam-nav__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.bam-nav .bam-nav__accreditation {
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--bn-primary-container);
  color: var(--bn-on-primary-container);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

/* The parts of an opleiding that are also sold on their own: one compact line each, under the opleiding. */
.bam-nav .bam-nav__modules {
  margin: 0 0 8px 16px;
  padding: 0;
  border-inline-start: 2px solid var(--bn-primary-container);
  list-style: none;
}

.bam-nav .bam-nav__modules .bam-nav__sublink {
  flex-flow: row wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0 8px;
  min-height: 36px;
  padding: 4px 12px;
  font-size: 13px;
}

.bam-nav .bam-nav__modules .bam-nav__qualifier {
  order: -1;
  margin: 0;
  color: var(--bn-primary);
  font-weight: 600;
}

.bam-nav .bam-nav__modules .bam-nav__meta {
  display: none;
}

.bam-nav .bam-nav__soon {
  margin-top: 8px;
  padding: 8px 16px 4px;
  border-top: 1px solid var(--bn-outline-variant);
}

.bam-nav .bam-nav__soon-title {
  margin: 0 0 4px;
  color: var(--bn-on-surface-variant);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
}

.bam-nav .bam-nav__soon-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 -8px;
  padding: 0;
  list-style: none;
}

.bam-nav .bam-nav__soon-list > li {
  flex: 1 1 220px;
  min-width: 0;
}

.bam-nav .bam-nav__soon-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--bn-on-surface);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}

.bam-nav .bam-nav__soon-link:is(:hover, :focus-visible) {
  background: var(--bn-state-hover);
  color: var(--bn-on-surface);
}

.bam-nav .bam-nav__soon-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bam-nav .bam-nav__sublink[aria-current="page"] {
  color: var(--bn-primary);
  font-weight: 600;
}

/* --- Actions --------------------------------------------------------------- */
.bam-nav .bam-nav__actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.bam-nav .bam-nav__icon-button,
.bam-nav .bam-nav__icon-button:focus {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--bn-on-surface);
  cursor: pointer;
}

.bam-nav .bam-nav__icon-button:is(:hover, :focus-visible) {
  background: var(--bn-state-hover);
  color: var(--bn-on-surface);
}

.bam-nav .bam-nav__account {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--bn-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--bn-motion);
}

.bam-nav .bam-nav__account:is(:hover, :focus-visible) {
  background: var(--bn-accent-hover);
  color: #fff;
}

/* --- Search ---------------------------------------------------------------- */
.bam-nav .bam-nav__search {
  position: fixed;
  inset: calc(var(--bn-bar-height) + 12px) 0 auto;
  width: min(720px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 8px;
  border: 0;
  border-radius: 28px;
  background: var(--bn-surface);
  box-shadow: var(--bn-elevation-2);
}

.bam-nav .bam-nav__search::backdrop,
.bam-nav .bam-nav__menu::backdrop {
  /* Literal on purpose: ::backdrop only inherits custom properties in recent browsers. */
  background: rgb(0 0 0 / 0.32);
}

.bam-nav .bam-nav__search form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.bam-nav .bam-nav__search .bam-nav__search-field {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 48px;
  margin: 0;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--bn-surface-container);
  color: var(--bn-on-surface-variant);
}

.bam-nav .bam-nav__search .bam-nav__search-field input[type="search"],
.bam-nav .bam-nav__search .bam-nav__search-field input[type="search"]:focus {
  flex: 1;
  min-width: 0;
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: var(--bn-on-surface);
  font: inherit;
  font-size: 16px;
}

.bam-nav .bam-nav__search .bam-nav__search-submit,
.bam-nav .bam-nav__search .bam-nav__search-submit:focus {
  height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--bn-primary);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.bam-nav .bam-nav__search .bam-nav__search-submit:is(:hover, :focus-visible) {
  background: var(--bn-on-primary-container);
  color: #fff;
}

.bam-nav .bam-nav__suggestions {
  max-height: calc(100dvh - var(--bn-bar-height) - 120px);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.bam-nav .bam-nav__suggestions:has(> li:not([hidden])) {
  margin-top: 8px;
}

.bam-nav .bam-nav__suggestion {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 20px;
  color: var(--bn-on-surface);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}

.bam-nav .bam-nav__suggestion:is(:hover, :focus-visible) {
  background: var(--bn-state-hover);
  color: var(--bn-on-surface);
}

/* --- Account menu (logged in) ---------------------------------------------- */
.bam-nav .bam-nav__account-menu {
  position: relative;
}

.bam-nav summary.bam-nav__account {
  gap: 2px;
  padding-right: 12px;
  cursor: pointer;
  list-style: none;
}

.bam-nav summary.bam-nav__account::-webkit-details-marker {
  display: none;
}

.bam-nav summary.bam-nav__account .bam-nav__icon {
  width: 20px;
  height: 20px;
  transition: transform var(--bn-motion);
}

.bam-nav .bam-nav__account-menu[open] > summary .bam-nav__icon {
  transform: rotate(180deg);
}

.bam-nav .bam-nav__account-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: min(300px, calc(100vw - 24px));
  padding: 8px;
  border-radius: 16px;
  background: var(--bn-surface);
  box-shadow: var(--bn-elevation-2);
}

.bam-nav .bam-nav__resume {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bn-primary-container);
  color: var(--bn-on-primary-container);
  text-decoration: none;
}

.bam-nav .bam-nav__resume:is(:hover, :focus-visible) {
  background: color-mix(in srgb, var(--bn-primary) 18%, var(--bn-surface));
  color: var(--bn-on-primary-container);
}

.bam-nav .bam-nav__resume-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
}

.bam-nav .bam-nav__resume-label .bam-nav__icon {
  width: 20px;
  height: 20px;
}

.bam-nav .bam-nav__resume-course {
  font-size: 13px;
  line-height: 1.35;
}

.bam-nav .bam-nav__account-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--bn-on-surface);
  font-size: 14px;
  text-decoration: none;
}

.bam-nav .bam-nav__account-link:is(:hover, :focus-visible) {
  background: var(--bn-state-hover);
  color: var(--bn-on-surface);
}

/* --- Desktop: destinations in the bar, panels below it --------------------- */
@media (min-width: 1200px) {
  /* The drawer is a popover; on desktop the same <nav> is laid out inline, open or not. */
  .bam-nav .bam-nav__menu {
    position: static;
    display: flex;
    flex: 1 1 auto;
    justify-content: center;
    inset: auto;
    width: auto;
    height: auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: visible;
    background: none;
    color: inherit;
  }

  .bam-nav .bam-nav__drawer-head,
  .bam-nav .bam-nav__toggle,
  .bam-nav .bam-nav__item--drawer-only {
    display: none;
  }

  .bam-nav .bam-nav__list {
    display: flex;
    align-items: center;
    gap: 2px;
  }

  .bam-nav .bam-nav__item {
    position: relative;
  }

  /* Multi-column panels span the bar instead of hanging from their item. */
  .bam-nav .bam-nav__item--wide {
    position: static;
  }

  .bam-nav .bam-nav__panel {
    position: absolute;
    top: calc(100% + 16px);
    left: 0;
    z-index: 1;
    width: max-content;
    min-width: 300px;
    max-width: 380px;
    max-height: calc(100dvh - var(--bn-bar-height) - 56px);
    padding: 8px;
    overflow-y: auto;
    border-radius: 16px;
    background: var(--bn-surface);
    box-shadow: var(--bn-elevation-2);
  }

  .bam-nav .bam-nav__item--wide .bam-nav__panel {
    top: calc(100% + 4px);
    right: var(--bn-gutter);
    left: var(--bn-gutter);
    width: auto;
    margin-inline: auto;
  }

  .bam-nav .bam-nav__panel--cols-2 {
    max-width: 680px;
  }

  .bam-nav .bam-nav__panel--cols-3 {
    max-width: 1040px;
  }

  .bam-nav .bam-nav__panel--cols-2 .bam-nav__sublist {
    columns: 2;
    column-gap: 8px;
  }

  .bam-nav .bam-nav__panel--cols-3 .bam-nav__sublist {
    columns: 3;
    column-gap: 8px;
  }

  /* Groups get a grid, not balanced columns: WebKit balances two short groups into one column. */
  .bam-nav .bam-nav__panel:is(.bam-nav__panel--cols-2, .bam-nav__panel--cols-3) .bam-nav__sublist--grouped {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 0 8px;
    columns: auto;
  }

  .bam-nav .bam-nav__panel.bam-nav__panel--cols-3 .bam-nav__sublist--grouped {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1400px) {
  .bam-nav .bam-nav__link {
    padding: 0 14px;
    font-size: 14px;
  }

  .bam-nav summary.bam-nav__link {
    padding-right: 8px;
  }
}

/* --- Below 1200px: modal navigation drawer -------------------------------- */
@media (max-width: 1199.98px) {
  html:has(.bam-nav__menu:popover-open) {
    overflow: hidden;
  }

  .bam-nav .bam-nav__menu {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(380px, 90vw);
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0 0 24px;
    border: 0;
    border-radius: 16px 0 0 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bn-surface);
    box-shadow: var(--bn-elevation-2);
    color: var(--bn-on-surface);
  }

  .bam-nav .bam-nav__menu:popover-open {
    animation: bam-nav-drawer-in 0.25s cubic-bezier(0.2, 0, 0, 1);
  }

  .bam-nav .bam-nav__drawer-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--bn-bar-height);
    padding: 0 8px 0 28px;
    background: var(--bn-surface);
    font-size: 16px;
    font-weight: 600;
  }

  .bam-nav .bam-nav__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 12px;
  }

  .bam-nav .bam-nav__link {
    justify-content: space-between;
    width: 100%;
    height: 56px;
    padding: 0 16px;
    font-size: 15px;
    white-space: normal;
  }

  .bam-nav summary.bam-nav__link {
    padding-right: 12px;
  }

  .bam-nav .bam-nav__link .bam-nav__icon {
    width: 24px;
    height: 24px;
  }

  .bam-nav .bam-nav__panel {
    padding: 8px 0 12px 12px;
  }

  .bam-nav .bam-nav__account {
    padding: 0 16px;
  }

  .bam-nav .bam-nav__contact-menu {
    display: none;
  }

  .bam-nav .bam-nav__drawer-contact {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--bn-outline-variant);
  }
}

/* A phone bar holds logo, search, account and menu; the calendar stays in the drawer. */
@media (max-width: 479.98px) {
  .bam-nav .bam-nav__calendar {
    display: none;
  }
}

@keyframes bam-nav-drawer-in {
  from { transform: translateX(100%); }
  to { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bam-nav .bam-nav__menu:popover-open {
    animation: none;
  }

  .bam-nav .bam-nav__link,
  .bam-nav .bam-nav__link .bam-nav__icon,
  .bam-nav .bam-nav__account {
    transition: none;
  }
}

/* --- Browsers without the popover attribute: bam-nav.js toggles .is-open --- */
@supports not selector(:popover-open) {
  .bam-nav .bam-nav__search:not(.is-open) {
    display: none;
  }

  @media (max-width: 1199.98px) {
    .bam-nav .bam-nav__menu:not(.is-open) {
      display: none;
    }
  }
}
