/**
 * System messages.
 *
 * Drupal injects these into `[data-drupal-messages]` from JavaScript, so the
 * markup comes from the theme's status-messages template and cannot be styled
 * through a component. They are presented as a centred card over a dimmed page,
 * the same treatment the old site used, rebuilt on the brochure's tokens.
 *
 * The old stylesheet framed the card with a red-to-violet gradient using a hex
 * outside the sanctioned palette; a red border carries the same emphasis with a
 * brand colour.
 */

/* `:has(.error-message)` rather than `:not(:empty)`: the markup leaves
   whitespace text nodes in the container, so an emptied container would still
   match `:not(:empty)` and keep covering the page. */
[data-drupal-messages]:has(.error-message) {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background-color: rgba(255, 255, 255, 0.85);
}

[data-drupal-messages]:has(.error-message) .error-message {
  width: 100%;
  max-width: 485px;
}

[data-drupal-messages]:has(.error-message) .error-message__wrapper {
  padding: var(--space-8) var(--space-6);
  border: var(--stroke-offer-w) solid var(--digicel-red);
  border-radius: var(--radius-lg);
  background: var(--bg-canvas);
  text-align: center;
}

[data-drupal-messages]:has(.error-message) .error-message__text {
  color: var(--fg-primary);
  font-family: var(--font-brand);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-normal);
}

[data-drupal-messages]:has(.error-message) .error-message__text em,
[data-drupal-messages]:has(.error-message) .error-message__text strong {
  color: var(--digicel-red);
  font-style: normal;
  font-weight: var(--weight-bold);
}

[data-drupal-messages]:has(.error-message) .error-message__button {
  margin-top: var(--space-6);
}

[data-drupal-messages]:has(.error-message) .error-message__button .close-message {
  padding: var(--space-3) var(--space-8);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--digicel-red);
  color: var(--fg-on-red);
  cursor: pointer;
  font-family: var(--font-brand);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-body);
}

/* More than one message at a time stacks inside the overlay. */
[data-drupal-messages]:has(.error-message) {
  flex-direction: column;
  gap: var(--space-4);
}
