/* =========================================================
   COMPACT HEADER 3.4.2
   Four primary links on desktop; touch-friendly navigation on mobile.
========================================================= */
.site-header .header-inner.header-inner-bilingual {
  gap: 24px;
}

.site-header .main-nav {
  min-width: 0;
}

.site-header .menu-list {
  gap: clamp(20px, 2vw, 34px);
  white-space: nowrap;
}

.site-header .menu-list a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 2px;
  font-size: 0.98rem;
  line-height: 1.25;
}

.site-header .header-actions-bilingual {
  flex: 0 0 auto;
}

/* Existing theme switches to mobile at 1140px. Because the menu now has only
   four links, keep the clean desktop header until 1100px. */
@media (min-width: 1101px) {
  .site-header .main-nav {
    display: flex !important;
  }

  .site-header .header-actions,
  .site-header .header-actions-bilingual {
    display: inline-flex !important;
  }

  .site-header .lang-switcher {
    display: inline-flex !important;
  }

  .site-header .mobile-toggle,
  .site-header .mobile-menu,
  .site-header .mobile-lang-switcher {
    display: none !important;
  }
}

@media (max-width: 1100px) {
  body.idea-mobile-menu-open {
    overflow: hidden;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 9999;
  }

  .site-header .header-inner,
  .site-header .header-inner.header-inner-bilingual {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 12px;
  }

  .site-header .brand-wrap {
    flex: 1 1 auto;
    min-width: 0;
  }

  .site-header .main-nav,
  .site-header .header-actions,
  .site-header .header-actions-bilingual {
    display: none !important;
  }

  .site-header .mobile-toggle {
    position: relative;
    z-index: 2;
    display: inline-flex !important;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    padding: 0;
    gap: 5px;
    border: 1px solid rgba(31, 106, 69, 0.16);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 24px rgba(31, 58, 46, 0.08);
  }

  .site-header .mobile-toggle span {
    width: 20px;
    height: 2px;
    background: #1f5b3f;
    transition: transform .2s ease, opacity .2s ease;
  }

  .site-header .mobile-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header .mobile-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }

  .site-header .mobile-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .site-header .mobile-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 10px;
    right: 10px;
    display: none !important;
    max-height: calc(100vh - 104px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px;
    border: 1px solid rgba(31, 106, 69, 0.12);
    border-radius: 22px;
    background: rgba(252, 249, 242, 0.98);
    box-shadow: 0 24px 60px rgba(31, 58, 46, 0.18);
    backdrop-filter: blur(18px);
  }

  .site-header .mobile-menu.is-open {
    display: block !important;
    animation: ideaHeaderMenuIn .18s ease both;
  }

  .site-header .mobile-lang-switcher {
    display: flex !important;
    width: 100%;
    justify-content: center;
    margin: 0 0 12px;
    box-shadow: none;
  }

  .site-header .mobile-menu-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .site-header .mobile-menu-list li {
    margin: 0;
  }

  .site-header .mobile-menu-list a {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 12px 16px;
    border: 1px solid rgba(31, 106, 69, 0.09);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
    color: #2b3b31;
    font-size: 16px;
    font-weight: 750;
    line-height: 1.25;
  }

  .site-header .mobile-menu-list a:hover,
  .site-header .mobile-menu-list a:focus-visible {
    color: #1f6a45;
    border-color: rgba(31, 106, 69, 0.24);
    background: #fff;
  }

  .site-header .mobile-full {
    width: 100%;
    min-height: 52px;
    margin-top: 12px;
  }
}

@media (max-width: 640px) {
  .site-header .header-inner,
  .site-header .header-inner.header-inner-bilingual {
    width: calc(100% - 20px);
    min-height: 68px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .site-header .custom-logo-link,
  .site-header .site-logo a {
    max-width: min(70vw, 190px);
  }

  .site-header .custom-logo,
  .site-header .custom-logo-link img,
  .site-header .site-logo img {
    width: auto !important;
    height: 38px !important;
    max-height: 38px !important;
    max-width: min(70vw, 190px) !important;
  }

  .site-header .mobile-toggle {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .site-header .mobile-menu {
    top: calc(100% + 6px);
    left: 8px;
    right: 8px;
    max-height: calc(100vh - 90px);
    padding: 12px;
    border-radius: 18px;
  }

  .site-header .lang-option,
  .site-header .lang-pill {
    min-width: 52px;
    height: 40px;
    padding: 0 12px;
  }

  .site-header .mobile-menu-list a {
    min-height: 50px;
    padding: 11px 14px;
    border-radius: 13px;
  }
}

@keyframes ideaHeaderMenuIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header .mobile-menu.is-open {
    animation: none;
  }

  .site-header .mobile-toggle span {
    transition: none;
  }
}
