/* Welcome popup — shown on a visitor's first arrival at the gallery, then
   suppressed for an hour (see welcome-popup.js). Design tokens mirror the
   Figma "WelcomeModal" frame; keep in sync by hand. */

.cwp-welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 17, 24, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  font-family: 'Inter Tight', sans-serif;
}

.cwp-welcome-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.cwp-welcome-card {
  position: relative;
  width: 626px;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 40px 50px rgba(0, 0, 0, 0.24);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.cwp-welcome-overlay.is-open .cwp-welcome-card {
  transform: none;
}

/* ---- Dark header with the drifting template strip ---- */

.cwp-welcome-head {
  position: relative;
  height: 265px; 
  border-radius: 28px 28px 0 0;
  background: #8a8989;
}

.cwp-welcome-strip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.9;
}

/* Small, tighter strip peeking above the larger one. */
.cwp-welcome-strip--back {
  top: -18px;
  left: 0;
  gap: 6px;
  opacity: 0.7;
}

.cwp-welcome-strip--front {
    top: 38px;
    left: 50%;
    transform: translateX(calc(-50% + 119px));
    height: 227px;
    overflow: hidden;
}
.cwp-welcome-head::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
 background: radial-gradient(130% 130% at 50% 120%, rgba(86, 65, 243, 0.6) 0%, rgba(0, 0, 0, 0) 70%);
}
 

.cwp-welcome-thumb {
  flex-shrink: 0;
  overflow: hidden;
  background: #d9d9d9;
  border: 0.7px solid #e5e5e5;
  border-radius: 11px;
  box-shadow: 0 0.7px 4px rgba(0, 0, 0, 0.06);
}

.cwp-welcome-strip--back .cwp-welcome-thumb {
  width: 107px;
  height: 142px;
  border-radius: 6.7px;
}

.cwp-welcome-strip--front .cwp-welcome-thumb {
  width: 178px;
  height: 237px;
}

.cwp-welcome-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* Purple wash anchored to the bottom of the header, so the strip fades
   into the card body rather than stopping at a hard edge. */
 

.cwp-welcome-close {
  position: absolute;
  top: 13px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #ffffff;
  background: #111111;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.cwp-welcome-close:hover {
  background: #2b2b2b;
  transform: scale(1.05);
}

.cwp-welcome-badge {
  position: absolute;
  top: 217px;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-left: -36px;
  border-radius: 20px;
  background: linear-gradient(135deg, #7f77dd 0%, #5641f3 100%);
  box-shadow: 0 12px 36px rgba(86, 65, 243, 0.42);
}

/* ---- Body ---- */

.cwp-welcome-body {
  padding: 60px 44px 40px;
  text-align: center;
}

.cwp-welcome-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 9999px;
  background: #f0f0f8;
  color: #7f77dd;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.cwp-welcome-title {
  margin: 16px 0 0;
  color: #111118;
  font-size: 32px;
  font-weight: 500;
  line-height: 37.76px;
  letter-spacing: -0.48px;
}

/* The gradient word carries the hand-drawn ellipse as a background so the
   two stay locked together when the heading wraps. */
.cwp-welcome-title em {
  position: relative;
  display: inline-block;
  padding: 0 6px;
  font-weight: 700;
  font-style: italic;
  background: linear-gradient(90deg, #9810fa 0%, #155dfc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cwp-welcome-title em::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 108%;
  height: 132%;
  transform: translate(-50%, -50%) rotate(-0.47deg);
  /* Set from PHP so the SVG resolves against the plugin URL. */
  background-image: var(--cwp-welcome-underline);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
}

.cwp-welcome-lead {
  max-width: 360px;
  margin: 12px auto 0;
  color: #717182;
  font-size: 16px;
  font-weight: 400;
  line-height: 25.6px;
}

.cwp-welcome-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 28px;
}

.cwp-welcome-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 17px;
  border: 1.1px solid #e8e8f0;
  border-radius: 9999px;
  background: #f4f4f8;
  color: #3a3a4a;
  font-size: 13px;
  font-weight: 500;
  line-height: 19.5px;
  white-space: nowrap;
}

.cwp-welcome-chip span[aria-hidden] {
  font-size: 15px;
  line-height: 22.5px;
}

.cwp-welcome-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  margin-top: 32px;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: #5641f3;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.15px;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.cwp-welcome-cta:hover {
  background: #4835e0;
}

.cwp-welcome-cta:active {
  transform: translateY(1px);
}

/* ---- Small screens ---- */

@media (max-width: 640px) {
  .cwp-welcome-overlay {
    padding: 16px;
  }

  .cwp-welcome-head {
    height: 200px;
  }

  .cwp-welcome-badge {
    top: 158px;
    width: 62px;
    height: 62px;
    margin-left: -31px;
    border-radius: 17px;
  }

  .cwp-welcome-badge svg {
    width: 26px;
    height: 26px;
  }

  .cwp-welcome-body {
    padding: 46px 22px 30px;
  }

  .cwp-welcome-title {
    font-size: 25px;
    line-height: 31px;
  }

  /* Let the heading find its own wrap points at this width. */
  .cwp-welcome-title-break {
    display: none;
  }

  .cwp-welcome-lead {
    font-size: 15px;
    line-height: 23px;
  }

  .cwp-welcome-chips {
    gap: 8px;
    margin-top: 22px;
  }

  .cwp-welcome-chip {
    padding: 8px 13px;
    font-size: 12.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cwp-welcome-overlay,
  .cwp-welcome-card,
  .cwp-welcome-close,
  .cwp-welcome-cta {
    transition: none;
  }

  .cwp-welcome-card {
    transform: none;
  }
}

.popup-image-overlay {
    overflow: hidden;
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
}