/*
 * Colors/shape reference standard Bootstrap variables (with sane fallbacks) so a single
 * override in the theme's own microsite style.css (per Website/CI) is enough to re-brand
 * the popup - see the "GP Popup" section there for the actual client colors.
 */
.gp-popup,
.gp-popup-page-preview {
  --gp-popup-overlay-bg: rgba(var(--bs-dark-rgb, 0, 0, 0), .6);
  --gp-popup-bg: var(--bs-body-bg, #fff);
  --gp-popup-color: var(--bs-body-color, #333);
  --gp-popup-title-color: var(--bs-emphasis-color, var(--gp-popup-color));
  --gp-popup-close-color: var(--bs-secondary-color, #555);
  --gp-popup-close-hover-color: var(--bs-emphasis-color, #000);
  --gp-popup-border-radius: var(--bs-border-radius-lg, .5rem);
  --gp-popup-box-shadow: var(--bs-box-shadow-lg, 0 10px 40px rgba(0, 0, 0, .2));
  --gp-popup-button-color: var(--bs-primary, #00a09b);
  --gp-popup-button-bg: transparent;
  --gp-popup-button-hover-color: var(--bs-white, #fff);
  --gp-popup-button-hover-bg: var(--gp-popup-button-color);
  --gp-popup-button-border-radius: var(--bs-border-radius, .3125rem);
}

.gp-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  color: var(--gp-popup-color);
}

.gp-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gp-popup-overlay-bg);
}

.gp-popup-dialog {
  position: relative;
  background: var(--gp-popup-bg);
  max-width: 600px;
  width: calc(100% - 40px);
  max-height: calc(100% - 40px);
  overflow-y: auto;
  margin: 20px auto;
  top: 50%;
  transform: translateY(-50%);
  border-radius: var(--gp-popup-border-radius);
  padding: 40px 30px 30px;
  box-shadow: var(--gp-popup-box-shadow);
}

.gp-popup-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  color: var(--gp-popup-close-color);
}

.gp-popup-close:hover,
.gp-popup-close:focus {
  color: var(--gp-popup-close-hover-color);
}

.gp-popup-title {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 26px;
  color: var(--gp-popup-title-color);
}

.gp-popup-text {
  margin-bottom: 20px;
}

.gp-popup-cta {
  text-align: center;
}

.gp-popup-button {
  display: inline-block;
  background-color: var(--gp-popup-button-bg);
  color: var(--gp-popup-button-color);
  border: 3px solid var(--gp-popup-button-color);
  border-radius: var(--gp-popup-button-border-radius);
  padding: 10px 30px;
  font-size: 20px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.gp-popup-button:hover,
.gp-popup-button:focus {
  background-color: var(--gp-popup-button-hover-bg);
  color: var(--gp-popup-button-hover-color);
}

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap;
}

@media (max-width: 576px) {
  .gp-popup-dialog {
    padding: 35px 20px 20px;
  }

  .gp-popup-title {
    font-size: 22px;
  }
}

/* Image */
.gp-popup-image {
  overflow: hidden;
}

.gp-popup-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Image fit */
.gp-popup-image--fit-fill img {
  object-fit: fill;
}

.gp-popup-image--fit-contain img {
  object-fit: contain;
  background: var(--gp-popup-bg);
}

/* Image position: top */
.gp-popup-dialog--image-top .gp-popup-image {
  height: 200px;
  margin: -40px -30px 20px;
}

.gp-popup-dialog--image-top .gp-popup-image img {
  border-radius: var(--gp-popup-border-radius) var(--gp-popup-border-radius) 0 0;
}

/* Image position: bottom */
.gp-popup-dialog--image-bottom {
  display: flex;
  flex-direction: column;
}

.gp-popup-dialog--image-bottom .gp-popup-body {
  order: 1;
}

.gp-popup-dialog--image-bottom .gp-popup-image {
  order: 2;
  height: 200px;
  margin: 20px -30px -30px;
}

.gp-popup-dialog--image-bottom .gp-popup-image img {
  border-radius: 0 0 var(--gp-popup-border-radius) var(--gp-popup-border-radius);
}

/* Image position: left/right (shared horizontal layout) */
.gp-popup-dialog--image-left,
.gp-popup-dialog--image-right {
  display: flex;
  align-items: stretch;
  gap: 20px;
  max-width: 800px;
}

/* The image markup always comes before the text in the DOM; row-reverse is
   what actually moves it to the right without duplicating the template. */
.gp-popup-dialog--image-right {
  flex-direction: row-reverse;
}

.gp-popup-dialog--image-left .gp-popup-body,
.gp-popup-dialog--image-right .gp-popup-body {
  flex: 1 1 auto;
  min-width: 0;
}

.gp-popup-dialog--image-left .gp-popup-image,
.gp-popup-dialog--image-right .gp-popup-image {
  flex: 0 0 40%;
  margin-top: -40px;
  margin-bottom: -30px;
}

.gp-popup-dialog--image-left .gp-popup-image {
  margin-left: -30px;
}

.gp-popup-dialog--image-right .gp-popup-image {
  margin-right: -30px;
}

.gp-popup-dialog--image-left .gp-popup-image img {
  border-radius: var(--gp-popup-border-radius) 0 0 var(--gp-popup-border-radius);
}

.gp-popup-dialog--image-right .gp-popup-image img {
  border-radius: 0 var(--gp-popup-border-radius) var(--gp-popup-border-radius) 0;
}

@media (max-width: 576px) {
  .gp-popup-dialog--image-left,
  .gp-popup-dialog--image-right {
    flex-direction: column;
  }

  .gp-popup-dialog--image-left .gp-popup-image,
  .gp-popup-dialog--image-right .gp-popup-image {
    flex: none;
    height: 160px;
    margin: -35px -20px 20px;
    border-radius: var(--gp-popup-border-radius) var(--gp-popup-border-radius) 0 0;
  }
}

/* Static, always-visible preview shown in place of the real overlay while the page is open in edit mode */
.gp-popup-page-preview {
  position: relative;
  margin: 20px 0;
  color: var(--gp-popup-color);
}

.gp-popup-page-preview-label {
  max-width: 600px;
  margin: 0 auto 8px;
  padding: 6px 12px;
  background: #fff3cd;
  border: 1px solid #ffe08a;
  border-radius: 4px;
  font-size: 13px;
  color: #665008;
  text-align: center;
}

.gp-popup-page-preview .gp-popup-dialog {
  position: static;
  top: auto;
  transform: none;
  margin: 0 auto;
  max-height: none;
}

.gp-popup-page-preview .gp-popup-close {
  cursor: default;
}
