/* Page scroll lock when modal open */
body.ghl-modal-open {
  overflow: hidden;
  touch-action: none;
}

/* Container + backdrop */
.ghl-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;               /* toggled to block by JS */
}
.ghl-modal[aria-hidden="false"] {
  display: block;
}
.ghl-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 28, 0.6);
  backdrop-filter: blur(2px);
}

/* Dialog layout: centered, responsive box */
.ghl-modal__dialog {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(96vw, 1200px);
  height: min(99vh, 1200px);
  background: #fff;
  color: #111;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;

  /* ✅ Make space for close button + scrollbar */
  padding-top: 2.25rem;
}


/* Close button */


/* Make modal close look exactly like the menu-toggle */
.ghl-modal .ghl-close {
  position: absolute;
  top: .6rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #e5e5e5);
  background: #fff;
  color: var(--text-color, #3f3f3f);

  /* ✅ Ensure perfect centering */
  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  transition: border-color var(--transition, .2s), color var(--transition, .2s), background var(--transition, .2s);
}

/* Hover/focus like menu-toggle */
.ghl-modal .ghl-close:hover {
  border-color: var(--primary, #e64d25);
  color: var(--primary, #e64d25);
  background: var(--muted, #f5f5f5);
}



/* Only show the close icon (no "menu" state needed for modal) */
.ghl-modal .ghl-close .icon-open { display: none !important; }
.ghl-modal .ghl-close .icon-close {
  font-size: 24px;       /* similar to your mobile-close icon */
  line-height: 1;
}

/* Content area (shortcode render) */
/* Scroll area */
.ghl-modal__body {
  padding: clamp(16px, 3vw, 28px);
  overflow-y: auto;
  height: 100%;
  box-sizing: border-box;
  /* ✅ Prevent scroll under button */
}


/* Iframe variant */
.ghl-modal__iframe {
  width: 100%;
  height: 100dvh;                /* the dialog governs max height */
  border: 0;
  display: block;
  margin-bottom: 20px;
}

/* A11y helper */
.screen-reader-text {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
  white-space: nowrap;
}

/* Smaller devices: let dialog grow taller, still capped to viewport */
@media (max-width: 640px) {
  .ghl-modal__dialog {
    width: 96vw;
    height: 94vh;
    border-radius: 12px;
  }
}


/* Spinner overlay: covers dialog content while loading */
.ghl-modal__dialog { position: absolute; }
.ghl-modal__spinner {
  position: absolute;
  inset: 0;
  z-index: 3; /* above iframe/body */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(1px);
}

/* The spinner circle */
.ghl-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid #e5e7eb;
  border-top-color: var(--primary, var(--primary-color, #e64d25));
  animation: ghl-spin 0.9s linear infinite;
}

@keyframes ghl-spin { to { transform: rotate(360deg); } }

#ghl-modal-spinner[hidden] { display: none !important; }


/* Close button – neutralize Safari default ring/halo */
.ghl-modal .ghl-close {
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  -webkit-tap-highlight-color: transparent; /* iOS tap halo */
  box-shadow: none; /* ensure no default inner glow */
}

/* Never show default outline on keyboard/mouse focus */
.ghl-modal .ghl-close:focus { outline: none; box-shadow: none; }

/* Keep your accessible ring only on :focus-visible */
.ghl-modal .ghl-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(230, 61, 37, 0.35); /* matches your theme */
  border-color: var(--primary, #e64d25);
}

/* If you still see a tiny offset “extension border”, ensure border stays solid */
.ghl-modal .ghl-close {
  border: 1px solid var(--border-color, #e5e5e5);
  background: #fff;
}
