/* Public site header — scoped to .site-header only (footer / page CTAs untouched). */

html {
  scroll-padding-top: 96px;
}

.site-header {
  --sh-height: 88px;
  --sh-pad-x: 32px;
  --sh-max: 1440px;
  --sh-gap-nav: 26px;
  --sh-tools-gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--sh-height);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  height: 100%;
  width: min(var(--sh-max), 100%);
  margin: 0 auto;
  padding: 0 var(--sh-pad-x);
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-header__logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  margin: 0;
  line-height: 0;
}

.site-header__logo img {
  width: 190px;
  height: auto;
  max-width: min(190px, 42vw);
}

.site-header__toggle {
  display: none;
  margin-left: auto;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.site-header__toggle:hover {
  background: #eef3ea;
  border-color: var(--line);
}

.site-header__toggle:focus-visible {
  outline: 3px solid #88ab56;
  outline-offset: 3px;
}

.site-header__panel {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 24px;
}

.site-header__nav {
  display: flex !important; /* override legacy .header nav { display:none } */
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  gap: var(--sh-gap-nav);
  margin: 0;
  padding: 0;
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.2;
  min-width: 0;
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.site-header__nav > a,
.site-header__trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  color: var(--ink);
  background: none;
  border: 0;
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
  transition: color .2s ease;
}

.site-header__nav > a:hover,
.site-header__trigger:hover {
  color: var(--teal);
}

.site-header__nav > a[aria-current="page"],
.site-header__item.is-active > .site-header__trigger,
.site-header__item.is-active > a {
  color: var(--teal);
}

.site-header__nav > a[aria-current="page"]::after,
.site-header__item.is-active > .site-header__trigger::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 2px;
  background: var(--teal);
  border-radius: 1px;
}

.site-header__chevron {
  display: inline-block;
  width: .55em;
  height: .55em;
  margin-left: 1px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
  opacity: .7;
  flex: 0 0 auto;
}

.site-header__item {
  position: relative;
}

.site-header__panel-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  min-width: 240px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 40px #173f3d14;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 50;
}

/* Bridge so pointer can travel into the panel without closing */
.site-header__panel-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}

.site-header__item:hover > .site-header__panel-menu,
.site-header__item:focus-within > .site-header__panel-menu,
.site-header__item.is-open > .site-header__panel-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.site-header__panel-menu a {
  display: block;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  transition: background .18s ease, color .18s ease;
}

.site-header__panel-menu a:hover,
.site-header__panel-menu a:focus-visible {
  background: #e8eee2;
  color: var(--teal);
}

.site-header__panel-menu a[aria-current="page"] {
  color: var(--teal);
  background: #eef4ea;
}

.site-header__flyout {
  position: relative;
}

.site-header__flyout-trigger {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-header__flyout-trigger .site-header__flyout-mark {
  opacity: .5;
  font-size: 14px;
  line-height: 1;
}

.site-header__flyout-panel {
  position: absolute;
  left: calc(100% + 8px);
  top: -8px;
  min-width: 220px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 40px #173f3d14;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 51;
}

.site-header__flyout-panel::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -12px;
  width: 12px;
}

.site-header__flyout:hover > .site-header__flyout-panel,
.site-header__flyout:focus-within > .site-header__flyout-panel,
.site-header__flyout.is-open > .site-header__flyout-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.site-header__tools {
  display: flex;
  align-items: center;
  gap: var(--sh-tools-gap);
  flex: 0 0 auto;
  margin-left: auto;
}

.site-header__lang {
  display: inline-flex;
  align-items: stretch;
  height: 40px;
  padding: 3px;
  gap: 2px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.site-header__lang form {
  margin: 0;
  display: flex;
}

.site-header__lang button {
  min-width: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.site-header__lang button.is-active {
  background: var(--ink);
  color: #fff;
}

.site-header__lang button:not(.is-active):hover {
  background: #eef3ea;
}

.site-header__lang button:focus-visible {
  outline: 3px solid #88ab56;
  outline-offset: 2px;
}

.site-header__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 20px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: background .2s ease, transform .2s ease;
}

.site-header__cta:hover {
  background: var(--teal);
  color: #fff;
  transform: translateY(-1px);
}

.site-header__cta:focus-visible {
  outline: 3px solid #88ab56;
  outline-offset: 3px;
}

/* Desktop: kill legacy .header / .header-cta sizing from style.css */
.site-header.header {
  height: var(--sh-height);
  max-width: none;
  margin: 0;
  padding: 0;
  gap: 0;
  display: block;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

@media (max-width: 1150px) {
  .site-header {
    --sh-gap-nav: 22px;
  }

  .site-header__logo img {
    width: 180px;
  }
}

/* Switch to mobile nav instead of shrinking type/gaps */
@media (max-width: 1023px) {
  .site-header {
    --sh-height: 72px;
    --sh-pad-x: 20px;
  }

  html {
    scroll-padding-top: 80px;
  }

  .site-header__toggle {
    display: inline-flex;
  }

  .site-header__panel {
    display: none;
    position: absolute;
    top: var(--sh-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 20px 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 28px #173c3410;
    max-height: calc(100dvh - var(--sh-height));
    overflow: auto;
  }

  .site-header__panel.is-open {
    display: flex;
  }

  .site-header__nav {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    font-size: 16px;
    width: 100%;
  }

  /* Neutralize legacy absolute mobile drawer rules from style.css */
  .site-header.header nav {
    display: flex !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    flex-direction: column !important;
    gap: 4px !important;
    align-items: stretch !important;
  }

  .site-header__nav > a,
  .site-header__trigger {
    justify-content: space-between;
    width: 100%;
    padding: 14px 4px;
    white-space: normal;
  }

  .site-header__nav > a[aria-current="page"]::after,
  .site-header__item.is-active > .site-header__trigger::after {
    display: none;
  }

  .site-header__panel-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: none;
    min-width: 0;
    margin: 0 0 8px;
    padding: 4px 0 4px 12px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  .site-header__item.is-open > .site-header__panel-menu {
    display: block;
  }

  .site-header__item.is-open > .site-header__trigger .site-header__chevron {
    transform: translateY(1px) rotate(225deg);
  }

  .site-header__flyout-panel {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: none;
    margin: 0;
    padding: 0 0 0 12px;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .site-header__flyout.is-open > .site-header__flyout-panel {
    display: block;
  }

  .site-header__flyout-trigger .site-header__flyout-mark {
    display: none;
  }

  .site-header__tools {
    margin: 16px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
  }

  .site-header__cta {
    flex: 1 1 auto;
    min-width: 160px;
  }
}

@media (max-width: 390px) {
  .site-header__logo img {
    width: 158px;
  }

  .site-header__lang button {
    min-width: 38px;
    padding: 0 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header__panel-menu,
  .site-header__flyout-panel,
  .site-header__cta,
  .site-header__nav > a,
  .site-header__trigger {
    transition: none;
  }
}
