/*
 * VALDIER V3 — compact smart navbar.
 *
 * Sizes: 80px at the top of the page on desktop (48px logo), 66px on compact
 * widths (40px logo, 48px menu button); away from the top, [data-nav-compact]
 * turns it into a 50px bar (32px / 28px logo). Colours, links and the mobile
 * menu stay as exported.
 *
 * Smart, once per trip away from the top: the navbar sticks to the top (the
 * announcement bar above it scrolls away as before). js/valdier-navbar.js
 * sets [data-nav-hidden] on the first scroll down, removes it 1.5s later, and
 * the navbar then stays visible until the page is back at the top.
 *
 * No layout shift: .nav_component keeps the height of the top-of-page bar in
 * the flow and only the bar inside shrinks; the strip left under the compact
 * bar is transparent and lets clicks through. Hiding is transform only.
 * Up in 220ms, back in 350ms, size changes in 250ms.
 */

.nav_component {
  position: sticky;
  top: 0;
  height: 5rem;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav_component > * {
  pointer-events: auto;
}

.nav_component[data-nav-hidden] {
  transform: translateY(-100%);
  transition-duration: 0.22s;
}

.nav_bar {
  padding-top: 1rem;
  padding-bottom: 1rem;
  transition: padding 0.25s ease;
}

.nav_logo img {
  display: block;
  width: auto;
  height: 3rem;
  transition: height 0.25s ease;
}

/* Compact: 8 + 34 (the links, as they are; 32px logo) + 8 = 50px. */
.nav_component[data-nav-compact] .nav_bar {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.nav_component[data-nav-compact] .nav_logo img {
  height: 2rem;
}

@media screen and (max-width: 991px) {
  .nav_component {
    height: 4.125rem;
  }

  .nav_bar {
    padding-top: 0.5625rem;
    padding-bottom: 0.5625rem;
  }

  .nav_logo img {
    height: 2.5rem;
  }

  .nav_menu-button {
    position: relative;
    transition: padding 0.25s ease;
  }

  /* Compact: 3 + 44 + 3 = 50px. The logo link keeps a 44px tap height
   * around its 28px image; the menu button draws 40px but answers on 48px. */
  .nav_component[data-nav-compact] .nav_bar {
    padding-top: 0.1875rem;
    padding-bottom: 0.1875rem;
  }

  .nav_component[data-nav-compact] .nav_logo {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .nav_component[data-nav-compact] .nav_logo img {
    height: 1.75rem;
  }

  .nav_component[data-nav-compact] .nav_menu-button {
    padding: 0.5rem;
  }

  .nav_component[data-nav-compact] .nav_menu-button::before {
    content: "";
    position: absolute;
    inset: -0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav_component,
  .nav_bar,
  .nav_logo img,
  .nav_menu-button {
    transition: none;
  }
}
