/* Mobile-only fix: prevent large blank gaps caused by `content-visibility` placeholders.
   On some mobile browsers the deferred rendering can leave a big empty area between sections. */
@media (max-width: 768px) {
  /* `contain-intrinsic-size: auto;` is invalid CSS (it needs a length).
     Use a valid value so the override actually applies on strict parsers. */
  .content-lazy,
  .cv-auto,
  section:not(.hero):not(.hero-section):not([class*="hero"]) {
    content-visibility: visible;
    contain-intrinsic-size: 0px 0px;
  }

  /* Prevent scroll anchoring jitter while accordions animate open/closed. */
  .faq,
  .faq-section,
  .faq-content,
  .faq-list,
  .faq-container {
    overflow-anchor: none;
  }
}

/* The dropdown uses staggered reveal styles that set `opacity: 0` on each link.
   If the animation doesn't run (common on some browsers), the dropdown looks blank.
   Force dropdown links to remain visible; the panel itself still controls visibility. */
.nav-dropdown a {
  opacity: 1 !important;
}

/* On touch devices, also disable the reveal animation to avoid flicker/jank. */
@media (hover: none) and (pointer: coarse) {
  .nav-dropdown a {
    transform: none;
    animation: none;
  }

  /* The custom cursor is for mouse devices; on touch it can cause odd repaint/jank. */
  .cursor-dot,
  .cursor-ring {
    display: none !important;
  }
}

/* Nav compatibility layer:
   Some pages still toggle `.active` / `.is-active` on the menu itself, while the shared CSS expects `.is-open`.
   Map those legacy classes to the same visible state so mobile nav works consistently. */
.nav-mobile-menu.active,
.nav-mobile-menu.is-active,
.nav-mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Some pages also toggle `.active` on the hamburger button. */
.nav-mobile-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-mobile-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-mobile-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
