/**
 * Peak header — front-end styling for the builder-rendered header.
 *
 * This is the Peak Starter header, one to one: the same sticky blurred bar,
 * pill nav links, floating submenus, inset search field and pill CTA. Every
 * value reads a Peak design token first and only falls back to a literal when
 * the active theme doesn't ship the token — so the built header inherits the
 * theme's palette on Peak Starter and still looks right on a third-party theme.
 *
 * Colours the user picks in the panel arrive as inline custom properties
 * (--peak-h-height, --peak-h-bg, --peak-h-color, --peak-h-accent,
 * --peak-h-sticky-bg); each is optional, and an unset one keeps the theme's.
 *
 * Mobile is driven by the `is-mobile` class header-front.js sets from the
 * panel's breakpoint — a media query can't read a stored option.
 */
.peak-header {
  --_h: var(--peak-h-height, var(--peak-header-h, 72px));
  --_bg: var(--peak-h-bg, color-mix(in srgb, var(--peak-canvas, #f7f3f0) 82%, transparent));
  --_color: var(--peak-h-color, var(--peak-ink, #191919));
  --_muted: var(--peak-muted, #5f5d5a);
  --_accent: var(--peak-h-accent, var(--peak-ink, #191919));
  --_pill: var(--peak-radius-pill, 9999px);
  --_inset: var(--peak-inset, rgba(25, 25, 25, 0.045));
  --_line: var(--peak-line, rgba(25, 25, 25, 0.07));
  --_ease: var(--peak-ease, cubic-bezier(0.2, 0.7, 0.2, 1));
  --_fs: var(--peak-fs-small, 0.875rem);
  position: relative;
  width: 100%;
  background: var(--_bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  color: var(--_color);
  z-index: 50;
}

/* A template supplies its own design.
 *
 * The wrapper still exists — it is what makes the header sticky or fixed — but
 * it must contribute NOTHING visual, or a template drawn in the builder picks
 * up a background, a blur and a stray hairline it never asked for. Position
 * only; everything else is the template's. */
.peak-header--template {
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: inherit;
  border: 0;
  box-shadow: none;
}

/* Behaviour --------------------------------------------------------- */
.peak-header.is-sticky {
  position: sticky;
  top: 0;
}
.peak-header.is-fixed,
.peak-header.is-dynamic {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}
/* Dynamic: fixed, but it reads as static. header-dynamic.js moves it 1:1 with
 * the scroll — out on the way down, back in on the way up — and only eases the
 * last bit when the scroll stops with the bar half way. */
.peak-header.is-dynamic.is-settling {
  transition: transform 0.3s var(--_ease, cubic-bezier(0.2, 0.7, 0.2, 1));
}
.peak-header.is-dynamic.is-away {
  box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
  .peak-header.is-dynamic.is-settling {
    transition: none;
  }
}
.admin-bar .peak-header.is-sticky,
.admin-bar .peak-header.is-fixed,
.admin-bar .peak-header.is-dynamic {
  top: 32px;
}
@media (max-width: 782px) {
  .admin-bar .peak-header.is-sticky,
  .admin-bar .peak-header.is-fixed,
  .admin-bar .peak-header.is-dynamic {
    top: 46px;
  }
}
@media (max-width: 600px) {
  .admin-bar .peak-header.is-sticky,
  .admin-bar .peak-header.is-fixed,
  .admin-bar .peak-header.is-dynamic {
    top: 0;
  }
}
.peak-header.is-transparent {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.peak-header.is-transparent.is-stuck {
  background: var(--peak-h-sticky-bg, var(--_bg));
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}
.peak-header.is-sticky.has-shadow.is-stuck,
.peak-header.is-fixed.has-shadow.is-stuck,
.peak-header.is-dynamic.has-shadow.is-stuck {
  box-shadow: 0 2px 20px rgba(25, 25, 25, 0.08);
}
.peak-header.has-border {
  border-bottom: 1px solid var(--_line);
}
.peak-header.can-shrink.is-stuck .peak-header__row {
  min-height: calc(var(--_h) * 0.8);
}

/* Frame ------------------------------------------------------------- */
.peak-header__inner {
  max-width: var(--peak-container, 1300px);
  margin-inline: auto;
  padding-inline: var(--peak-gutter, clamp(1.25rem, 4vw, 2.5rem));
}
.peak-header__inner.is-full {
  max-width: none;
}
.peak-header__row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--_h);
  padding-block: 0.75rem;
  transition: min-height 0.2s var(--_ease);
}

/* Zones — first left, last right, everything between centred. --------- */
.peak-header__zone {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  justify-content: center;
}
.peak-header__zone.is-col {
  flex-direction: column;
  justify-content: center;
}
.peak-header__zone.is-row {
  flex-direction: row;
  flex-wrap: nowrap;
}
.peak-header__zone:first-child {
  justify-content: flex-start;
}
.peak-header__zone:last-child {
  justify-content: flex-end;
}
.peak-header__el {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}
/* The menu takes the slack so the utilities stay pinned right, exactly as
   .site-nav does in the theme. */
.peak-header__el--menu {
  flex: 1 1 auto;
  justify-content: flex-end;
  gap: 0.5rem;
}
/* the theme keeps 1.5rem between the nav and the utility cluster */
.peak-header__el--menu:not(:last-child) {
  margin-inline-end: 1rem;
}

/* Logo -------------------------------------------------------------- */
.peak-header__el--logo img,
.peak-header .custom-logo {
  display: block;
  max-height: 40px;
  width: auto;
  height: auto;
}
.peak-header__logo-text,
.peak-header .site-title {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-decoration: none;
  color: var(--_color);
}
.peak-header .site-mark {
  width: 26px;
  height: 26px;
  display: inline-flex;
}
/* The theme paints the mark in the page's ink (.site-title .site-mark, loaded
   after this sheet): in the header it follows the header's text colour. */
.peak-header .site-title .site-mark {
  flex: none; /* the name wraps on a narrow phone; the mark keeps its size */
  color: var(--_color);
}
.peak-header .site-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Menu -------------------------------------------------------------- */
.peak-header__menu-list,
.peak-header__menu ul {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.peak-header__menu li {
  position: relative;
}
.peak-header__menu a {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  min-height: 36px;
  padding: 0.35em 0.65em;
  border-radius: var(--_pill);
  font-size: var(--_fs);
  font-weight: 500;
  color: var(--_muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s var(--_ease), color 0.15s var(--_ease);
}
.peak-header__menu a:hover,
.peak-header__menu li:focus-within > a {
  background: var(--_inset);
  color: var(--_accent);
}
.peak-header__menu .current-menu-ancestor > a,
.peak-header__menu .current-menu-parent > a,
.peak-header__menu .current_page_item > a {
  color: var(--_color);
}
.peak-header__menu .current-menu-item > a {
  background: var(--peak-accent, #191919);
  color: var(--peak-accent-fg, #f7f3f0);
}
/* chevron on parents (Lucide chevron-down, masked) */
.peak-header__menu .menu-item-has-children > a::after {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  opacity: 0.6;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>") center / contain no-repeat;
  transition: transform 0.2s var(--_ease);
}
.peak-header__menu .menu-item-has-children:hover > a::after,
.peak-header__menu .menu-item-has-children:focus-within > a::after,
.peak-header__menu .menu-item-has-children.is-open > a::after {
  transform: rotate(180deg);
}
/* hover bridge across the 6px gap */
.peak-header__menu .menu-item-has-children > a::before {
  content: "";
  position: absolute;
  inset: 100% 0 -8px;
}
.peak-header__menu .sub-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  min-width: 220px;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 6px;
  background: var(--peak-surface, #fcfbfa);
  border: 1px solid var(--peak-border, rgba(25, 25, 25, 0.1));
  border-radius: var(--peak-radius, 10px);
  box-shadow: var(--peak-shadow-pop, 0 12px 32px rgba(25, 25, 25, 0.12));
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s var(--_ease), transform 0.15s var(--_ease), visibility 0s linear 0.15s;
}
.peak-header__menu .sub-menu .sub-menu {
  top: -6px;
  left: calc(100% + 4px);
}
.peak-header__menu li:hover > .sub-menu,
.peak-header__menu li:focus-within > .sub-menu,
.peak-header__menu li.is-open > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}
.peak-header__menu .sub-menu li {
  width: 100%;
}
.peak-header__menu .sub-menu a {
  display: flex;
  width: 100%;
  min-height: 34px;
  padding: 0.45em 0.7em;
  border-radius: var(--peak-radius-sm, 6px);
  font-weight: 400;
  white-space: normal;
}
.peak-header__menu .sub-menu .menu-item-has-children > a::after {
  margin-left: auto;
  transform: rotate(-90deg);
}
.peak-header__menu .sub-menu .current-menu-item > a {
  background: var(--peak-accent, #191919);
  color: var(--peak-accent-fg, #f7f3f0);
}
.peak-header__menu > ul > li:nth-last-child(-n + 2) > .sub-menu {
  left: auto;
  right: 0;
}
.peak-header__menu > ul > li:nth-last-child(-n + 2) .sub-menu .sub-menu {
  left: auto;
  right: calc(100% + 4px);
}

/* Hamburger + submenu toggles --------------------------------------- */
.peak-header__toggle,
.peak-header__sub-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--_color);
  cursor: pointer;
}
.peak-header__toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--_pill);
  transition: background-color 0.15s var(--_ease);
}
.peak-header__toggle:hover {
  background: var(--_inset);
}
.peak-header__toggle .ico-close,
.peak-header__toggle[aria-expanded="true"] .ico-open {
  display: none;
}
.peak-header__toggle[aria-expanded="true"] .ico-close {
  display: block;
}

/* Text -------------------------------------------------------------- */
.peak-header__text {
  font-size: var(--_fs);
  color: var(--_muted);
}

/* Search ------------------------------------------------------------ */
.peak-header__el--search {
  width: 190px;
  transition: width 0.25s var(--_ease);
}
.peak-header__el--search:focus-within {
  width: 250px;
}
@media (max-width: 1280px) {
  .peak-header__el--search {
    width: 150px;
  }
  .peak-header__el--search:focus-within {
    width: 220px;
  }
}
.peak-header__el--search .search-form {
  width: 100%;
}
.peak-header__el--search .search-field {
  width: 100%;
  min-height: 36px;
  padding-top: 0.35em;
  padding-bottom: 0.35em;
  font-size: var(--_fs);
  background: var(--_inset);
  border-color: transparent;
  box-shadow: none;
}
.peak-header__el--search .search-field:focus {
  background: var(--peak-field, #fff);
  border-color: var(--_color);
  box-shadow: 0 0 0 1px var(--_color);
}
.peak-header__el--search .search-submit {
  width: 28px;
  height: 28px;
  right: 4px;
  opacity: 0;
  transition: opacity 0.15s var(--_ease);
}
.peak-header__el--search .search-form:focus-within .search-submit,
.peak-header__el--search .search-field:not(:placeholder-shown) ~ .search-submit {
  opacity: 1;
}

/* CTA — the header/footer builder's own small pill --------------------
 *
 * `peak-cta`, NOT `peak-btn`: `.peak-btn` is the Button WIDGET's core class
 * (modules/widgets/assets/peak-widgets.css), and this sheet loads on every page
 * that has a Peak header. Sharing the name meant this rule's `border`, pill
 * radius, min-height and font-size landed on every Button widget on the site —
 * the phantom border no Button setting could turn off. Two different buttons,
 * two class names. ------------------------------------------------------- */
.peak-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  flex: 0 0 auto;
  min-height: var(--peak-h-sm, 34px);
  padding: 0.45em 1.05em;
  border: 1px solid var(--peak-accent, #191919);
  border-radius: var(--_pill);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s var(--_ease), color 0.15s var(--_ease),
    border-color 0.15s var(--_ease), transform 0.12s var(--_ease);
}
.peak-cta--filled {
  background: var(--peak-accent, #191919);
  color: var(--peak-accent-fg, #f7f3f0);
}
.peak-cta--filled:hover {
  background: #2b2b2a;
  border-color: #2b2b2a;
  color: var(--peak-accent-fg, #f7f3f0);
  transform: translateY(-1px);
}
.peak-cta--outline {
  background: transparent;
  color: var(--_color);
  border-color: var(--peak-border-strong, rgba(25, 25, 25, 0.2));
}
.peak-cta--outline:hover {
  background: var(--_inset);
  border-color: var(--_color);
}
.peak-cta--text {
  background: transparent;
  border-color: transparent;
  color: var(--_color);
  padding-inline: 0.4em;
}
.peak-cta--text:hover {
  background: var(--_inset);
}

/* ====================================================================
 * Mobile — `is-mobile` is set by header-front.js from the panel's
 * breakpoint. Dropdown (the theme's own behaviour) is the default;
 * slide-in and fullscreen are the two alternatives the panel offers.
 * ================================================================= */
.peak-header.is-mobile .peak-header__toggle {
  display: inline-flex;
}
/* The desktop proportions (a 25% logo zone, set inline per zone) squeeze the
   logo into a column on a phone, where the other zone holds only a CTA and
   the hamburger: zones keep what they hold, the first takes the slack (and
   is the one that wraps). !important because the basis is an inline style. */
.peak-header.is-mobile .peak-header__zone {
  flex: 0 0 auto !important;
}
.peak-header.is-mobile .peak-header__zone:first-child {
  flex: 1 1 auto !important;
}
.peak-header.is-mobile .site-title {
  min-width: 0;
}
.peak-header.is-mobile .peak-header__el--search {
  display: none;
}
.peak-header.is-mobile .peak-header__el--menu {
  flex: 0 0 auto;
  margin-inline-end: 0;
  order: 9; /* the hamburger sits at the far right, after the CTA */
}
.peak-header.is-mobile .peak-header__menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  max-height: calc(100vh - var(--_h));
  overflow-y: auto;
  padding: 0.75rem var(--peak-gutter, 1.25rem) 1.25rem;
  background: var(--peak-surface, #fcfbfa);
  border-bottom: 1px solid var(--peak-border, rgba(25, 25, 25, 0.1));
  box-shadow: var(--peak-shadow-pop, 0 12px 32px rgba(25, 25, 25, 0.12));
  display: none;
}
.peak-header.is-mobile .peak-header__menu.is-open {
  display: block;
}
.peak-header.is-mobile .peak-header__menu-list,
.peak-header.is-mobile .peak-header__menu ul {
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}
.peak-header.is-mobile .peak-header__menu li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.peak-header.is-mobile .peak-header__menu a {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 0.5em 0.9em;
  font-size: 1rem;
  white-space: normal;
  border-radius: var(--peak-radius-sm, 6px);
}
.peak-header.is-mobile .peak-header__menu .menu-item-has-children > a::after,
.peak-header.is-mobile .peak-header__menu .menu-item-has-children > a::before {
  display: none;
}
.peak-header.is-mobile .peak-header__sub-toggle {
  display: inline-flex;
  width: 44px;
  height: 44px;
  border-radius: var(--peak-radius-sm, 6px);
  color: var(--_muted);
}
.peak-header.is-mobile .peak-header__sub-toggle svg {
  transition: transform 0.2s var(--_ease);
}
.peak-header.is-mobile .peak-header__sub-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.peak-header.is-mobile .peak-header__menu .sub-menu,
.peak-header.is-mobile .peak-header__menu .sub-menu .sub-menu {
  position: static;
  flex: 1 1 100%;
  min-width: 0;
  margin: 0;
  padding: 0 0 0.25rem 1rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  opacity: 1;
  visibility: visible;
  transform: none;
  display: none;
}
.peak-header.is-mobile .peak-header__menu li.is-open > .sub-menu {
  display: flex;
}
.peak-header.is-mobile .peak-header__menu .sub-menu a {
  border-left: 1px solid var(--_line);
  border-radius: 0 var(--peak-radius-sm, 6px) var(--peak-radius-sm, 6px) 0;
}
body.peak-nav-open {
  overflow: hidden;
}

/* Slide-in panel */
.peak-header.is-mobile.is-m-slide .peak-header__menu {
  position: fixed;
  top: 0;
  bottom: 0;
  left: auto;
  right: 0;
  width: min(360px, 86vw);
  max-height: none;
  padding-top: calc(var(--_h) + 0.75rem);
  border-bottom: 0;
  border-left: 1px solid var(--peak-border, rgba(25, 25, 25, 0.1));
  display: block;
  transform: translateX(100%);
  transition: transform 0.28s var(--_ease);
}
.peak-header.is-mobile.is-m-slide .peak-header__menu.is-open {
  transform: translateX(0);
}

/* Fullscreen overlay */
.peak-header.is-mobile.is-m-fullscreen .peak-header__menu {
  position: fixed;
  inset: 0;
  max-height: none;
  padding: calc(var(--_h) + 1.5rem) var(--peak-gutter, 1.25rem) 2rem;
  border: 0;
  background: var(--peak-canvas, #f7f3f0);
}
.peak-header.is-mobile.is-m-fullscreen .peak-header__menu a {
  font-size: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
  .peak-header *,
  .peak-header {
    transition-duration: 0.01ms !important;
  }
}

/* ---- Social profiles ----------------------------------------------------
   The builder's `socials` element. Deliberately plain: the Social Links widget
   is where shapes and brand colours live, and a header assembled in the panel
   should look like the rest of the header, not like a widget dropped into it. */

.peak-header__socials {
	display: flex;
	align-items: center;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.peak-header__socials li { margin: 0; }

.peak-header__social {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: var(--peak-radius-pill, 9999px);
	color: inherit;
	opacity: 0.7;
	text-decoration: none;
	transition: opacity 0.15s var(--peak-ease, cubic-bezier(0.2, 0.7, 0.2, 1)), background-color 0.15s var(--peak-ease, cubic-bezier(0.2, 0.7, 0.2, 1));
}
.peak-header__social:hover,
.peak-header__social:focus-visible {
	opacity: 1;
	background: var(--peak-inset, rgba(25, 25, 25, 0.045));
}
.peak-header__social-icon {
	width: 17px;
	height: 17px;
	display: block;
}

/* =========================================================================
 * Off-canvas drawer — the design assigned to the hamburger (a component or a
 * template built in Peak Builder). Slides in from the right behind a
 * backdrop; header-front.js drives `is-open` and the body class.
 * ========================================================================= */
.peak-header.has-oc.oc-always .peak-header__toggle {
  display: inline-flex;
}
.peak-header__toggle--solo {
  margin-left: auto;
}
.peak-header__oc {
  position: fixed;
  inset: 0;
  z-index: 10000;
}
.peak-header__oc[hidden] {
  display: none;
}
.peak-header__oc-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.peak-header__oc-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100%);
  overflow-y: auto;
  /* The header's own palette, opaque: the panel's colours when set, else the
     theme's canvas and ink — so a dark site gets a dark drawer. */
  background: var(--peak-h-bg, var(--peak-canvas, #f7f3f0));
  color: var(--peak-h-color, var(--peak-ink, #191919));
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  transition: transform 0.36s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.peak-header__oc.is-open .peak-header__oc-backdrop {
  opacity: 1;
}
.peak-header__oc.is-open .peak-header__oc-panel {
  transform: none;
}
.peak-header__oc-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.peak-header__oc-close:hover {
  background: rgba(127, 127, 127, 0.12);
}
.peak-header__oc-body {
  min-height: 100%;
  padding: 72px 28px 28px;
}
body.peak-oc-open {
  overflow: hidden;
}
@media (prefers-reduced-motion: reduce) {
  .peak-header__oc-panel,
  .peak-header__oc-backdrop {
    transition: none;
  }
}
