/**
 * CAIA pop-up (lightbox) — shared by every render path: normal templates
 * enqueue this file (functions/popups.php), and the static snapshots link it by
 * URL, which is why it lives under templates/static/ (that is the path
 * templates/static-html-page.php cache-busts with ?v=filemtime). Markup and
 * behavior are built in functions/popups.php and printed inline before </body>.
 */

.caia-exam-popup {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: rgba(26, 26, 26, 0.6);
  opacity: 0;
  /* Delay hiding until the fade-out ends; on open the visibility flip is
     immediate so the dialog is focusable right away. */
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.caia-exam-popup.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}

.caia-exam-popup__dialog {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 460px;
  min-height: 340px;
  overflow: hidden;
  border-radius: 16px;
  background-color: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.caia-exam-popup__content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1 1 62%;
  gap: 40px;
  padding: 40px 32px 32px;
  /* #F56200 instead of the brand #FF6600: white large text needs >= 3:1
     contrast (WCAG AA) and #FF6600 sits at 2.94:1. */
  background-color: #F56200;
}

.caia-exam-popup__message {
  margin: 0;
  font-family: "Gotham A", "Gotham B", serif;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 700;
  color: #fff;
}

.caia-exam-popup__button {
  align-self: flex-start;
  padding: 10px 22px 8px;
  border: 0;
  border-radius: 40px;
  background-color: #fff;
  font-family: "Gotham A", "Gotham B", serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.4;
  text-transform: uppercase;
  text-decoration: none;
  /* Darker orange than the panel: 13px text on white needs >= 4.5:1. */
  color: #C94F00;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.caia-exam-popup__button:hover,
.caia-exam-popup__button:focus {
  background-color: #1A1A1A;
  color: #fff;
  text-decoration: none;
}

/* The pages' global "*:focus" outline is #36749B dotted !important, which is
   invisible (1.7:1) against the orange panel. */
.caia-exam-popup__button:focus {
  outline: 3px dotted #fff !important;
}

/* Applied to <html> while the dialog is open. */
.caia-exam-popup-scroll-lock,
.caia-exam-popup-scroll-lock body {
  overflow: hidden;
}

/* The image itself is set inline per pop-up (Theme Options -> Image, or the
   theme default) by functions/static-page-popups.php. */
.caia-exam-popup__image {
  flex: 1 1 38%;
  background-color: #EEF2F7;
  background-size: cover;
  background-position: center;
}

.caia-exam-popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.85);
  color: #36749B;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.caia-exam-popup__close:hover,
.caia-exam-popup__close:focus {
  background-color: #fff;
}

@media all and (max-width: 540px) {
  .caia-exam-popup__dialog {
    max-width: 360px;
    min-height: 0;
  }

  .caia-exam-popup__content {
    gap: 28px;
    padding: 32px 24px 24px;
  }

  .caia-exam-popup__message {
    /* 19px bold stays over the WCAG "large text" threshold (18.66px bold). */
    font-size: 19px;
  }

  .caia-exam-popup__image {
    flex-basis: 26%;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* .caia-exam-popup.is-open must be listed too: its own transition rule
     out-specifies a bare .caia-exam-popup override. */
  .caia-exam-popup,
  .caia-exam-popup.is-open,
  .caia-exam-popup__button,
  .caia-exam-popup__close {
    transition: none;
  }
}
