/* CookieAlert — banner styles.
 *
 * The colours are the original CookieAlert values, so the banner looks exactly
 * as before; they live here (not inline in the script) so a theme can
 * restyle it with plain CSS — e.g.
 *
 *   #CookieAlert { background-color: #101418; color: #d7dce3; }
 *   #CookieAlert .cookie-alert__icon { fill: #f3c969; }
 */

.cookie-alert {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  padding: 10px;
  font-family: Arial;
  font-size: 14px;
}

.cookie-alert--dark {
  --cookie-alert-bg: #1b1b1b;
  background-color: var(--cookie-alert-bg);
  color: #999;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.1);
  border-top: 1px solid #444;
  border-bottom: 1px solid #444;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
}

.cookie-alert--light {
  --cookie-alert-bg: #fff;
  background-color: var(--cookie-alert-bg);
  color: #373737;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
  border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
}

.cookie-alert__text {
  display: inline-block;
  vertical-align: middle;
  text-align: center;
  width: calc(100% - 76px);
}

.cookie-alert__actions {
  display: inline-block;
  vertical-align: middle;
  text-align: right;
  width: 56px;
}

/* The policy link is an icon only: it keeps the banner's text colour, so the
   icon is not picked up from the theme's link colour. The help icon is the
   secondary action, so it sits a notch below the dismiss button. */
.cookie-alert__policy {
  color: inherit;
}

.cookie-alert--dark .cookie-alert__policy {
  color: #7d7d7d;
}

.cookie-alert--light .cookie-alert__policy {
  color: #6b6b6b;
}

.cookie-alert__policy,
.cookie-alert__close {
  position: relative;
  display: inline-block;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  vertical-align: middle;
}

/* WCAG 2.2 SC 2.5.8 "Target Size (Minimum)": the glyph is 24x24, and the
   clickable area is enlarged a little further with a transparent overlay, so
   the target is comfortable to hit on touch screens. The overlay does not take
   part in the layout, so the banner keeps its proportions. */
.cookie-alert__policy::before,
.cookie-alert__close::before {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  bottom: -2px;
  left: -2px;
}

.cookie-alert__close {
  margin-left: 8px;
}

.cookie-alert__icon {
  /* inline-block, so the theme's `svg { display: block }` reset cannot stack
     the two icons on top of each other */
  display: inline-block;
  width: 24px;
  height: 24px;
  vertical-align: -5px;
}

/* The solid square is the icon colour; the glyph is painted in the banner's
   background colour, which reads as a knockout. A theme that changes the
   banner background only has to set --cookie-alert-bg as well. */
.cookie-alert__frame {
  fill: currentColor;
}

.cookie-alert__glyph {
  fill: var(--cookie-alert-bg, #1b1b1b);
}

.cookie-alert__policy:focus-visible,
.cookie-alert__close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
