/* Hivve upgrade prototype: shared interaction and responsive polish. */
:root {
  --hivve-motion-fast: 180ms cubic-bezier(0.22, 1, 0.36, 1);
  --hivve-motion-base: 420ms cubic-bezier(0.22, 1, 0.36, 1);
  --hivve-accent: var(--accent, #ff4757);
}

html {
  overflow-x: clip;
}

body {
  overflow-x: clip;
}

/* Some legacy pages use fixed-width nav/footer tracks on narrow viewports. */
@media (max-width: 768px) {
  body.hivve-upgrade-ready > nav,
  body.hivve-upgrade-ready > header,
  body.hivve-upgrade-ready > footer {
    min-width: 0 !important;
    max-width: 100vw !important;
    overflow-x: clip;
  }
}

body.hivve-upgrade-ready :where(a, button, input, textarea, select):focus-visible {
  outline: 2px solid var(--hivve-accent);
  outline-offset: 4px;
}

.hivve-progress {
  position: fixed;
  inset: 0 auto auto 0;
  width: 0;
  height: 2px;
  z-index: 100000;
  pointer-events: none;
  background: var(--hivve-accent);
  transform-origin: left center;
  transition: width 120ms linear;
}

.hivve-tactile {
  transition: transform var(--hivve-motion-fast), filter var(--hivve-motion-fast), opacity var(--hivve-motion-fast);
}

.hivve-tactile:hover {
  filter: brightness(1.04);
}

.hivve-tactile.hivve-pressed {
  transform: scale(0.975);
}

.hivve-reveal {
  opacity: 1 !important;
  transform: none !important;
}

.hivve-reveal.hivve-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* Homepage FAQ: preserve the row treatment while making answers scannable. */
.hivve-upgrade-ready .faqs .faq-item {
  position: relative;
}

.hivve-upgrade-ready .faqs .faq-question {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.hivve-upgrade-ready .faqs .faq-question::after {
  content: '+';
  flex: 0 0 auto;
  font-family: var(--font-body, Inter, sans-serif);
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  transition: transform var(--hivve-motion-fast);
}

.hivve-upgrade-ready .faqs .faq-item.is-open .faq-question::after {
  transform: rotate(45deg);
}

.hivve-upgrade-ready .faqs .faq-answer {
  max-height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: max-height 480ms cubic-bezier(0.22, 1, 0.36, 1), opacity 240ms ease, transform 480ms cubic-bezier(0.22, 1, 0.36, 1), margin 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hivve-upgrade-ready .faqs .faq-item.is-open .faq-answer {
  margin-top: 0.75rem;
  opacity: 1;
  transform: none;
}

@media (max-width: 768px) {
  body,
  main,
  header,
  footer {
    max-width: 100%;
  }

  .hivve-progress {
    height: 3px;
  }

  .hivve-upgrade-ready .faqs .faq-question {
    gap: 0.75rem;
  }

  .hivve-upgrade-ready .dispatch-section > div {
    width: 100%;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .hivve-upgrade-ready .dispatch-section h2 {
    max-width: 100%;
    font-size: clamp(1.6rem, 7.2vw, 2rem) !important;
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hivve-progress,
  .hivve-tactile,
  .hivve-reveal,
  .hivve-upgrade-ready .faqs .faq-question::after,
  .hivve-upgrade-ready .faqs .faq-answer {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
  }

  .hivve-reveal {
    opacity: 1;
    transform: none;
  }
}
