/* Cookie consent banner (Views/Shared/_CookiePopUp.cshtml, rendered from Home only).
   Linked from that partial, so the rest of the site no longer downloads it.

   The <link> sits immediately before the #popup-box markup: a stylesheet link in the body still
   blocks rendering of the content that follows it, so the banner never paints unstyled.

   `transform` is load-bearing for the reveal - cookiePopUp.js toggles .is-visible - so do not add a
   reduced-motion override that redeclares it. If a transition is ever added here, disable it from
   ONE @media (prefers-reduced-motion: reduce) block at the END of this file, motion properties only.

   Centred by auto inline margins between left:0 and right:0 rather than by a hardcoded offset. The
   old rule had no `left` at all - just width:40% with margin-left:18% - so the banner sat left of
   centre and drifted further as the viewport grew. translateX(-50%) is avoided on purpose. */
#popup-box {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 40%;
  margin-inline: auto;
  display: none;
  justify-content: center;

  /* THE LAYER CONTRACT FOR THIS TEMPLATE, lowest to highest:

       content and sticky chrome   up to 1080 (skip link; Bootstrap's .fixed-top navbar is 1030)
       #popup-box                  9990   <- here
       .confetti-container         9998   (pointer-events: none, so it never blocks anything)
       .loading-overlay            9999
       .dialog-overlay            10000
       .toast-container           10001

     This banner used to be 10001, level with the toasts and above the dialog, and it covered the
     bottom of every modal. At 375px that is the button row: hit-testing the centre of a dialog's
     "Close" returned this element, so the control was mouse-untappable at its centre and, since
     dialog.js traps Tab inside the dialog, keyboard-unreachable while still being visibly focused.
     WCAG 2.4.11 Focus Not Obscured (Minimum), AA.

     A modal is the topmost layer by definition, so the banner belongs under it, where the overlay
     scrim dims it along with the rest of the page. Do not raise this back above 10000; the dialog
     cannot be raised instead, because the toasts sit above it on purpose (see toast.css).
     dialog-is-the-top-layer.test.py asserts this ordering. */
  z-index: 9990;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 0.75rem 1rem;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

#popup-box.is-visible {
  display: flex;
  visibility: visible;
}

#popup-box .toast-body {
  flex: 1 1 auto;
  padding: 0.25rem 0.5rem;
}

/* 63% of a 375px screen is 236px, which left 69px of dead margin on EACH side and made the
   text wrap far more than it needed to. Measured at 375x812: one button at 63% was 154px
   tall; adding the decline button took it to 274px, because the narrower text column wrapped
   further. That matters more here than it looks - the banner is fixed over the page, so
   height is page content it covers (WCAG 2.4.11 Focus Not Obscured; see the z-index contract
   above). At calc(100% - 1.5rem) the Yes/No pair fits in 130px, which is 24px SHORTER than
   the single-button banner that ships today, with a 12px gutter each side. */
@media only screen and (max-width: 600px) {
  #popup-box {
    width: calc(100% - 1.5rem);
  }
}

/* The Yes/No pair (NOVA-5943). A gap rather than a margin on the buttons, so neither button needs
   to know it has a neighbour, and nowrap so the two never stack - a stacked pair makes the banner
   taller, and this banner sits over the page, where extra height covers more of it (WCAG 2.4.11;
   see the z-index contract above). Both buttons keep the full .btn hit area, which is what 2.5.8
   Target Size turns on - do not shrink them to fit. */
.cookie-consent-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
}
