/* =========================================================
 * MSI Site Alerts
 * Full-bleed banner that slides down from the top of the page
 * and pushes content below it.
 *
 * Override per site by copying this file to
 * {your-theme}/msi-alerts/alert-message.css — the plugin loads
 * the theme copy instead. Colors come from inline styles set by
 * the ACF pickers (or the msi_alerts_default_colors filter).
 * ========================================================= */

.alert-container {
  position: relative;
  width: 100%;
  z-index: 100;
}

.alert-container[hidden] {
  display: none;
}

.alert-message {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  /* Set per alert (Text Size field) as an inline custom property. */
  font-size: var(--msi-alert-font-size, 1rem);
  line-height: 1.4;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;

  /* Collapsed */
  max-height: 0;
  padding: 0 60px 0 30px;
  opacity: 0;

  transition:
    max-height 0.45s cubic-bezier(0.25, 0.1, 0.25, 1),
    padding    0.45s cubic-bezier(0.25, 0.1, 0.25, 1),
    opacity    0.30s ease 0.10s;
}

.alert-message.show {
  max-height: 480px; /* room for larger text sizes; content beyond this is clipped */
  padding: 16px 60px 16px 30px;
  opacity: 1;
}

.alert-message p {
  margin: 0;
  padding: 0;
}

.alert-message p + p {
  margin-top: 0.5em;
}

.alert-message a {
  text-decoration: underline;
  color: inherit;
}

.alert-message a:hover {
  opacity: 0.85;
}

.alert-message .close-alert {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  border-radius: 4px;
  font-size: 26px;
  line-height: 1;
  color: inherit;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.alert-message .close-alert:hover,
.alert-message .close-alert:focus-visible {
  opacity: 1;
  background: none;
  color: inherit;
}

/* Keyboard users need to see where focus is. */
.alert-message .close-alert:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.alert-message + .alert-message {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

@media (max-width: 640px) {
  .alert-message {
    font-size: calc(var(--msi-alert-font-size, 1rem) * 0.9375);
    padding: 0 50px 0 16px;
  }
  .alert-message.show {
    padding: 12px 50px 12px 16px;
  }
  .alert-message .close-alert {
    right: 12px;
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .alert-message {
    transition: opacity 0.2s ease;
  }
}
