/* =========================================================
   MILO COMPONENT CONTRACT
   File: milo-header.css
   Layer: Header Module (Shell + Row + Logo + CTA)
   Version: 3.0
========================================================= */

/* #region 0) HEADER TOKENS */
header.milo-header {
  --milo-scrim-top: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.35),
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0)
  );

  /* Layer */
  --milo-header-z: var(--milo-z-header);

  /* Shell surface */
  --milo-header-bg-top: var(--milo-scrim-top);
  --milo-header-bg-engaged: var(--milo-glass-dark);
  --milo-header-blur: var(--milo-glass-blur);
  --milo-header-shadow-nav-open: 0 8px 24px var(--milo-shadow-color-16);

  /* Divider */
  --milo-header-divider: var(--milo-divider-strong);
  --milo-header-divider-opacity: 0;
  --milo-header-divider-opacity-engaged: 1;

  /* Shell padding */
  --milo-header-shell-pad: 10px 50px;

  /* Inner row */
  --milo-header-gap-right: var(--milo-gap-inline-md);
  --milo-header-pad-y: var(--milo-header-pad-y, 14px);
  --milo-header-pad-y-scrolled: var(--milo-header-pad-y-scrolled, 10px);

  /* Motion */
  --milo-header-ease: var(--milo-ease);
  --milo-header-fast: var(--milo-dur-180, var(--milo-fast));
  --milo-header-med: var(--milo-dur-220, var(--milo-med));
  --milo-header-slow: var(--milo-slow);

  /* Accent */
  --milo-header-accent: var(--milo-pink);

  /* Focus */
  --milo-header-focus: var(--milo-focus-strong);
  --milo-header-focus-w: var(--milo-outline-w);
  --milo-header-focus-offset: var(--milo-outline-offset);
  --milo-header-focus-radius: var(--milo-radius-sm);

  /* CTA base */
  --milo-header-cta-radius: var(--milo-radius-pill, 999px);
  --milo-header-cta-bg: var(--milo-pink);
  --milo-header-cta-fg: var(--milo-ink);
  --milo-header-cta-border: transparent;
  --milo-header-cta-pad-y: var(--milo-control-pad-y);
  --milo-header-cta-pad-x: var(--milo-control-pad-x);
  --milo-header-cta-gap: 8px;

  /* CTA scrolled */
  --milo-header-cta-pad-y-scrolled: 10px;
  --milo-header-cta-pad-x-scrolled: 16px;

  /* CTA hover / active */
  --milo-header-cta-bg-hover: var(--milo-pink-wash);
  --milo-header-cta-fg-hover: var(--milo-header-accent);
  --milo-header-cta-border-hover: var(--milo-pink-strong);
  --milo-header-cta-shadow-hover:
    0 0 0 1px var(--milo-shadow-highlight-pink),
    0 10px 28px var(--milo-shadow-ambient-strong);
  --milo-header-cta-shadow-active:
    0 0 0 1px var(--milo-shadow-highlight-pink-strong),
    0 6px 16px var(--milo-shadow-ambient);
  --milo-header-cta-shift-hover: -1px;
  --milo-header-cta-shift-active: 0px;

  /* Logo */
  --milo-header-logo-h: 28px;
  --milo-header-logo-opacity-hover: 0.98;
  --milo-header-logo-shift-hover: -1px;
  --milo-header-logo-type-fill: #c8c9c9;
  --milo-header-logo-type-fill-hover: rgba(200, 201, 201, 0.92);
  --milo-header-logo-type-fill-engaged: var(--milo-white-pure);

  /* Image widget logo */
  --milo-header-image-shift-hover: -1px;
  --milo-header-image-filter-hover: brightness(1.08) contrast(1.02);
  --milo-header-image-opacity-hover: 0.95;
  --milo-header-image-scale-engaged: 0.98;
}
/* #endregion */

/* #region 1) INITIAL LOAD SAFETY */
html:not(.milo-loaded) header.milo-header,
html:not(.milo-loaded) header.milo-header * {
  transition: none !important;
  animation: none !important;
}
/* #endregion */

/* #region 2) ELEMENTOR WRAPPER SAFETY */
header.elementor-location-header {
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  background: transparent !important;
}
/* #endregion */

