/**
 * Site-wide UI overrides (ERS / GROWCRM + marketing clone).
 */

[x-cloak] {
  display: none !important;
}

/* Hide desktop megamenu panels on mobile (safety net if Alpine is slow to init) */
@media (max-width: 1023px) {
  header.wp-block-group .nav-link-dropdown-container {
    display: none !important;
  }
}

/* Remove Nielsen/Tailwind teal (aqua) focus ring on all interactive elements */
a:focus,
a:focus-visible,
button:focus,
button:focus-visible,
[role="button"]:focus,
[role="button"]:focus-visible,
[role="menuitem"]:focus,
[role="menuitem"]:focus-visible,
[role="link"]:focus,
[role="link"]:focus-visible,
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible,
.wp-element-button:focus,
.wp-element-button:focus-visible,
.wp-block-button__link:focus,
.wp-block-button__link:focus-visible,
.top-level-nav:focus,
.top-level-nav:focus-visible,
.is-style-nlsn-nav-fallback-btn .wp-block-button__link:focus,
.is-style-nlsn-nav-fallback-btn .wp-block-button__link:focus-visible,
.is-style-nlsn-nav-btn .wp-block-button__link:focus,
.is-style-nlsn-nav-btn .wp-block-button__link:focus-visible,
.is-style-nlsn-solid-btn .wp-block-button__link:focus,
.is-style-nlsn-solid-btn .wp-block-button__link:focus-visible,
.is-style-nlsn-solid-fallback-btn .wp-block-button__link:focus,
.is-style-nlsn-solid-fallback-btn .wp-block-button__link:focus-visible,
.is-style-nlsn-outlined-fallback-btn .wp-block-button__link:focus,
.is-style-nlsn-outlined-fallback-btn .wp-block-button__link:focus-visible,
.nav-link-dropdown-container a:focus,
.nav-link-dropdown-container a:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  --tw-ring-shadow: 0 0 #0000 !important;
  --tw-ring-offset-shadow: 0 0 #0000 !important;
}

/* Megamenu visibility (marketing header) */
header.wp-block-group,
header.wp-block-group > nav,
header.wp-block-group .wp-block-nlsn-nav-link {
  overflow: visible !important;
}

header.wp-block-group.sticky {
  overflow: visible !important;
  isolation: auto;
}

