/* 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: #faf5eb;
  border: 1px solid rgba(239, 226, 201, 0.24);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.55);
  position: relative;
  isolation: isolate;
  background: #100e0b;
  outline: none;
  transform: translateY(6px) scale(0.99);
  opacity: 0;
  animation: spookedFadeIn 100ms ease-out forwards;
}

/* Warm charcoal and parchment palette */


/* 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);

}

/* Warm dark overlay over the featured artwork */
.spooked-modal::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(
      120% 90% at 50% 12%,
      rgba(62, 48, 31, 0.35),
      rgba(24, 20, 15, 0.85) 45%,
      rgba(10, 9, 7, 0.92) 75%
    ),
    linear-gradient(
      180deg,
      rgba(24, 20, 15, 0.88),
      rgba(10, 9, 7, 0.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(250, 245, 235, 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: #faf5eb;
  color: #100e0b;
}

.spooked-btn--ghost {
  background: transparent;
  color: #faf5eb;
  border-color: rgba(239, 226, 201, 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(239, 226, 201, 0.8);
  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: 16px 0 22px; }
.spooked-modal__body .wp-block-button.has-custom-width {
  width: auto;
  max-width: 100%;
}
.spooked-modal__body .wp-block-button__link {
  border-radius: 5px;
  padding: 10px 20px;
  text-decoration: none;
  border: 1px solid rgba(239,226,201,.82);
  background: linear-gradient(180deg, rgba(143,25,31,.95), rgba(70,10,15,.98));
  color: #faf5eb;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  /* Override the Gutenberg custom font size inherited by the button. */
  font-size: 15px !important;
  line-height: 1.4;
  letter-spacing: .03em;
  text-transform: none;
}
.spooked-modal__body .wp-block-button__link:hover {
  background: linear-gradient(180deg, rgba(170,31,38,.98), rgba(86,12,18,.99));
  border-color: rgba(250,239,217,.96);
  color: #faf5eb;
}

.spooked-modal__body .wp-block-button__link:focus-visible,
.spooked-modal__close:focus-visible,
.spooked-modal .spooked-link:focus-visible {
  outline: 2px solid #efe2c9;
  outline-offset: 4px;
}

/* 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(143,25,31,.95), rgba(70,10,15,.98));
  border-color: rgba(239,226,201,.82);
}

.spooked-modal__body .is-style-fill .wp-block-button__link:hover {
  background: linear-gradient(180deg, rgba(170,31,38,.98), rgba(86,12,18,.99));
  border-color: rgba(250,239,217,.96);
}
