/* Cookie choice banner (includes/cookie-banner.php, js/cookies.js).
   A full-width bar flush with the bottom of the viewport: text and buttons in
   one row from 64em up, stacked below it. Content lines up with the page
   container. Colours and shadows come from tokens, so the dark theme needs no
   rules here. */

.ck-banner {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--ffb-z-cookies);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-block: var(--ffb-ck-pad-block) calc(var(--ffb-ck-pad-block) + env(safe-area-inset-bottom, 0px));
  padding-inline: max(var(--ffb-gutter), (100% - var(--ffb-container)) / 2);
  border-top: 1px solid var(--ffb-card-border);
  background: var(--ffb-surface-grey);
  box-shadow: var(--ffb-shadow-ck-bar);
  color: var(--ffb-text-body);
  animation: ck-in var(--ffb-t-menu) ease both;
}

/* The signed-in shell carries Chatbase's bubble (64px, 20px in) at the bottom
   right, which draws above everything. Below 64em leave an empty strip under
   the buttons for it. */
.ck-banner--secure {
  padding-bottom: calc(var(--ffb-mira-nudge-bottom) + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 64em) {
  .ck-banner {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
  }

  /* From here the bar is one row: keep the buttons left of the bubble instead. */
  .ck-banner--secure {
    padding-right: max(
      var(--ffb-mira-nudge-right) + 4rem + var(--ffb-ck-inset),
      (100% - var(--ffb-container)) / 2
    );
    padding-bottom: calc(var(--ffb-ck-pad-block) + env(safe-area-inset-bottom, 0px));
  }
}

.ck-banner__text {
  flex: 1 1 auto;
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  text-align: left;
}

.ck-banner__link {
  color: var(--ffb-blue);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.ck-banner__link:hover {
  color: var(--ffb-blue-hover);
}

.ck-banner__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.ck-banner__btn {
  padding: 0.625rem 1.5rem;
  font-size: 0.9375rem;
  white-space: nowrap;
  cursor: pointer;
}

@keyframes ck-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ck-banner {
    animation: none;
  }
}
