:root {
  /* Theme Defaults */
  --evp-backdrop: rgba(0, 0, 0, 0.5);
  --evp-bg: #ffffff;
  --evp-text: #1f2937;
  --evp-accent: #2563eb;
  --evp-cta-text: #ffffff;
  
  /* Specs */
  --evp-radius: 16px;
  --evp-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.35);
  --evp-z-index: 10000;
  --evp-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --evp-max-width: 850px;
}

/* Overlay with Glassmorphism */
.evp-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--evp-backdrop);
  backdrop-filter: blur(4px); /* Modern frost effect */
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: var(--evp-z-index);
  padding: 20px;
}

.evp-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Main Card with Slide Animation */
.evp {
  background: var(--evp-bg);
  color: var(--evp-text);
  border-radius: var(--evp-radius);
  box-shadow: var(--evp-shadow);
  font-family: var(--evp-font-family);
  width: 100%;
  max-width: var(--evp-max-width);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  
  /* Animation Start State */
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

/* Animation End State */
.evp-overlay.is-visible .evp {
  transform: translateY(0);
  opacity: 1;
}

/* Close Button */
.evp__close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.evp__close:hover {
  background: #fff;
  transform: scale(1.1);
}
.evp__close:focus-visible {
    outline: 2px solid var(--evp-accent);
    outline-offset: 2px;
}

/* Wrappers */
.evp__media-wrapper {
  flex: 1;
  min-height: 280px;
  position: relative;
  background-color: #f3f4f6;
}

.evp__content-wrapper {
  flex: 1;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

/* Image Styles */
.evp__media-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Content Elements */
.evp__date {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  opacity: 0.75;
  margin-bottom: 0.75rem;
  margin-top: 0;
  font-weight: 600;
}

.evp__title {
  font-size: 1.85rem;
  margin: 0 0 1rem 0;
  line-height: 1.15;
  font-weight: 800;
}

.evp__description {
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 0 1.75rem 0;
  opacity: 0.9;
  color: inherit;
}

/* CTA Button */
.evp__cta {
  display: inline-block;
  align-self: flex-start;
  background: var(--evp-accent);
  color: var(--evp-cta-text);
  padding: 0.8rem 1.75rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s, opacity 0.2s;
  border: 1px solid transparent;
}
.evp__cta:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

/* Custom HTML */
.evp__custom-html {
    width: 100%;
}
.evp__custom-html img {
    max-width: 100%;
    height: auto;
}

/* --- Layout Variants --- */

/* Standard */
.evp--layout-standard .evp__media-wrapper { order: 1; }
.evp--layout-standard .evp__content-wrapper { order: 2; }

/* Image Right */
.evp--layout-image-right .evp__media-wrapper { order: 2; }
.evp--layout-image-right .evp__content-wrapper { order: 1; }

/* Text Only */
.evp--layout-text-only {
    max-width: 550px;
}
.evp--layout-text-only .evp__content-wrapper {
    text-align: center;
    align-items: center;
}

/* Image Only */
.evp--layout-image-only {
    max-width: 650px;
    background: transparent;
    box-shadow: none;
}
.evp--layout-image-only .evp__close {
    top: -15px;
    right: -15px;
}

/* Double Image */
.evp--layout-double-image {
    max-width: 900px;
}
.evp--layout-double-image .evp__media-wrapper {
    display: flex;
}
.evp--layout-double-image .evp__media-wrapper img {
    width: 50%;
}

/* Stacked (Mobile style on Desktop) */
.evp--layout-stacked {
    flex-direction: column;
    max-width: 500px;
}
.evp--layout-stacked .evp__media-wrapper {
    height: 250px;
    min-height: auto;
    flex: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .evp {
    flex-direction: column !important;
    max-width: 92vw;
    max-height: 85vh;
  }

  .evp__media-wrapper {
    order: 1 !important;
    min-height: auto;
    height: 220px;
    flex: none;
    width: 100%;
  }

  .evp__content-wrapper {
    order: 2 !important;
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
  }

  .evp__title { font-size: 1.5rem; }

  .evp--layout-double-image .evp__media-wrapper img {
      width: 100%;
      height: 50%; /* Stack images inside the wrapper */
  }
  
  /* Fix close button position for image-only on mobile */
  .evp--layout-image-only .evp__close {
      top: 10px;
      right: 10px;
  }
}