/**
 * MIRL — site-wide header logo (V7 .topbar + default .mirl-header)
 * Loaded late on wp_enqueue_scripts so it wins over page bundles.
 */

/* -------------------------------------------------------------------------- */
/* V7 marketing shell (.topbar) — image logo, height-led sizing               */
/* -------------------------------------------------------------------------- */

.topbar .brand--has-logo,
.topbar .brand--has-logo .custom-logo-link {
  display: block;
  flex: 0 0 auto;
  width: auto;
  max-width: min(280px, 46vw);
  min-width: 0;
  line-height: 0;
}

.topbar .brand--has-logo img.custom-logo,
.topbar img.custom-logo,
.topbar .custom-logo {
  display: block;
  width: auto !important;
  max-width: 100% !important;
  height: 58px !important;
  max-height: 58px !important;
  object-fit: contain;
  object-position: left center;
}

/* Slightly more breathing room around logo + nav */
.topbar {
  padding: 18px 0 12px;
}

.topbar .topbar-inner {
  gap: 20px;
  padding: 14px 18px;
}

.topbar.is-scrolled {
  background: rgba(251, 250, 254, 0.78) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
}

.topbar .nav a:not(.nav-cta) {
  transition: color 0.2s ease, transform 0.2s ease;
}

.topbar .nav a:not(.nav-cta):hover,
.topbar .nav a:not(.nav-cta):focus-visible {
  color: var(--purple-deep);
  transform: translateY(-1px);
}

@media (max-width: 1020px) {
  .topbar .topbar-inner {
    position: relative;
  }

  .topbar .nav {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    z-index: 30;
  }

  .topbar .brand--has-logo,
  .topbar .brand--has-logo .custom-logo-link {
    max-width: min(260px, 50vw);
  }

  .topbar .brand--has-logo img.custom-logo,
  .topbar img.custom-logo,
  .topbar .custom-logo {
    height: 52px !important;
    max-height: 52px !important;
  }

  .topbar .topbar-inner {
    gap: 16px;
    padding: 13px 16px;
  }
}

@media (max-width: 680px) {
  .topbar .brand--has-logo,
  .topbar .brand--has-logo .custom-logo-link {
    max-width: min(220px, 58vw);
  }

  .topbar .brand--has-logo img.custom-logo,
  .topbar img.custom-logo,
  .topbar .custom-logo {
    height: 47px !important;
    max-height: 47px !important;
  }

  .topbar .topbar-inner {
    gap: 12px;
    padding: 12px 14px;
  }
}

/* -------------------------------------------------------------------------- */
/* Default theme header (.mirl-header)                                        */
/* -------------------------------------------------------------------------- */

.mirl-header__brand .custom-logo-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.mirl-header__brand .custom-logo {
  width: auto !important;
  max-width: min(280px, 46vw) !important;
  height: 58px !important;
  max-height: 58px !important;
  object-fit: contain;
  object-position: left center;
}

@media (max-width: 1020px) {
  .mirl-header__brand .custom-logo {
    height: 52px !important;
    max-height: 52px !important;
  }
}

@media (max-width: 680px) {
  .mirl-header__brand .custom-logo {
    height: 47px !important;
    max-height: 47px !important;
    max-width: min(220px, 58vw) !important;
  }
}

/* -------------------------------------------------------------------------- */
/* V7 nav: "Download MIRL" CTA — hover stays legible on purple pill          */
/* -------------------------------------------------------------------------- */

.topbar .nav a.nav-cta {
  color: #fff !important;
  transition:
    color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.topbar .nav a.nav-cta:hover,
.topbar .nav a.nav-cta:focus-visible {
  color: #fffbf5 !important;
  filter: brightness(1.08) saturate(1.06);
  box-shadow: 0 18px 38px rgba(54, 32, 112, 0.34);
  transform: translateY(-1px);
}

.topbar .nav a.nav-cta:active {
  transform: translateY(0);
  filter: brightness(0.97);
}
