/**
 * 010/HU8 (FR-033 / SC-008) — modal announcement styles.
 *
 * Theme-aware (light/dark via CSS custom properties with safe fallbacks) and
 * honors prefers-reduced-motion: animations are only applied when the visitor
 * has NOT requested reduced motion.
 */

.dpy-announcement[hidden] {
  display: none;
}

.dpy-announcement {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.dpy-announcement__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.dpy-announcement__dialog {
  position: relative;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  background: var(--dpy-color-surface, #ffffff);
  color: var(--dpy-color-fg, #111827);
  border: 1px solid var(--dpy-color-border, #e5e7eb);
  border-radius: var(--dpy-radius-lg, 14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  padding: 24px;
  outline: none;
}

.dpy-announcement__sr-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dpy-announcement__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  border: 1px solid var(--dpy-color-border, #e5e7eb);
  border-radius: 50%;
  background: var(--dpy-color-surface, #ffffff);
  color: var(--dpy-color-fg, #111827);
  cursor: pointer;
}

.dpy-announcement__close:hover,
.dpy-announcement__close:focus-visible {
  background: var(--dpy-color-bg, #f3f4f6);
  outline: 2px solid var(--dpy-color-focus, #2563eb);
  outline-offset: 1px;
}

.dpy-announcement__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dpy-announcement__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--dpy-radius-md, 10px);
}

.dpy-announcement__html {
  font-family: var(--dpy-font-sans, inherit);
  font-size: 1rem;
  line-height: 1.5;
}

.dpy-announcement__html a {
  color: var(--dpy-color-primary, #2563eb);
}

@media (prefers-reduced-motion: no-preference) {
  .dpy-announcement.is-open .dpy-announcement__dialog {
    animation: dpy-announcement-in 0.22s ease-out;
  }
  .dpy-announcement.is-open .dpy-announcement__backdrop {
    animation: dpy-announcement-fade 0.22s ease-out;
  }
}

@keyframes dpy-announcement-in {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes dpy-announcement-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
