/*
 * The consent banner (card 33, Figma V12 3693:2385, 3693:2392; in place 3693:2399, 3693:5698):
 * a navy card fixed at the bottom of the screen, 20 px from the sides and the bottom on a phone,
 * 24 px from the left and the bottom, 480 px wide, from 768 px. Under the header and its menu
 * (z-index 9 < 10), never over them. Fixed: it takes no room in the page, so nothing moves when
 * it comes or goes. The page behind stays usable: while it shows, the page ends with the room it
 * needs (--consent-banner-space, set by js/banner.js), in the footer's colour, under the footer
 * (which keeps its drawn size), so the page's end scrolls above it. Every value from tokens.css.
 */

body::after {
  content: "";
  flex: none;
  height: var(--consent-banner-space, 0px);
  background: var(--color-navy-900);
}

/* With scripting on, the room is there from the first layout (an upper bound: the banner on a
   320 px phone, or 480 px wide from 768 px), and js/banner.js only ever narrows it (exact, or 0
   once a choice is stored). A page that grows after load would leave a link to a heading near
   its end short of the heading in Firefox, which keeps the scroll range it had at load. */
@media (scripting: enabled) {
  body::after {
    height: var(--consent-banner-space, 320px);
  }
}

@media (scripting: enabled) and (min-width: 768px) {
  body::after {
    height: var(--consent-banner-space, 240px);
  }

  /* Card 36: the French and German sentences take one more line (260 px measured from 768 px,
     in the three browsers); on a phone they fit the 320 px above. */
  html:lang(fr) body::after,
  html:lang(de) body::after {
    height: var(--consent-banner-space, 264px);
  }
}

.consent-banner {
  position: fixed;
  z-index: 9;
  right: var(--page-margin);
  bottom: calc(var(--space-20) + env(safe-area-inset-bottom, 0px));
  left: var(--page-margin);
  display: flex;
  flex-direction: column;
  gap: var(--space-20);
  padding: var(--space-20);
  border-radius: var(--radius-card);
  background: var(--color-navy-900);
  color: var(--color-white);
}

.consent-banner__text {
  font-size: var(--text-body-size);
  line-height: var(--text-body-line);
}

/* "Cookies page": underlined; under 1280 px a 44 px tall touch area that does not move the line. */
.consent-banner__link {
  display: inline-block;
  margin-block: -10px;
  padding-block: 10px;
  text-decoration: underline;
}

.consent-banner__link:focus-visible,
.consent-banner__button:focus-visible {
  outline-color: var(--color-accent);
}

.consent-banner__buttons {
  display: flex;
  gap: var(--space-12);
}

/* Refuse and Accept: the same style and the same width. */
.consent-banner__button {
  flex: 1 1 0;
  min-width: 0;
  height: var(--button-height);
  padding: 0 var(--space-24);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-white);
  color: var(--color-petrol-900);
  font: inherit;
  font-size: var(--text-button-size);
  line-height: var(--text-button-line);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

@media (min-width: 768px) {
  .consent-banner {
    right: auto;
    bottom: calc(var(--space-24) + env(safe-area-inset-bottom, 0px));
    left: var(--space-24);
    width: 480px;
    padding: var(--space-24);
  }
}

@media (min-width: 1280px) {
  .consent-banner__link {
    margin-block: 0;
    padding-block: 0;
  }
}
