/* Fixed header — transparent + overlaid on the hero by default, becomes an
   ivory blurred bar once scrolled past the hero (see sticky-nav.js, which
   toggles .is-scrolled via an IntersectionObserver sentinel). */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--motion-base), border-color var(--motion-base), backdrop-filter var(--motion-base);
}

/* Sit below WP's admin toolbar (also fixed at top:0) for logged-in users
   viewing the front end, instead of being hidden behind it. */
body.admin-bar .site-header {
  top: var(--wp-admin--admin-bar--height, 32px);
}
@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: var(--wp-admin--admin-bar--height, 46px);
  }
}

.site-header.is-scrolled {
  background: color-mix(in oklch, var(--kgc-ivory) 88%, transparent);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom-color: var(--kgc-line-soft);
}

.site-header__bar {
  display: grid;
  /* 1fr on both sides (not auto) so the nav's own track is exactly
     centered in the header regardless of the logo/actions content widths
     differing — with `auto 1fr auto`, an actions column wider than the
     logo shifts the middle track (and the centered nav inside it) off the
     header's true center, which reads as misaligned against the hero
     content below, which centers on the true page center. */
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-6);
  height: 144px;
  padding-inline: 56px;
  transition: height var(--motion-base);
}
.site-header.is-scrolled .site-header__bar {
  height: 96px;
}

.site-header__logo {
  display: block;
  line-height: 0;
  justify-self: start;
  /* Hidden until the header switches to its scrolled state — the logo
     lives in the hero itself while the hero is on screen (see hero.php's
     .hero__logo), so showing it here too would be a duplicate. */
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--motion-base);
}
.site-header.is-scrolled .site-header__logo {
  opacity: 1;
  visibility: visible;
}
.site-header__logo img {
  height: 78px;
  width: auto;
  transition: filter var(--motion-base), height var(--motion-base);
}
.site-header.is-scrolled .site-header__logo img {
  height: 52px;
  filter: invert(1);
}

.site-header__nav {
  justify-self: center;
}
.kgc-nav__list {
  display: flex;
  align-items: center;
  gap: 30px;
}
.kgc-nav__link {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.72);
  transition: color var(--motion-fast);
}
.kgc-nav__link--active {
  color: rgba(255, 255, 255, 0.9);
}
.site-header.is-scrolled .kgc-nav__link {
  color: color-mix(in oklch, var(--fg-1) 72%, transparent);
}
.site-header.is-scrolled .kgc-nav__link--active {
  color: var(--fg-1);
}
.kgc-nav__link:hover {
  color: #fff;
  text-decoration: none;
}
.site-header.is-scrolled .kgc-nav__link:hover {
  color: var(--fg-1);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-self: end;
  /* Hidden until the header switches to its scrolled state, same as
     .site-header__logo — the hero's own button row already carries a
     "Book a Site Visit" + phone pair, so these only need to show up once
     that's scrolled out of view. */
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--motion-base);
}
.site-header.is-scrolled .site-header__actions {
  opacity: 1;
  visibility: visible;
}
.site-header__phone {
  font-family: var(--font-ui);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}
.site-header.is-scrolled .site-header__phone {
  color: var(--fg-2);
}

.site-header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
}
.site-header__hamburger-bar {
  display: block;
  height: 1.5px;
  width: 22px;
  background: #fff;
  border-radius: 1px;
  transition: background var(--motion-fast);
}
.site-header__hamburger-bar--accent {
  width: 14px;
  background: var(--gold);
}
.site-header.is-scrolled .site-header__hamburger-bar {
  background: var(--fg-1);
}
.site-header.is-scrolled .site-header__hamburger-bar--accent {
  background: var(--gold-deep);
}

@media (max-width: 767px) {
  .site-header__bar {
    grid-template-columns: auto auto;
    justify-content: space-between;
    height: 114px;
    padding-inline: var(--space-6);
  }
  .site-header.is-scrolled .site-header__bar {
    height: 76px;
  }
  .site-header__logo img { height: 63px; }
  .site-header.is-scrolled .site-header__logo img { height: 42px; }
  .site-header__nav,
  .site-header__actions { display: none; }
  .site-header__hamburger { display: flex; }
}

/* Full-screen mobile nav sheet */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--kgc-ivory);
}
.mobile-menu__panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  overflow-y: auto;
}
.mobile-menu__close {
  align-self: flex-end;
  width: 44px;
  height: 44px;
  font-size: 28px;
  color: var(--fg-1);
  line-height: 1;
}
.mobile-menu__list {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-8);
  padding-block: var(--space-8);
}
.mobile-menu__link {
  font-family: var(--font-display);
  font-size: var(--fs-32);
  color: var(--fg-1);
  text-decoration: none;
}
.mobile-menu__link:hover {
  color: var(--gold-deep);
  text-decoration: none;
}
.mobile-menu__footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid var(--kgc-line-soft);
}
.mobile-menu__phone {
  text-align: center;
  color: var(--fg-2);
  text-decoration: none;
}
