/* ============================================
   Admin-managed features: festival popup
   ============================================ */

.cms-popup {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 16px;
}

.cms-popup[hidden] { display: none; }

.cms-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 20, 8, 0.72);
  backdrop-filter: blur(3px);
  animation: cms-popup-fade 0.3s ease both;
}

.cms-popup-card {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: #fff;
  color: #1a1a1a;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  animation: cms-popup-in 0.45s var(--ease-power, ease) both;
}

.cms-popup-card--text { border-top: 6px solid var(--jd-yellow, #FFDE00); }

.cms-popup-img {
  display: block;
  width: 100%;
  height: auto;
}

.cms-popup-body {
  padding: 22px 24px 26px;
  text-align: center;
}

.cms-popup-title {
  margin: 0 0 8px;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  line-height: 1.3;
  color: var(--jd-green-dark, #1a5e1a);
}

.cms-popup-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: #3a3a3a;
}

.cms-popup-btn { margin-top: 18px; }

.cms-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.cms-popup-close:hover { background: rgba(0, 0, 0, 0.85); transform: scale(1.06); }
.cms-popup-close:focus-visible { outline: 3px solid var(--jd-yellow, #FFDE00); outline-offset: 2px; }

.cms-popup.is-closing .cms-popup-backdrop,
.cms-popup.is-closing .cms-popup-card { animation: cms-popup-out 0.22s ease both; }

@keyframes cms-popup-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cms-popup-in { from { opacity: 0; transform: translateY(24px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes cms-popup-out { to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .cms-popup-backdrop, .cms-popup-card { animation: none; }
}
