// Cookie consent gate — see plugins/cookiebot-gate.js for the class toggling.
//
// Cookiebot's banner does not block the page on its own, so visitors browsed
// (and were counted) without ever answering it. The overlay below swallows
// every click, tap and scroll aimed at the page while the banner is up.

// #CybotCookiebotDialog renders at 2147483631. The overlay has to sit directly
// underneath it: high enough to cover the whole site, low enough that the
// banner stays clickable.
$cookiebot-dialog-z: 2147483631;

html.cb-gate,
body.cb-gate {
  overflow: hidden;
  // Stops the scroll chaining that lets iOS Safari keep moving the page even
  // with overflow hidden.
  overscroll-behavior: none;
}

body.cb-gate {
  &::before {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.6);
    // Belt and braces: the element is opaque to pointer events anyway, but be
    // explicit, since a global `pointer-events: none` rule elsewhere would
    // silently defeat the whole gate.
    pointer-events: auto;
    touch-action: none;
    z-index: $cookiebot-dialog-z - 1;
  }
}
