/* Replaces behaviour that Webflow, jQuery and Finsweet used to add at runtime */

/* First visit in this tab: show the loader before first paint, lock scroll until it finishes */
.is-first-visit .page-loader { display: flex; }
.is-first-visit body { overflow: hidden; }

/* The original hid the whole page until the loader script ran, so a script failure meant a blank page.
   The loader sits on top anyway, so the page can always be visible underneath. */
.page_wrap { opacity: 1; }

/* Menu open: lock page scroll without JS */
body:has(.nav-menu__checkbox:checked) { overflow: hidden; }

/* Scroll reveal: hidden only when JS is running and motion is allowed */
@media (prefers-reduced-motion: no-preference) {
  .js-reveal .nav_contain > *,
  .js-reveal .u-container > * { opacity: 0; }
}

/* Category filter tags keep their colour while checked (was inline styles set by JS) */
.category-tag:has(input:checked) .category-tag__bg-fill { background-color: var(--hover-background-color); }
.category-tag:has(input:checked) .category-tag__txt { color: var(--hover-text-color); }

/* Keyboard users can see which filter they are on */
.category-tag:has(input:focus-visible),
.resources-filters__tag:has(input:focus-visible) { outline: 2px solid currentColor; outline-offset: 2px; }

/* "Clear all" only when a filter is active (was a 100 ms polling timeout) */
.filters__clear-all { display: none; }
form:has(input[type=checkbox]:checked) .filters__clear-all { display: flex; }

/* Short laptop screens: smaller ad in the trending box (was a resize listener) */
@media (max-height: 778px) {
  .home-hero-trending .ad-wrp__placeholder { max-height: 6rem; }
}

/* Demo forms */
.demo-note { margin-top: .5rem; font-size: .875rem; opacity: .75; }

/* "Explore by Categories" overflowed its card on phones ("Categori|es"): scale the heading to the card width */
.ad__empty-wrp { container-type: inline-size; }
.card-heading.is--home-ad-grid-empty { font-size: min(var(--size--10rem), 30cqi); }
