/* =========================================================
 * OPA Alert Message
 * Full-bleed banner that slides down from the top of the page
 * and pushes content below it. The container is rendered via
 * `generate_before_header`, which fires outside .inner-header-container
 * so the banner extends to the full viewport edges.
 * ========================================================= */

/* Container: full-width, in normal document flow.
 * No positioning context so the alert pushes the header down. */
.alert-container {
  position: relative;
  width: 100%;
  z-index: 100;
}

/* Alert message: collapsed (max-height: 0) by default,
 * expands when the JS adds the `.show` class. The inline
 * background-color from the ACF field still wins over the
 * fallback color set here. */
.alert-message {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  font-size: 1rem;
  line-height: 1.4;
  /* Brand defaults — overridden by inline styles from the ACF color pickers */
  color: var(--white, #ffffff);
  background-color: var(--deep-pine, #0B4744);
  border-radius: 0;          /* full-bleed banner, no rounded corners */
  box-shadow: none;
  overflow: hidden;

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

  /* Slide-down animation */
  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;
}

/* Visible state — JS removes `.show`, injects HTML, then re-adds
 * `.show` after a 10ms timeout to retrigger the transition. */
.alert-message.show {
  max-height: 240px;
  padding: 16px 60px 16px 30px;
  opacity: 1;
}

/* Inner content reset */
.alert-message p {
  margin: 0;
  padding: 0;
}

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

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

/* Close button — vertically centered, top-right corner */
.close-alert {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: inherit;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

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

/* Multiple stacked alerts shouldn't have rounded gaps between them */
.alert-message + .alert-message {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* Mobile: tighter padding so messages fit on small screens */
@media (max-width: 640px) {
  .alert-message {
    font-size: 0.9375rem;
    padding: 0 50px 0 16px;
  }
  .alert-message.show {
    padding: 12px 50px 12px 16px;
  }
  .close-alert {
    right: 12px;
    font-size: 22px;
  }
}

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