.scqm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  transition: opacity 0.15s ease;
  opacity: 0;
}
.scqm-open { opacity: 1 !important; }
.scqm-modal {
  background: #fff;
  max-width: 640px;
  width: 92%;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.scqm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
}
.scqm-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}
.scqm-close {
  background: transparent;
  border: 0;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  color: #fff; /* X is white */
}
.scqm-close:hover, .scqm-close:focus { opacity: .85; }

.scqm-content {
  padding: 16px;
}

/* Ensure WP editor alignment classes work inside the modal */
.scqm-content .aligncenter,
.scqm-content img.aligncenter,
.scqm-content figure.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.scqm-content .alignleft,
.scqm-content img.alignleft,
.scqm-content figure.alignleft {
  float: left;
  margin-right: 1em;
}
.scqm-content .alignright,
.scqm-content img.alignright,
.scqm-content figure.alignright {
  float: right;
  margin-left: 1em;
}

/* Gutenberg block alignment helpers */
.scqm-content .has-text-align-center { text-align: center; }
.scqm-content .has-text-align-right { text-align: right; }
.scqm-content .has-text-align-left { text-align: left; }

/* WP block image & caption */
.scqm-content figure.wp-block-image { margin: 1em auto; text-align: center; }
.scqm-content figure.wp-block-image img { display: inline-block; }
.scqm-content figure.wp-block-image figcaption { text-align: center; font-size: .9em; opacity: .85; }

/* Buttons block alignment */
.scqm-content .wp-block-buttons { display: flex; flex-wrap: wrap; gap: .5em; }
.scqm-content .wp-block-buttons.is-content-justification-center { justify-content: center; }
.scqm-content .wp-block-buttons.is-content-justification-right { justify-content: flex-end; }
.scqm-content .wp-block-buttons.is-content-justification-left { justify-content: flex-start; }

/* Clear floats at footer to avoid layout issues */
.scqm-footer::before, .scqm-footer::after { content: ""; display: table; clear: both; }

.scqm-content img {
  max-width: 100%;
  height: auto;
  display: block;
}
.scqm-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid #eee;
  flex-wrap: wrap;
}
.scqm-cta, .scqm-never {
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
}
.scqm-cta {
  background: #111827;
  color: #fff;
  border: 1px solid #111827;
}
.scqm-cta:hover, .scqm-cta:focus { opacity: .9; }
.scqm-never {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
  cursor: pointer;
}
.scqm-never:hover,
.scqm-never:focus {
  background: #f9fafb;
  color: #000; /* Hover text black as requested */
}

@media (prefers-color-scheme: dark) {
  .scqm-modal { background: #111827; color: #f3f4f6; }
  .scqm-header { border-bottom-color: #1f2937; }
  .scqm-footer { border-top-color: #1f2937; }
  .scqm-cta { background: #f3f4f6; color: #111827; border-color: #f3f4f6; }
  .scqm-never { background: #111827; color: #e5e7eb; border-color: #374151; }
}
