html.cep-lock { overflow: hidden; }

.cep-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(18, 14, 10, 0.6);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.cep-overlay.is-open { opacity: 1; }

.cep-card {
  position: relative;
  width: min(92vw, 460px);
  max-height: 92vh;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
}
.cep-overlay.is-open .cep-card { transform: none; }

/* Image mode: 2:3 portrait, sized so the whole image always fits the screen height */
.cep-card--image { width: min(92vw, 460px, calc(92vh * 2 / 3)); }
@supports (height: 1svh) {
  .cep-card { max-height: 92svh; }
  .cep-card--image { width: min(92vw, 460px, calc(92svh * 2 / 3)); }
}
.cep-card--image .cep-link { display: block; }
.cep-card--image img { display: block; width: 100%; height: auto; }

/* Invisible hit area over the X that's drawn into the image */
.cep-card--image .cep-close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 15%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.cep-card--image .cep-close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -10px;
  border-radius: 50%;
}
.cep-card--image .cep-link:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -4px;
}

/* Text mode fallback */
.cep-card--text .cep-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #333;
  font-size: 30px;
  line-height: 44px;
  cursor: pointer;
}
.cep-body { padding: 36px 28px 28px; color: #222; font-family: inherit; }
.cep-heading { margin: 0 0 10px; font-size: 1.5rem; line-height: 1.2; }
.cep-message { margin: 0 0 22px; line-height: 1.55; }
.cep-btn {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 8px;
  background: var(--cep-accent, #1e3f37);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.cep-btn:focus-visible, .cep-card--text .cep-close:focus-visible {
  outline: 3px solid var(--cep-accent, #1e3f37);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .cep-overlay, .cep-card { transition: none; }
}
