/* ==================================================================
   additional-nav.css — the SINGLE home of the header/navigation CSS.
   ------------------------------------------------------------------
   MERGED + CLEANED: the #header-container rules used to live in the
   inline <style> of websitex.html while everything else lived here —
   they are now consolidated in this file only.

   MENU MECHANISM — 0 JavaScript, checkbox hack (same as the blog):
   - #nav-toggle is a visually-hidden checkbox = the state source
   - .menu-toggle (hamburger) and .menu-backdrop (full-screen click-
     to-close layer) are <label for="nav-toggle"> carrying the clicks
   - the old JS-era selectors (.nav-menu.active,
     .menu-toggle[aria-expanded="true"]) are replaced by
     #nav-toggle:checked sibling selectors
   ================================================================== */

/* ------------------------------------------------------------------
   HEADER BAR (moved from the inline <style> in websitex.html)
   ------------------------------------------------------------------ */
#header-container {
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  height: 4rem;
  padding: 1rem 2rem;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-color);
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), backdrop-filter 0.4s cubic-bezier(0.16, 1, 0.3, 1), -webkit-backdrop-filter 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
#header-container.header-top {
  height: 4rem;
  transform: translateY(0);
  background-color: var(--header-bg-transparent);
  backdrop-filter: blur(0px) saturate(100%);
  -webkit-backdrop-filter: blur(0px) saturate(100%);
  box-shadow: none;
}
#header-container.header-normal,
#header-container.header-mobile {
  height: 4rem;
  transform: translateY(0);
  background-color: var(--header-bg);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  box-shadow: 0 4px 30px rgba(0,0,0,0.03);
}
#header-container.header-hidden {
  height: 4rem;
  transform: translateY(-100%);
}

.nav-list .lang-pill a {
  width: auto;
  padding: 0 0.55rem;
  line-height: 1.7rem;
  font-size: 1rem;
  border: 1px solid var(--secondary-text-color);
  border-radius: 8px;
  transition: border-color 0.3s ease;
}
.nav-list .lang-pill a::after {
  display: none;
}
.nav-list .lang-pill a:hover {
  border-color: var(--text-color);
}
@media (max-width: 768px) {
  .nav-list .lang-pill a {
    width: 100%;
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
  }
}
.e-line.e-fr {
  margin-top: 1.4em;
}
.e-line.e-fr .e-link {
  border: 1px solid var(--secondary-text-color);
  border-radius: 8px;
  padding: 0.25em 0.8em;
  transition: border-color 0.3s ease;
}
.e-line.e-fr .e-link:hover {
  border-color: var(--text-color);
}



/* ------------------------------------------------------------------
   LOGO
   ------------------------------------------------------------------ */
.logo {
  font-size: 1.5rem;
  font-weight: bold;
}
.logo a {
  text-decoration: none;
  color: var(--text-color);
}
.logo img {
  max-height: 40px;
  width: auto;
}

/* ------------------------------------------------------------------
   DESKTOP NAV
   ------------------------------------------------------------------ */
.nav-menu {
  display: flex;
  align-items: center;
}
.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2rem;
}
.nav-list a {
  display: inline-block;
  text-align: center;
  width: 7rem; /* 4 rem */
  text-decoration: none;
  color: var(--text-color);
  line-height: 2rem;
  font-size: 1.2rem;
  font-weight: bold;
  position: relative;
  padding-bottom: 4px;
}
.nav-list a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--text-color);
  transition: width 0.3s ease;
}
.nav-list a:hover::after {
  width: 100%;
}
.nav-list a.active::after {
  width: 100%;
  background-color: var(--text-color);
}

/* ------------------------------------------------------------------
   CHECKBOX-HACK STATE (new — replaces the JS class/attribute triggers)
   ------------------------------------------------------------------ */
.nav-toggle-input {                       /* new: the hidden state checkbox — must NOT be display:none so it stays keyboard-operable */
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.menu-backdrop {                          /* new: click-anywhere-to-close layer, only exists while the menu is open */
  display: none;
}
#nav-toggle:checked ~ .menu-toggle .line-1 {   /* changed: was .menu-toggle[aria-expanded="true"] .line-1 */
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}
#nav-toggle:checked ~ .menu-toggle .line-2 {   /* changed: was .menu-toggle[aria-expanded="true"] .line-2 */
  opacity: 0;
  transform: translateY(-50%) scale(0);
}
#nav-toggle:checked ~ .menu-toggle .line-3 {   /* changed: was .menu-toggle[aria-expanded="true"] .line-3 */
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
}
#nav-toggle:focus-visible ~ .menu-toggle {      /* new: keyboard users get a visible ring on the hamburger when the hidden checkbox is focused */
  outline: 2px solid var(--text-color);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------
   HAMBURGER (now a <label>, not a <button> — the button-only reset
   background:none/border:none is gone; everything else unchanged)
   ------------------------------------------------------------------ */
