/* Header */

header {
  background: transparent;
  color: black;
  text-align: center;
  display: flex;
 justify-content: space-between;
 padding: 16px 20px; /* Slightly more breathing room */
 align-items: center;
 position: fixed;
 top: 0;
 left: 0;
 width: 100%;
 z-index: 1000;
 transition: background-color 0.3s ease-in-out; /* Smooth transition */
}

  header.scrolled {
    background-color: white; /* White background when scrolled */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Add a slight shadow */
    color: black;
  }
  
  header a {
    display: flex;
    align-items: center;
    padding: 6px 0;
  }

    header .header-left {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    header .lang-switch {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    header .lang-btn {
      background: transparent;
      border: 1px solid currentColor;
      border-radius: var(--border-radius2);
      padding: 5px 8px;
      font-size: calc(var(--fontsize-p) * 0.9);
      cursor: pointer;
      line-height: 1;
      color: black;
    }

    header.scrolled .lang-btn {
      color: black;
    }

    header .lang-btn.is-active {
      background: var(--color2);
      color: black;
    }

  header .logo {
    max-height: 100px;
    text-decoration: none;
    padding: 0;
    fill: white;
  }

  header .header-slogan {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-height: 115px;
    width: auto;
    max-width: 50vw;
    pointer-events: none;
  }
  
  header nav ul {
    list-style: none;
    padding: 0 40px;
    margin: 0;
    display: flex;
    gap: 1.75rem;
  }
  
  header nav ul li {
    display: block;
    margin: 0;
  }
  
  header nav ul li a {
    color: black;
    text-decoration: none;
    font-size: var(--fontsize-p);
    transition: color 0.3s ease-in-out;
  }

  header nav ul li a:hover {
    color: var(--color2);
  }

  header.scrolled nav ul li a {
    color: black; /* Dark text when scrolled */
  }
  
    /* Hamburger Menu Button */

    .menu-toggle {
      background: none;
      border: none;
      font-size: var(--fontsize-h2);
      cursor: pointer;
      display: none; /* Hidden by default on larger screens */
      color: var(--color1);
      margin-left: auto;
      position: relative;
      right: 0;
    }


/* Collapsed Navigation (Hamburger) */
@media (max-width: 1450px) {

  header nav {
    position: relative;
  }

  .menu-toggle {
    display: block;      /* Show button on smaller screens */
    font-size: 3.5rem;
    margin-left: auto;
    position: relative;
    right: 1rem;
    top: 0;
  }

  header nav ul {
    display: none; /* Hide menu by default */
    flex-direction: column;
    position: absolute;
    top: 100%;
    margin-top: 10px;
    right: 0;
    background: var(--color1);
    padding: 8px;
    width: 280px;
    text-align: center;
    border-radius: var(--border-radius2);
    gap: 0;
  }

  header nav ul li {
    display: block;
    padding: 10px 0;
  }

  header nav ul li a {
    color: black;
    display: block;
    font-size: var(--fontsize-p);
  }

  /* Show menu when active */
  header nav.active ul {
    display: flex;
    flex-direction: column;
  }

  header .header-slogan {
    max-height: 75px;
    max-width: 50vw;
  }

}

/* Landscape Mode - Reduce logo size for better header proportions */
@media (max-height: 500px) and (orientation: landscape) {
  
  header .logo {
    max-height: 60px; /* Reduced for landscape */
  }

  header .header-slogan {
    max-height: 40px;
  }
  

}

/* Tablet and smaller */
@media (max-width: 1024px) {
  header .lang-switch {
    flex-direction: column;
    gap: 6px;
  }

  header .lang-btn {
    padding: 5px 8px;
    font-size: calc(var(--fontsize-p) * 0.85);
  }
}

/* Smaller screens: larger tap targets */
@media (max-width: 768px) {
  .menu-toggle {
    font-size: var(--fontsize-h2);
  }

  header nav ul {
    width: 200px;
  }

  header nav ul li a {
    font-size: var(--fontsize-p);
  }

  header .header-slogan {
    max-height: 50px;
    max-width: 55vw;
  }
}

/* Very small screens: keep slogan centered on first row without overlap */
@media (max-width: 500px) {
  header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 10px;
    padding: 12px 12px;
  }

  header .header-left {
    gap: 8px;
  }

  header .logo {
    max-height: 55px;
  }

  header .lang-switch {
    flex-direction: column;
    gap: 4px;
  }

  header .lang-btn {
    padding: 3px 5px;
    font-size: calc(var(--fontsize-p) * 0.72);
  }

  header .header-slogan {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    justify-self: center;
    max-width: 32vw;
    max-height: 42px;
  }

  .menu-toggle {
    justify-self: end;
    right: 0;
  }

  header nav {
    justify-self: end;
    /* Let the dropdown position relative to the header (not this grid item) */
    position: static;
  }

  header nav ul {
    right: 0;
    left: auto;
  }
}