@media (min-width: 1024px) {
  header.wp-block-group nav[role="menubar"],
  header.wp-block-group nav[role="menubar"] .wp-block-nlsn-nav-link {
    overflow: visible !important;
  }

  /* Escape backdrop-filter clipping on static deploy */
  .nav-link-dropdown-container {
    position: fixed !important;
    top: var(--ers-megamenu-top, 5rem) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: min(91.666667vw, 1280px) !important;
    max-width: calc(100vw - 2rem) !important;
    margin: 0 !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
  }

  .wp-block-nlsn-nav-link:hover > .nav-link-dropdown-container,
  .wp-block-nlsn-nav-link:focus-within > .nav-link-dropdown-container {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

.nav-link-dropdown-container {
  overflow: visible !important;
  z-index: 70 !important;
}

.nav-link-dropdown-container .wp-block-columns,
.nav-link-dropdown-container .wp-block-column {
  overflow: visible !important;
}

.nav-link-dropdown-container h6.wp-block-heading {
  margin: 0 0 0.75rem;
  line-height: 1.3;
  overflow: visible;
}

.nav-link-dropdown-container .wp-block-button.isfeatured,
.nav-link-dropdown-container .wp-block-buttons:has(.isfeatured) {
  overflow: visible !important;
  height: auto !important;
  min-height: 0 !important;
}

.nav-link-dropdown-container .isfeatured .wp-block-button__link {
  display: inline-block !important;
  height: auto !important;
  min-height: 0 !important;
  line-height: 1.35 !important;
  overflow: visible !important;
  padding: 0.2rem 0 !important;
  white-space: normal !important;
  word-break: break-word;
}

.nav-link-dropdown-container .isfeatured.has-large-font-size .wp-block-button__link,
.nav-link-dropdown-container .isfeatured .wp-block-button__link.has-large-font-size {
  font-size: 1.25rem !important;
}

.nav-link-dropdown-container figure.isfeatured {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  overflow: visible;
}

.nav-link-dropdown-container figure.isfeatured img {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: cover;
}

.nav-link-dropdown-container .ers-megamenu-highlight > p {
  margin: 0.5rem 0 0;
  line-height: 1.5;
}

/* App logo in marketing header (replaces Nielsen wordmark SVG) */
header nav > a:first-child .growcrm-site-logo,
header nav > a:first-child img.growcrm-site-logo {
  display: block;
  width: auto;
  max-width: 180px;
  height: auto;
  max-height: 48px;
  object-fit: contain;
}

/* Home hero — responsive animated headline */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ers-home-hero-cover {
  overflow-x: clip;
  min-height: 663px !important;
  aspect-ratio: unset !important;
}

@media (max-width: 640px) {
  .ers-home-hero-cover {
    min-height: clamp(22rem, 70vh, 663px) !important;
  }
}

.ers-home-hero-cover .wp-block-cover__inner-container,
.ers-home-hero-cover .wp-block-column {
  min-width: 0;
  max-width: 100%;
  text-align: left;
}

.ers-home-hero-cover .wp-block-columns.alignwide {
  flex-wrap: wrap !important;
}

.ers-home-hero-cover .wp-block-columns.alignwide > .wp-block-column {
  flex-basis: 100% !important;
  max-width: 100%;
}

/* Kill Nielsen bleed rules inside our hero */
.ers-home-hero-cover figure.animated-header,
.ers-home-hero-cover figure.animated-header .ers-animated-hero-text {
  display: block;
  width: 100%;
  max-width: 100% !important;
  margin: 0 !important;
  text-align: left;
}

.ers-home-hero-cover figure.animated-header img,
.ers-home-hero-cover .ers-hero-line-logo {
  display: block;
  max-width: min(32vw, 140px) !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
}

/* Fade rotation — one line visible at a time (linear cuts prevent ghosting) */
.ers-animated-hero-text {
  position: relative;
  width: 100%;
  min-height: clamp(4rem, 11vw, 6.75rem);
  margin: 0 0 0.75rem;
  overflow: hidden;
}

.ers-home-hero-cover .ers-animated-hero-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  flex-wrap: nowrap;
  max-width: 100%;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.08 !important;
  font-size: clamp(1.35rem, 3.2vw + 0.5rem, 3.75rem) !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  animation-duration: 12s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.ers-home-hero-cover .ers-animated-hero-line--1 {
  animation-name: ers-hero-show-1;
}

.ers-home-hero-cover .ers-animated-hero-line--2 {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  animation-name: ers-hero-show-2;
}

.ers-home-hero-cover .ers-animated-hero-line--3 {
  display: block;
  animation-name: ers-hero-show-3;
}

.ers-animated-hero-line--brand {
  flex-wrap: nowrap;
}

.ers-home-hero-cover .ers-animated-hero-line--brand span {
  white-space: nowrap;
}

.ers-hero-line-logo {
  display: block;
  width: auto;
  max-height: clamp(1.75rem, 4.5vw, 3rem);
  max-width: min(32vw, 140px);
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

.ers-hero-br {
  display: none;
}

.ers-hero-mobile-stack {
  display: block;
  text-align: left;
}

.ers-hero-mobile-lines {
  margin: 0 0 0.75rem;
}

.ers-hero-mobile-lines p {
  margin: 0 0 0.5rem;
  font-size: clamp(1.2rem, 4vw, 1.65rem) !important;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.15;
}

.ers-hero-mobile-lines-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ers-hero-mobile-lines-brand .ers-hero-line-logo {
  max-height: 36px;
  max-width: 120px;
}

.ers-home-hero-cover .green-button .wp-block-button__link {
  border-color: #fff !important;
  color: #fff !important;
}

.ers-home-hero-cover .space-mono-regular.has-body-emphasis-font-size {
  font-size: clamp(0.875rem, 2vw + 0.25rem, 1.375rem) !important;
  line-height: 1.35;
  margin-top: 0.25rem;
}

/* Prevent 100vw header from causing horizontal scroll */
header.wp-block-group.w-screen {
  width: 100%;
  max-width: 100%;
}

@keyframes ers-hero-show-1 {
  0%,
  33.3% {
    opacity: 1;
    visibility: visible;
  }
  33.31%,
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes ers-hero-show-2 {
  0%,
  33.3% {
    opacity: 0;
    visibility: hidden;
  }
  33.31%,
  66.6% {
    opacity: 1;
    visibility: visible;
  }
  66.61%,
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes ers-hero-show-3 {
  0%,
  66.6% {
    opacity: 0;
    visibility: hidden;
  }
  66.61%,
  99.9% {
    opacity: 1;
    visibility: visible;
  }
  99.91%,
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@media (min-width: 768px) {
  .ers-hero-br {
    display: inline;
  }

  .ers-animated-hero-text {
    min-height: clamp(4.5rem, 9vw, 6.75rem);
  }
}

@media (min-width: 1024px) {
  .ers-hero-mobile-stack {
    display: none !important;
  }

  .ers-home-hero-cover figure.animated-header {
    display: block !important;
  }

  .ers-home-hero-cover .ers-animated-hero-line {
    font-size: clamp(1.85rem, 2.8vw, 3.5rem) !important;
  }
}

@media (max-width: 1023px) {
  .ers-home-hero-cover figure.animated-header {
    display: none !important;
  }

  .ers-hero-mobile-stack {
    display: block !important;
  }
}

@media (max-width: 640px) {
  .ers-hero-mobile-lines p {
    font-size: clamp(1.05rem, 5.5vw, 1.35rem) !important;
  }

  .ers-hero-mobile-lines-brand .ers-hero-line-logo {
    max-height: 28px;
    max-width: 96px;
  }

  header nav > a:first-child .growcrm-site-logo,
  header nav > a:first-child img.growcrm-site-logo {
    max-width: 140px;
    max-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ers-home-hero-cover .ers-animated-hero-line {
    position: static;
    opacity: 1;
    visibility: visible;
    animation: none;
  }

  .ers-animated-hero-text {
    min-height: 0;
  }

  .ers-home-hero-cover .ers-animated-hero-line + .ers-animated-hero-line {
    margin-top: 0.35rem;
  }
}
