/* ==========================================================================
   Site header (navbar) — reusable on every page.
   Markup: <header class="site-header"> in index.html.
   Mark the current page's link with .is-active + aria-current="page".
   ========================================================================== */

.site-header {
  position: relative;
  z-index: 20;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 24px;
}

.site-header__logo {
  display: block;
  flex-shrink: 0;
  width: 100px;
  height: 64px;
}

.site-header__logo img {
  width: 98.8px;
  height: 63px;
  object-fit: cover;
}

/* ---- Main navigation ---- */

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
}

.site-nav__link {
  position: relative;
  display: block;
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  line-height: var(--lh-lg);
  font-weight: var(--fw-medium);
  color: var(--color-zinc-600);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.site-nav__link:hover {
  color: var(--color-zinc-900);
}

/* hand-drawn underline under the active item */
.site-nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 32px;
  width: 100%;   /* the Figma underline is drawn per item at the text's width */
  height: 6.5px;
  background: url("../assets/icons/nav-underline.svg") no-repeat center / 100% 100%;
  /* drawn left to right, like a pen stroke */
  animation: nav-underline-draw 0.7s cubic-bezier(0.6, 0.05, 0.3, 1) 0.15s both;
}

@keyframes nav-underline-draw {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav__link.is-active::after {
    animation: none;
  }
}

/* ---- Right-side actions ---- */

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- Language switcher (native <details>, no JS) ---- */

.lang-switch {
  position: relative;
}

.lang-switch__toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--color-stroke-sub);
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  line-height: var(--lh-md);
  font-weight: var(--fw-medium);
  color: var(--color-zinc-600);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.lang-switch__toggle::-webkit-details-marker {
  display: none;
}

.lang-switch__chevron {
  width: 20px;
  height: 20px;
  transform: rotate(180deg);   /* the asset points up; closed state points down */
  transition: transform 0.15s ease;
}

.lang-switch[open] .lang-switch__chevron {
  transform: none;
}

.lang-switch__menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 300px;
  padding: 8px;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-dropdown);
}

.lang-switch__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
  letter-spacing: -0.084px;
  color: var(--color-text-main);
}

.lang-switch__item:hover,
.lang-switch__item.is-active {
  background: var(--color-bg-weak);
}

.lang-switch__item img {
  width: 20px;
  height: 20px;
}

/* ---- Desktop: the menu wrapper is layout-neutral ---- */

.site-header__menu {
  display: contents;
}

/* ---- Mobile menu (Figma: header 238:8046 closed / 239:15432 open) ----
   CSS-only: the hidden checkbox opens a full-screen panel. */

.nav-toggle,
.nav-toggle__btn {
  display: none;
}

@media (max-width: 1100px) {
  .site-nav__list {
    gap: 16px;
  }

  .site-nav__link {
    font-size: var(--fs-md);
  }
}

@media (max-width: 992px) {
  .site-header__inner {
    height: 62px;
    padding-block: 11px;
  }

  .site-header__logo,
  .site-header__logo img {
    width: 63px;
    height: 40px;
  }

  .nav-toggle__btn {
    display: block;
    position: relative;
    z-index: 2;
    width: 32px;
    height: 32px;
    cursor: pointer;
  }

  .nav-toggle__btn img {
    width: 32px;
    height: 32px;
  }

  .nav-toggle__close,
  .nav-toggle:checked + .nav-toggle__btn .nav-toggle__open {
    display: none;
  }

  .nav-toggle:checked + .nav-toggle__btn .nav-toggle__close {
    display: block;
  }

  .nav-toggle:focus-visible + .nav-toggle__btn {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
    border-radius: 4px;
  }

  /* full-screen panel under the 62px bar */
  .site-header__menu {
    position: fixed;
    inset: 62px 0 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background:
      linear-gradient(to right, rgba(217, 217, 217, 0.4) 1px, transparent 1px) 0 0 / calc((100% - 1px) / 3) 100%,
      linear-gradient(to bottom, rgba(217, 217, 217, 0.4) 1px, transparent 1px) 0 0 / 100% 200px,
      var(--color-white);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
  }

  .nav-toggle:checked ~ .site-header__menu {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition-delay: 0s;
  }

  /* the bar stays white above the panel */
  .site-header:has(.nav-toggle:checked) {
    position: fixed;
    inset: 0 0 auto;
    background: var(--color-white);
  }

  body:has(.nav-toggle:checked) {
    overflow: hidden;
  }

  .site-nav {
    flex: 1 0 auto;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    height: auto;
    padding-block: 20px;
  }

  .site-nav__link {
    padding: 12px 16px;
    font-size: var(--fs-lg);
    line-height: var(--lh-lg);
  }

  .site-nav__link.is-active {
    color: var(--color-zinc-900);
  }

  .site-nav__link.is-active::after {
    display: none;
  }

  /* bottom block: Contact us, then language (full width) */
  .site-header__actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 12px;
    padding: 24px 16px;
    background: var(--color-white);
  }

  .site-header__contact {
    width: 100%;
  }

  .lang-switch__toggle {
    justify-content: center;
    border-color: var(--color-stroke-soft);
  }

  .lang-switch__menu {
    position: static;
    width: 100%;
    margin-top: 4px;
  }
}
