/**
 * Global status-message ribbon.
 *
 * Renders Drupal status/warning/error messages as fixed, dismissible bars at
 * the top of the viewport, above the nav and modals (login modal is z-index
 * 9999). Colors are darkened from the brand palette so white text meets
 * WCAG AA contrast. See js/message-ribbon.js for dismiss/auto-dismiss behavior.
 */

/* `.message-ribbon` is our server-rendered container (status-messages.html.twig).
   `[data-drupal-messages]` is the container Drupal.Message fills client-side on
   authenticated pages; both hold `.message-ribbon__item` bars. */
.message-ribbon,
[data-drupal-messages] {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  /* Let clicks pass through the gutters; individual bars re-enable pointers. */
  pointer-events: none;
}

/* Both server- and client-rendered messages live inside `.messages__wrapper`
   (see status-messages.html.twig and core's Drupal.Message). */
[data-drupal-messages] .messages__wrapper {
  display: flex;
  flex-direction: column;
}

.message-ribbon__item {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 24px;
  color: #ffffff;
  font-size: 15px;
  line-height: 1.45;
  /* A solid 1px white separator keeps consecutive same-colored bars distinct
     without a transparent gap that would let the nav show through. */
  border-bottom: 1px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  animation: message-ribbon-in 0.25s ease-out;
}

/* Urbanize blue (#03B0E0) is too light for white text; use a deeper blue of
   the same family for AA contrast. */
.message-ribbon__item--status {
  background-color: #036397;
}

.message-ribbon__item--warning {
  background-color: #a85d00;
}

.message-ribbon__item--error {
  background-color: #c0281f;
}

.message-ribbon__content {
  flex: 1 1 auto;
  margin: 0;
}

.message-ribbon__content a {
  color: #ffffff;
  text-decoration: underline;
}

.message-ribbon__content :last-child {
  margin-bottom: 0;
}

.message-ribbon__close {
  flex: 0 0 auto;
  margin-top: -2px;
  padding: 0 6px;
  background: transparent;
  border: 0;
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}

.message-ribbon__close:hover,
.message-ribbon__close:focus {
  opacity: 1;
}

.message-ribbon__item.is-dismissing {
  animation: message-ribbon-out 0.25s ease-in forwards;
}

@keyframes message-ribbon-in {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes message-ribbon-out {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-100%);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .message-ribbon__item,
  .message-ribbon__item.is-dismissing {
    animation: none;
  }
}