/* #region 3) HEADER SHELL */
header.milo-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: var(--milo-header-z) !important;

  padding: var(--milo-header-shell-pad);
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  margin-block-start: 0 !important;

  overflow: visible !important;
  background: var(--milo-header-bg-top);
  border: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  transform: translateZ(0);

  transition:
    background var(--milo-header-med) var(--milo-header-ease),
    box-shadow var(--milo-header-med) var(--milo-header-ease),
    backdrop-filter var(--milo-header-med) var(--milo-header-ease),
    -webkit-backdrop-filter var(--milo-header-med) var(--milo-header-ease);
}

header.milo-header,
header.milo-header .e-con,
header.milo-header .e-con-inner {
  overflow: visible !important;
}
/* #endregion */

/* #region 4) LOAD-IN */
html.milo-loaded header.milo-header {
  animation: miloHeaderIn var(--milo-header-slow) var(--milo-header-ease)
    forwards;
}

@keyframes miloHeaderIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* #endregion */

/* #region 5) ENGAGED SURFACE */
header.milo-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  pointer-events: none;
  opacity: var(--milo-header-divider-opacity);
  background: var(--milo-header-divider);
  transition: opacity var(--milo-header-med) var(--milo-header-ease);
}

header.milo-header.milo-scrolled,
html.milo-nav-open header.milo-header {
  background: var(--milo-header-bg-engaged) !important;
  -webkit-backdrop-filter: blur(var(--milo-header-blur)) !important;
  backdrop-filter: blur(var(--milo-header-blur)) !important;
}

header.milo-header.milo-scrolled::after,
html.milo-nav-open header.milo-header::after {
  opacity: var(--milo-header-divider-opacity-engaged);
}

html.milo-nav-open header.milo-header {
  box-shadow: var(--milo-header-shadow-nav-open);
}
/* #endregion */

/* #region 6) LAYOUT CONTRACT */
header.milo-header .milo-header__inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
}

header.milo-header .milo-header__left {
  flex: 0 0 auto !important;
  min-width: 0 !important;
}

header.milo-header .milo-header__right {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: nowrap !important;
  gap: var(--milo-header-gap-right) !important;
}

header.milo-header .milo-header__inner.e-con,
header.milo-header .milo-header__inner.e-con > .e-con-inner {
  height: auto !important;
  min-height: 0 !important;
}

header.milo-header .milo-header__inner.e-con {
  padding-top: var(--milo-header-pad-y) !important;
  padding-bottom: var(--milo-header-pad-y) !important;
  transition:
    padding-top var(--milo-header-med) var(--milo-header-ease) !important,
    padding-bottom var(--milo-header-med) var(--milo-header-ease) !important;
}
/* #endregion */

/* #region 7) SCROLLED COMPRESSION */
header.milo-header.milo-scrolled .milo-header__inner.e-con {
  padding-top: var(--milo-header-pad-y-scrolled) !important;
  padding-bottom: var(--milo-header-pad-y-scrolled) !important;
}
/* #endregion */

/* #region 8) FOCUS */
header.milo-header .milo-cta-btn a.elementor-button:focus-visible,
header.milo-header .milo-logo:focus-visible {
  outline: var(--milo-header-focus-w) solid var(--milo-header-focus);
  outline-offset: var(--milo-header-focus-offset);
  border-radius: var(--milo-header-focus-radius);
}
/* #endregion */

/* #region 9) CTA */
header.milo-header .milo-cta-btn {
  flex: 0 0 auto !important;
  width: auto !important;
}

header.milo-header .milo-cta-btn a.elementor-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: var(--milo-header-cta-gap) !important;
  width: auto !important;
  padding: var(--milo-header-cta-pad-y) var(--milo-header-cta-pad-x) !important;
  line-height: 1 !important;

  background: var(--milo-header-cta-bg) !important;
  color: var(--milo-header-cta-fg) !important;
  text-decoration: none !important;

  border: 1px solid var(--milo-header-cta-border) !important;
  border-radius: var(--milo-header-cta-radius) !important;
  box-shadow: none !important;

  transition:
    background var(--milo-header-fast) var(--milo-header-ease),
    color var(--milo-header-fast) var(--milo-header-ease),
    border-color var(--milo-header-fast) var(--milo-header-ease),
    box-shadow var(--milo-header-med) var(--milo-header-ease),
    transform var(--milo-header-fast) var(--milo-header-ease);
}

header.milo-header .milo-cta-btn a.elementor-button .elementor-button-text,
header.milo-header
  .milo-cta-btn
  a.elementor-button
  .elementor-button-content-wrapper {
  color: inherit !important;
}