.menu-toggle {
  display: none;
  position: relative;
  width: 1.5rem;
  height: 1.5rem;
  cursor: pointer;
  padding: 0;
  color: var(--text-color);
  z-index: 1001;
}
.menu-toggle span.line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--text-color);
  border-radius: 2px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.menu-toggle span.line.line-1 {
  top: 25%;
}
.menu-toggle span.line.line-2 {
  top: 50%;
  transform: translateY(-50%);
}
.menu-toggle span.line.line-3 {
  top: 75%;
  transform: translateY(-100%);
}

/* ------------------------------------------------------------------
   BREAKPOINTS
   ------------------------------------------------------------------ */
@media (min-width: 1025px) {
  #header-container {
    padding: 1rem 4rem;
  }
}
@media (min-width: 769px) and (max-width: 1024px) {
  #header-container {
    padding: 1rem 2.5rem;
  }
  .nav-list {
    gap: 1.5rem;
  }
  .nav-list a {
    font-size: 1.1rem;
    width: 7rem; /* 3.5rem */
  }
}
@media (max-width: 768px) {
  #header-container {
    padding: 1rem 1.5rem;
  }
  .logo {
    font-size: 1.3rem;
  }
  .menu-toggle {
    display: block;
  }
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: calc(100vh - 4rem);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--mobile-menu-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
  }
  #nav-toggle:checked ~ .nav-menu {      /* changed: was .nav-menu.active (JS class) — the checkbox now IS the open state */
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  /* new: click-anywhere-outside-to-close (replaces the JS outside-click handler) */
  #nav-toggle:checked ~ .menu-backdrop {
    display: block;
    position: absolute;
    top: 4rem;
    left: -100vw;
    right: -100vw;
    height: 300vh;
    cursor: pointer;
  }
  /* new: header gets the blurred bar background while the menu is open (replaces the JS header-mobile class toggle) — needs a :has()-capable browser, degrades harmlessly */
  #header-container:has(#nav-toggle:checked) {
    background-color: var(--header-bg);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    box-shadow: 0 4px 30px rgba(0,0,0,0.03);
  }
  /* new: lock page scroll while the menu is open (replaces the JS body overflow toggle) — same :has() caveat */
  body:has(#nav-toggle:checked) {
    overflow: hidden;
  }
  .nav-list {
    width: 100%;
    height: auto;
    flex-direction: column;
    gap: 0.75rem;
    padding: 3rem 2rem;
  }
  .nav-list li {
    width: 100%;
    list-style: none;
  }
  .nav-list a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--text-color);
    position: relative;
  }
  .nav-list a::after {
    display: none !important;
  }
  .nav-list a:hover,
  .nav-list a:active {
    background: var(--shadow-color2);
    transform: translateY(-2px);          /* note: this works again — the GSAP inline transform on the links was overriding it */
    color: var(--text-color);
  }
  .nav-list a.active {
    background: var(--shadow-color1);
    color: var(--text-color);
    font-weight: bold;
  }
  #nav-toggle:checked ~ .nav-menu .nav-list li {   /* changed: was .nav-menu.active .nav-list li */
    animation: menuFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .nav-list li:nth-child(1) {
    animation-delay: 0.05s;
  }
  .nav-list li:nth-child(2) {
    animation-delay: 0.1s;
  }
  .nav-list li:nth-child(3) {
    animation-delay: 0.15s;
  }
  .nav-list li:nth-child(4) {
    animation-delay: 0.2s;
  }
  .nav-list li:nth-child(5) {
    animation-delay: 0.25s;
  }
  .nav-list li:nth-child(6) {
    animation-delay: 0.3s;
  }
  .nav-list li:nth-child(7) {
    animation-delay: 0.35s;
  }
  .nav-list li:nth-child(8) {
    animation-delay: 0.4s;
  }
  /* changed: the -moz-/-webkit-/-o- prefixed menuFadeIn copies were removed —
     every browser that matters has supported unprefixed @keyframes for a decade */
  @keyframes menuFadeIn {
    from {
      opacity: 0;
      transform: translateY(15px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
