/**
 * EBP Pop Up — split layout: content left, image right; stacks below 767px.
 */

html.ebp-pop-up-open {
  overflow: hidden;
}

.ebp-pop-up {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.ebp-pop-up[hidden] {
  display: none !important;
}

.ebp-pop-up__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.45s ease;
}

.ebp-pop-up.is-visible .ebp-pop-up__backdrop,
.ebp-pop-up.is-closing .ebp-pop-up__backdrop {
  opacity: 1;
}

.ebp-pop-up__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 56rem);
  max-height: none;
  overflow: hidden;
  border-radius: 0.75rem;
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.25);
  background: var(--ebp-pop-up-content-bg, #ffffff);
  opacity: 0;
  transform: translateY(1.25rem) scale(0.97);
  transition:
    opacity 0.45s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.ebp-pop-up__panel--split {
  max-height: none;
}

.ebp-pop-up.is-visible .ebp-pop-up__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.ebp-pop-up.is-closing .ebp-pop-up__panel {
  opacity: 0;
  transform: translateY(0.75rem) scale(0.98);
}

.ebp-pop-up__layout {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 18rem;
}

.ebp-pop-up__content-col {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ebp-pop-up-content-bg, #ffffff);
}

.ebp-pop-up__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 2.5rem 2rem;
  overflow-y: auto;
  max-height: none;
  box-sizing: border-box;
  text-wrap: balance;
}

.ebp-pop-up__media-col {
  position: relative;
  flex: 1 1 50%;
  min-height: 18rem;
  overflow: hidden;
}

.ebp-pop-up__media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.ebp-pop-up__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--ebp-pop-up-overlay, rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

.ebp-pop-up__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ebp-pop-up-close-color, #111);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.ebp-pop-up__close:hover,
.ebp-pop-up__close:focus-visible {
  opacity: 0.7;
  transform: scale(1.05);
  outline: none;
}

.ebp-pop-up__heading {
  margin: 0 0 0.75rem;
  color: var(--ebp-pop-up-heading-color, #111);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.2;
}

.ebp-pop-up__content {
  color: var(--ebp-pop-up-text-color, #111);
  font-size: 1rem;
  line-height: 1.55;
}

/* Theme reset sets p { margin: 0 } — restore paragraph gaps from the editor */
.ebp-pop-up__content p {
  margin: 0 0 1.25em;
}

.ebp-pop-up__content p:last-child {
  margin-bottom: 0;
}

/* Spacer paragraphs (empty line in visual editor) */
.ebp-pop-up__content p:empty {
  min-height: 1.25em;
  margin-bottom: 1.25em;
}

.ebp-pop-up__content br {
  display: block;
  margin-bottom: 1.25em;
}

.ebp-pop-up__content a {
  color: inherit;
  text-decoration: underline;
}

.ebp-pop-up__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Stack: content on top, image below */
@media (max-width: 767px) {
  .ebp-pop-up {
    padding: 1rem;
  }

  .ebp-pop-up__panel,
  .ebp-pop-up__panel--split {
    max-height: min(92vh, 40rem);
  }

  .ebp-pop-up__layout {
    flex-direction: column;
    min-height: 0;
  }

  .ebp-pop-up__content-col {
    flex: 0 0 auto;
    order: 1;
  }

  .ebp-pop-up__media-col {
    flex: 0 0 auto;
    order: 2;
    min-height: 14rem;
    width: 100%;
  }

  .ebp-pop-up__inner {
    padding: 2rem 1.25rem 1.5rem;
    max-height: none;
  }

  .ebp-pop-up__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ebp-pop-up__actions .btn {
    width: 100%;
  }
}