header.milo-header .milo-cta-btn a.elementor-button:hover,
header.milo-header .milo-cta-btn a.elementor-button:focus-visible {
  background: var(--milo-header-cta-bg-hover) !important;
  color: var(--milo-header-cta-fg-hover) !important;
  border-color: var(--milo-header-cta-border-hover) !important;
  transform: translateY(var(--milo-header-cta-shift-hover)) !important;
  box-shadow: var(--milo-header-cta-shadow-hover) !important;
}

header.milo-header .milo-cta-btn a.elementor-button:active {
  transform: translateY(var(--milo-header-cta-shift-active)) !important;
  box-shadow: var(--milo-header-cta-shadow-active) !important;
}

header.milo-header.milo-scrolled .milo-cta-btn a.elementor-button {
  padding: var(--milo-header-cta-pad-y-scrolled)
    var(--milo-header-cta-pad-x-scrolled) !important;
}
/* #endregion */

/* #region 10) LOGO: SVG */
header.milo-header .milo-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  transform: translateZ(0);
  transition:
    transform var(--milo-header-med) var(--milo-header-ease),
    opacity var(--milo-header-med) var(--milo-header-ease);
}

header.milo-header .milo-logo__svg {
  display: block;
  width: auto;
  height: var(--milo-header-logo-h);
}

header.milo-header .milo-logo__pink {
  color: var(--milo-header-accent);
}

header.milo-header .milo-logo__type {
  fill: var(--milo-header-logo-type-fill);
}

header.milo-header .milo-logo__svg * {
  transition:
    fill var(--milo-header-med) var(--milo-header-ease),
    opacity var(--milo-header-med) var(--milo-header-ease),
    transform var(--milo-header-med) var(--milo-header-ease);
}

header.milo-header .milo-logo:hover {
  transform: translateY(var(--milo-header-logo-shift-hover));
  opacity: var(--milo-header-logo-opacity-hover);
}

header.milo-header .milo-logo:hover .milo-logo__type {
  fill: var(--milo-header-logo-type-fill-hover);
}

header.milo-header.milo-scrolled .milo-logo__type,
html.milo-nav-open header.milo-header .milo-logo__type {
  fill: var(--milo-header-logo-type-fill-engaged);
}
/* #endregion */

/* #region 11) LOGO: IMAGE WIDGET */
header.milo-header .elementor-widget-image a {
  display: inline-block;
  transition:
    transform var(--milo-header-med) var(--milo-header-ease),
    filter var(--milo-header-med) var(--milo-header-ease),
    opacity var(--milo-header-med) var(--milo-header-ease);
}

header.milo-header .elementor-widget-image img {
  display: block;
  transition:
    transform var(--milo-header-med) var(--milo-header-ease),
    filter var(--milo-header-med) var(--milo-header-ease),
    opacity var(--milo-header-med) var(--milo-header-ease);
}

header.milo-header .elementor-widget-image a:hover img {
  transform: translateY(var(--milo-header-image-shift-hover));
  filter: var(--milo-header-image-filter-hover);
  opacity: var(--milo-header-image-opacity-hover);
}

header.milo-header.milo-scrolled .elementor-widget-image img {
  transform: scale(var(--milo-header-image-scale-engaged));
}
/* #endregion */

/* #region 12) RESPONSIVE TOKENS */
@media (max-width: 1024px) {
  header.milo-header {
    --milo-header-pad-y: 12px;
    --milo-header-pad-y-scrolled: 9px;
    --milo-header-gap-right: 22px;
    --milo-header-logo-h: 26px;
  }
  header.milo-header .elementor-nav-menu__container {
    display: none;
  }
}

@media (max-width: 767.98px) {
  header.milo-header {
    --milo-header-pad-y: 10px;
    --milo-header-pad-y-scrolled: 8px;
    --milo-header-gap-right: 16px;
    --milo-header-logo-h: 24px;
  }

  header.milo-header .milo-cta-btn {
    align-content: start !important;
  }
}
/* #endregion */

/* #region 13) REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  header.milo-header,
  header.milo-header::after,
  header.milo-header *,
  header.milo-header .milo-logo,
  header.milo-header .milo-cta-btn a.elementor-button,
  header.milo-header .elementor-widget-image a,
  header.milo-header .elementor-widget-image img {
    transition: none !important;
    animation: none !important;
  }

  header.milo-header .milo-logo:hover,
  header.milo-header .milo-cta-btn a.elementor-button:hover,
  header.milo-header .milo-cta-btn a.elementor-button:active,
  header.milo-header .elementor-widget-image a:hover img,
  header.milo-header.milo-scrolled .elementor-widget-image img {
    transform: none !important;
  }
}
/* #endregion */
