/**
 * Think Tank Popups — frontend styles.
 *
 * Ported from the theme's _ai-visibility-popup.scss so the plugin renders
 * identically without depending on the theme stylesheet. Theme custom
 * properties are used where they exist, with hard-coded fallbacks so the popup
 * still looks right on any theme.
 */

.ttp-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.ttp-popup.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.ttp-popup *,
.ttp-popup *::before,
.ttp-popup *::after {
  box-sizing: border-box;
}

.ttp-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(23, 41, 60, 0.72);
  backdrop-filter: blur(4px);
}

.ttp-popup__dialog {
  --ttp-max-width: 520px;

  position: relative;
  width: min(90vw, var(--ttp-max-width));
  max-height: calc(100vh - 48px);
}

.ttp-popup__link {
  display: block;
  overflow: hidden;
  background: var(--color-light, #fff);
  border-radius: 4px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  line-height: 0;
}

.ttp-popup__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.ttp-popup__close {
  position: absolute;
  top: 2.5%;
  right: 2.5%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 8%;
  min-width: 28px;
  height: 8%;
  min-height: 28px;
  padding: 0;
  padding-top: 1.5%;
  border: 0;
  border-radius: 50%;
  background: var(--color-primary, #17293c);
  color: var(--color-secondary, #fff);
  cursor: pointer;
  font-size: 34px;
  font-weight: 400;
  line-height: 1;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.ttp-popup__close:hover,
.ttp-popup__close:focus {
  background: var(--color-light, #fff);
  color: var(--color-primary, #17293c);
  transform: translateY(-1px);
}

.ttp-popup-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .ttp-popup {
    padding: 18px;
  }

  .ttp-popup__dialog {
    width: min(94vw, var(--ttp-max-width));
  }

  .ttp-popup__close {
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ttp-popup,
  .ttp-popup__close {
    transition: none;
  }
}
