/*
 * Daon overrides for the Usercentrics Web CMP v3 banner.
 *
 * The CMP renders inside a shadow root (`#usercentrics-cmp-ui`), which page
 * stylesheets such as `globals.css` cannot reach, so this file is attached
 * inside that shadow root by `UsercentricsStyleOverrides`. Served from this
 * origin, so it fits `style-src 'self'` with no CSP exception.
 *
 * Colours stay in the Usercentrics admin panel. This only brings the action
 * buttons in line with the site's own `Button` atom: a 48px pill sized to its
 * label (24px side padding, 14px/18px semibold), right-aligned, instead of the
 * CMP's default of stretching each button across the footer.
 *
 * Selectors start with `.cmp` so they outrank the CMP's own rules (e.g.
 * `footer .buttons-row>button`) without `!important`.
 */

.cmp footer .buttons-row > button,
.cmp footer .buttons > button {
  height: 48px;
  padding: 0 24px;
  border-radius: 9999px;
  /* Typography v2 `small` semibold. The variables come from the page's :root and inherit
   * into this shadow root. */
  font-size: var(--type-small-size);
  line-height: var(--type-small-line-height);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

/* Tablet/desktop: buttons keep their natural width and sit at the right of
 * the footer. */
.cmp footer.bottom .buttons:not(.mobile):not(.xs) {
  flex: 0 1 auto;
  margin-left: auto;
}

.cmp footer .buttons:not(.mobile):not(.xs) .buttons-row {
  justify-content: flex-end;
  column-gap: 12px;
}

.cmp footer .buttons:not(.mobile):not(.xs) .buttons-row > button {
  flex: 0 0 auto;
}

/* Mobile: the CMP does not add its `.mobile`/`.xs` classes at phone widths,
 * so the rules above still match there. Stack the buttons full width, one
 * per row, below the links. */
@media (width < 768px) {
  .cmp footer.bottom .buttons:not(.mobile):not(.xs) {
    flex: 1;
    margin-top: 10px;
  }

  .cmp footer .buttons:not(.mobile):not(.xs) .buttons-row {
    flex-direction: column;
    row-gap: 12px;
    width: 100%;
  }
}
