/* LocalX — header en navigatie
   Onderdeel van de ForwardX Eleventy-structuur. Alle waarden via var(--naam). */

/* ---------- Balk ---------- */

/* De header blijft meescrollen; de schaduw verschijnt pas zodra de pagina
   eronder wegloopt, zodat hij bovenaan strak op de hero aansluit. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-page);
  transition: box-shadow .2s ease;
}
.site-header[data-scrolled="true"] { box-shadow: var(--shadow-sm); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter);
  min-height: 88px;
}

/* Logo en de rechterkant blijven boven het uitschuifpaneel liggen. Zonder
   deze z-index schuift het paneel eroverheen — een gepositioneerd element
   wint het van niet-gepositioneerde buren, ongeacht de volgorde — en dan
   verdwijnen de contactknop en het kruisje achter een leeg wit vlak. */
.site-header__logo,
.site-header__end { position: relative; z-index: 2; }

.site-header__logo { display: inline-block; line-height: 0; }
.site-header__logo img { width: 190px; height: 48px; object-fit: contain; border-radius: 0; }

.site-header__end { display: flex; align-items: center; gap: 10px; }

/* ---------- Hoofdnavigatie ---------- */

.nav__list { display: flex; align-items: center; }
.nav__item { position: relative; }

.nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  margin-inline: 15px;
  color: var(--text-main);
  font-family: var(--ff-text);
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: normal;
  text-transform: uppercase;
  transition: color .2s ease;
}
.nav__list > li:first-child .nav__link { margin-left: 0; }
.nav__list > li:last-child  .nav__link { margin-right: 0; }

.nav__link:hover { color: var(--accent); }
.nav__link[aria-current="page"] { color: var(--accent); }

/* Het pijltje draait om zijn eigen midden. De ruimte ernaast komt van de
   gap op de link: zet je die als padding op het pijltje zelf, dan klapt hij
   bij het draaien mee naar de andere kant en schuift het pijltje zichtbaar op. */
.nav__caret {
  width: 12px;
  height: 12px;
  fill: currentColor;
  transition: transform .2s ease;
}

/* ---------- Uitklapmenu ---------- */

.nav__sub {
  position: absolute;
  top: 100%;
  left: 15px;
  min-width: 230px;
  background-color: var(--bg-page);
  border-radius: 0 0 10px 10px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.nav__sub a {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: var(--text-main);
  font-size: 18px;
  font-weight: 500;
  line-height: 20px;
  transition: color .2s ease, background-color .2s ease;
}
.nav__sub a:hover { color: var(--accent); background-color: var(--bg-surface); }
.nav__sub li:last-child a { border-radius: 0 0 10px 10px; }

/* De pagina waar je nu bent, krijgt een oranje balk met witte tekst. */
.nav__sub a[aria-current="page"],
.nav__sub a[aria-current="page"]:hover {
  background-color: var(--accent);
  color: var(--bg-page);
}

/* ---------- Hamburger ---------- */

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  /* 44x44 is de kleinste maat die met een vinger goed te raken is. */
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--text-main);
  cursor: pointer;
}
.nav-toggle svg { width: 26px; height: 26px; }
.nav-toggle__cross { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__cross { display: block; }

/* ---------- Onder 1024px: uitschuifpaneel ---------- */

@media (max-width: 1024px) {
  .nav-toggle { display: inline-flex; }

  .site-header__inner { min-height: 0; padding-block: 15px; gap: 10px; }
  .site-header__logo img { width: 121px; height: 30px; }

  .site-header__cta {
    padding: 10px;
    border-radius: 5px;
    font-size: var(--fs-label);
    line-height: 1;
  }
  .site-header__cta .icon { display: none; }

  /* Het menu schuift van rechts in beeld en laat de balk vrij, zodat de
     hamburger zichtbaar blijft en het paneel er ook mee sluit. */
  .nav {
    position: fixed;
    inset: 0 0 0 auto;
    /* Onder het logo en de knoppen (z-index 2), maar wel binnen de header,
       die zelf op z-index 100 staat en dus boven de backdrop uitkomt. */
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(340px, 86vw);
    padding: 84px 0 32px;   /* de balk is 74px; die 10px eronder is de ademruimte */
    background-color: var(--bg-page);
    box-shadow: -8px 0 40px rgba(12, 12, 10, .16);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(100%);
    transition: transform .28s ease;
  }
  .nav[data-open="true"] { transform: translateX(0); }

  .nav__list { flex-direction: column; align-items: stretch; }

  .nav__link {
    justify-content: space-between;
    margin-inline: 0;
    padding: 18px 26px;
    font-size: 17px;
    font-weight: 500;
    line-height: 20px;
    text-transform: none;
  }
  .nav__link[aria-current="page"] { background-color: var(--accent); color: var(--bg-page); }

  /* Submenu klapt uit op tik in plaats van hover. */
  .nav__sub {
    position: static;
    display: none;
    min-width: 0;
    border-radius: 0;
    background-color: var(--bg-surface);
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav__item--has-sub[data-open="true"] .nav__sub { display: block; }
  .nav__item--has-sub[data-open="true"] .nav__caret { transform: rotate(180deg); }
  .nav__sub a { padding: 15px 26px 15px 40px; font-size: 16px; }
  .nav__sub li:last-child a { border-radius: 0; }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 98;
    background-color: rgba(12, 12, 10, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s ease, visibility .28s;
  }
  .nav-backdrop[data-open="true"] { opacity: 1; visibility: visible; }
}

/* Hover hoort alleen op desktop: op een touchscreen telt een tik als hover,
   waardoor het pijltje draait terwijl het submenu dicht blijft. */
@media (min-width: 1025px) {
  .nav__item--has-sub:hover .nav__caret,
  .nav__item--has-sub:focus-within .nav__caret { transform: rotate(180deg); }

  .nav__item--has-sub:hover .nav__sub,
  .nav__item--has-sub:focus-within .nav__sub {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}


/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .hero__inner { gap: 40px; }
  .hero__text  { max-width: 100%; }
  .hero__visual { width: 420px; }
}

@media (max-width: 900px) {
  .hero__inner { flex-direction: column; align-items: stretch; }
  .hero__visual { width: 100%; }
}

@media (max-width: 767px) {
  /* De headerregels staan hierboven al bij het uitschuifpaneel. */
  .hero::before { background-size: 80%; }
}

