/**
 * ngo-announce.css
 * -----------------------------------------------------------------------
 * Self-contained styles for the announcement popup + marquee. Every
 * selector is prefixed `ngo-announce-` so this can be dropped into any
 * page without colliding with existing site styles. Does not read or
 * depend on any custom property defined elsewhere — all values are set
 * here.
 *
 * Two pieces:
 * - A centered modal card with a dimmed backdrop (shown first).
 * - A slim scrolling marquee bar at the very top of the page (shown
 *   after the modal is dismissed, or directly on a later visit).
 *
 * Colors are a warm pink, matching the NGO site's tone, but this file
 * does not require the site's own stylesheet to be present.
 * -----------------------------------------------------------------------
 */

/* ===================== Modal ===================== */

.ngo-announce-root {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  pointer-events: none;
}

.ngo-announce-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(58, 23, 41, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.ngo-announce-root.ngo-announce-is-visible .ngo-announce-backdrop {
  opacity: 1;
}

.ngo-announce-root.ngo-announce-is-visible {
  pointer-events: auto;
}

.ngo-announce-card {
  position: relative;
  width: min(420px, 100%);
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  opacity: 0;
  transform: scale(0.94) translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.ngo-announce-root.ngo-announce-is-visible .ngo-announce-card {
  opacity: 1;
  transform: scale(1) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .ngo-announce-backdrop,
  .ngo-announce-card {
    transition: none;
  }
}

.ngo-announce-card {
  background: #fff;
  border: 1px solid #f0d6e3;
  border-top: 5px solid #c81c72;
  border-radius: 1rem;
  box-shadow: 0 24px 60px rgba(58, 23, 41, 0.32);
  padding: 2rem 1.75rem 1.75rem;
  color: #3a1729;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  text-align: center;
}

.ngo-announce-card:focus {
  outline: none;
}

.ngo-announce-card:focus-visible {
  outline: 3px solid #1f6f5c;
  outline-offset: 2px;
}

.ngo-announce-content {
  display: block;
  color: inherit;
  text-decoration: none;
}

a.ngo-announce-content--clickable {
  cursor: pointer;
  border-radius: 0.6rem;
}

a.ngo-announce-content--clickable:hover .ngo-announce-title,
a.ngo-announce-content--clickable:hover .ngo-announce-cta {
  text-decoration: underline;
}

a.ngo-announce-content--clickable:focus-visible {
  outline: 3px solid #1f6f5c;
  outline-offset: 4px;
}

.ngo-announce-title {
  font-weight: 800;
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  color: #5c1240;
}

.ngo-announce-message {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

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

.ngo-announce-cta {
  display: inline-block;
  background: #c81c72;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  white-space: nowrap;
}

.ngo-announce-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 2.1rem;
  height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #5c1240;
  padding: 0;
}

.ngo-announce-close:hover {
  background: rgba(200, 28, 114, 0.12);
}

.ngo-announce-close:focus-visible {
  outline: 3px solid #1f6f5c;
  outline-offset: 2px;
}

.ngo-announce-close svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}

/* ===================== Marquee ===================== */
/* Inserted as the first child of <body>, in normal document flow (not
   fixed/sticky) — it sits above the site's own sticky header and simply
   scrolls away with the page, so it never needs to coordinate with the
   header's own sticky positioning or the chatbot's fixed corner. */

.ngo-announce-marquee {
  display: flex;
  align-items: stretch;
  position: relative;
  background: #5c1240;
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.ngo-announce-marquee.ngo-announce-marquee-is-visible {
  max-height: 3rem;
  opacity: 1;
}

.ngo-announce-marquee.ngo-announce-marquee-is-leaving {
  max-height: 0;
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .ngo-announce-marquee {
    transition: none;
  }
}

.ngo-announce-marquee__track {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  animation: ngo-announce-marquee-scroll 18s linear infinite;
}

.ngo-announce-marquee.ngo-announce-marquee-is-visible .ngo-announce-marquee__track {
  padding: 0.6rem 0;
}

@keyframes ngo-announce-marquee-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ngo-announce-marquee__track {
    animation: none;
    overflow-x: auto;
  }
}

.ngo-announce-marquee__text {
  flex: none;
  padding-right: 4rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
}

a.ngo-announce-marquee:hover .ngo-announce-marquee__text {
  text-decoration: underline;
}

a.ngo-announce-marquee:focus-visible {
  outline: 3px solid #ffd9ec;
  outline-offset: -3px;
}

.ngo-announce-marquee__close {
  flex: none;
  width: 3rem;
  background: rgba(0, 0, 0, 0.12);
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ngo-announce-marquee__close:hover {
  background: rgba(0, 0, 0, 0.22);
}

.ngo-announce-marquee__close:focus-visible {
  outline: 3px solid #ffd9ec;
  outline-offset: -3px;
}

.ngo-announce-marquee__close svg {
  width: 0.9rem;
  height: 0.9rem;
  display: block;
}
