/* Prevent background scroll when modal open */
html.spooked-modal-open,
html.spooked-modal-open body {
  overflow: hidden;
}

/* Overlay */
.spooked-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 18px;
}
#spooked-modal-overlay[hidden]{display:none!important;}


/* Modal */
.spooked-modal {
  width: min(560px, 100%);
  border-radius: 14px;
  color: #f5f5f7;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.55);
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(90% 70% at 50% 35%, rgba(10, 15, 44, 0.22), rgba(5,8,22,0) 60%);
  outline: none;
  transform: translateY(6px) scale(0.99);
  opacity: 0;
  animation: spookedFadeIn 100ms ease-out forwards;
}

/* ===== Supercast-matched background ===== */


/* Blurred background image (featured image from modal page) */
.spooked-modal::before{
  content:"";
  position:absolute;
  inset:0;

  background: var(--modal-bg, none) center/contain no-repeat;

  /* tuned so transparent PNG logos still read */
 
  filter: blur(14px) saturate(.9) brightness(.95) contrast(1.05);

  transform: scale(1.05);
  pointer-events:none;
  z-index: 0;
  box-shadow: inset 0 0 180px rgba(255,255,255,.06);

}

/* Midnight overlay (Supercast-style) */
.spooked-modal::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(
      120% 90% at 50% 12%,
      rgba(10, 15, 45, 0.35),
      rgba(7, 11, 34, 0.85) 45%,
      rgba(5,8,22,.92) 75%
    ),
    linear-gradient(
      180deg,
      rgba(6, 10, 31, 0.88),
      rgba(5,8,22,.94)
    );
  pointer-events:none;
  z-index: 0;
  opacity: .94;
}



/* Background layers must NOT capture clicks - now included above mr
.spooked-modal::before,
.spooked-modal::after{
  pointer-events: none;
  z-index: 0;
}
*/

/* Content must be above background layers */
.spooked-modal__content{
  position: relative;
  z-index: 1;
}

/* Close stays on top */
.spooked-modal__close{
  position: absolute;
  z-index: 2;
}

/* Ensure the hidden attribute actually hides the overlay */
#spooked-modal-overlay[hidden] {
  display: none !important;
}
.spooked-modal-overlay { pointer-events: auto; }

.spooked-modal, .spooked-modal * { pointer-events: auto; }

@keyframes spookedFadeIn {
  to {
    transform: translateY(0) scale(1);
    opacity: .97;
  }
}

/* Close */
.spooked-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 26px;
  line-height: 1;
  padding: 6px 10px;
  background: transparent;
  color: rgba(245, 245, 247, 0.85);
  border: 0;
  cursor: pointer;
}

.spooked-modal__content {
  padding: 22px 20px 20px;
}

.spooked-modal__kicker {
  letter-spacing: 0.18em;
  font-size: 12px;
  opacity: 0.75;
  margin: 4px 0 10px;
}

.spooked-modal__title {
  font-size: 26px;
  line-height: 1.15;
  margin: 0 0 10px;
}

.spooked-modal__desc {
  margin: 0 0 18px;
  opacity: 0.9;
}

/* Buttons */
.spooked-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 14px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 650;
}

.spooked-btn--primary {
  background: #f5f5f7;
  color: #0b0b0f;
}

.spooked-btn--ghost {
  background: transparent;
  color: #f5f5f7;
  border-color: rgba(245, 245, 247, 0.35);
}

.spooked-modal__actions {
  display: grid;
  gap: 12px;
}

.spooked-modal__secondary {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.spooked-link {
  background: transparent;
  border: 0;
  color: rgba(245, 245, 247, 0.75);
  text-decoration: underline;
  cursor: pointer;
  padding: 8px 0;
}

/* Mobile tweaks */
@media (max-width: 420px) {
  .spooked-modal__title { font-size: 22px; }
}
/*Pull Modal from WP Page */
.spooked-modal__body p { margin: 0 0 12px; }
.spooked-modal__body a { color: inherit; }
.spooked-modal__body a:hover { color: var(--accent); }

/* Make WP Buttons block look on-brand inside the modal */
.spooked-modal__body .wp-block-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0 0; }
.spooked-modal__body .wp-block-button__link {
  border-radius: 999px;
  padding: 10px 14px;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.spooked-modal__body .wp-block-button__link:hover {
  border-color: rgba(255,255,255,.28);
}

/* Optional: if you mark one button as "Fill" in the editor, it looks primary */
.spooked-modal__body .is-style-fill .wp-block-button__link {
  background: linear-gradient(180deg, rgba(255,59,48,.95), rgba(255,59,48,.72));
  border-color: rgba(255,59,48,.35);
}
