/**
 * DVC - Estilos de la ventana emergente (popup).
 *
 * Complementa a landing.css para que el popup pueda mostrarse en paginas
 * que NO son la landing (por ejemplo el home del tema), donde la landing no
 * esta presente y por tanto el selector #dvc-festive no aplica.
 *
 * El contenedor #dvc-popup-scope reproduce las variables de marca para que
 * el popup se vea exactamente igual en cualquier pagina.
 */

#dvc-popup-scope {
  --dvc-gold: #D4AF37;
  --dvc-gold-deep: #A8892A;
  --dvc-gold-soft: rgba(212, 175, 55, 0.14);
  --dvc-ink: #333333;
  --dvc-ink-soft: #1D1D1D;
  --dvc-body: #555555;
  --dvc-muted: #7C7C7C;
  --dvc-bg: #FFFFFF;
  --dvc-bg-soft: #F0F0F1;
  --dvc-line: rgba(51, 51, 51, 0.12);
  --dvc-shadow: rgba(7, 94, 84, 0.24) 1px 6px 24px 0px;
  --dvc-serif: "Italiana", "Times New Roman", serif;
  --dvc-sans: "Raleway", "Helvetica Neue", Arial, sans-serif;
  font-family: var(--dvc-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--dvc-ink);
  text-align: left;
}

#dvc-popup-scope *,
#dvc-popup-scope *::before,
#dvc-popup-scope *::after {
  box-sizing: border-box;
}

#dvc-popup-scope h1,
#dvc-popup-scope h2,
#dvc-popup-scope h3,
#dvc-popup-scope p,
#dvc-popup-scope ul,
#dvc-popup-scope figure,
#dvc-popup-scope img {
  margin-top: 0;
}

#dvc-popup-scope img {
  display: block;
  max-width: 100%;
  height: auto;
}

#dvc-popup-scope a {
  color: inherit;
  text-decoration: none;
}

#dvc-popup-scope button {
  font: inherit;
  cursor: pointer;
}

/* ---------- Contenedor ---------- */
#dvc-popup-scope .dvc-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: rgba(20, 20, 20, 0.58);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  overflow-y: auto;
  isolation: isolate;
}

#dvc-popup-scope .dvc-modal * {
  isolation: isolate;
}

#dvc-popup-scope .dvc-modal.is-open {
  display: flex !important;
  animation: dvc-popup-fade 0.28s ease both;
}

@keyframes dvc-popup-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Panel ---------- */
#dvc-popup-scope .dvc-modal__panel {
  position: relative;
  z-index: 2;
  display: block;
  width: min(920px, 100%);
  max-width: 100%;
  max-height: 90vh;
  overflow: hidden;
  background: var(--dvc-bg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

/* El tema puede imponer limites de tamano a los hijos de un grid
   (min-width, flex-basis, etc.). Se neutralizan para que las columnas
   ocupen todo el ancho disponible. */
#dvc-popup-scope .dvc-modal__panel > *,
#dvc-popup-scope .dvc-modal__grid > * {
  min-width: 0;
  max-width: 100%;
}

/* ---------- Boton de cerrar ---------- */
#dvc-popup-scope .dvc-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--dvc-line);
  border-radius: 50%;
  background: var(--dvc-bg);
  color: var(--dvc-ink);
  font-size: 24px;
  line-height: 1;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

#dvc-popup-scope .dvc-modal__close:hover {
  border-color: var(--dvc-gold);
  background: var(--dvc-gold);
  color: #fff;
}

/* ---------- Rejilla ---------- */
#dvc-popup-scope .dvc-modal__grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.2fr);
  align-items: stretch;
  width: 100%;
  max-width: 100%;
}

/* ---------- Imagen ---------- */
#dvc-popup-scope .dvc-modal__image {
  position: relative;
  min-height: 240px;
  overflow: hidden;
}

#dvc-popup-scope .dvc-modal__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Texto ---------- */
#dvc-popup-scope .dvc-modal__body {
  align-self: center;
  padding: clamp(20px, 2.6vw, 30px);
  min-width: 0;
  max-width: 100%;
}

/* El texto no debe partirse letra a letra aunque la columna sea estrecha. */
#dvc-popup-scope .dvc-modal__body,
#dvc-popup-scope .dvc-modal__body p,
#dvc-popup-scope .dvc-modal__body h2 {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

#dvc-popup-scope .dvc-kicker {
  margin-bottom: 18px;
  color: var(--dvc-gold-deep);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-transform: uppercase;
}

#dvc-popup-scope .dvc-section-title {
  margin-bottom: 22px;
  color: var(--dvc-ink-soft);
  font-family: var(--dvc-serif);
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 400;
  letter-spacing: -1px;
  line-height: 1.1;
  text-transform: uppercase;
  text-wrap: pretty;
}

#dvc-popup-scope .dvc-modal__body p {
  margin-bottom: 22px;
  color: var(--dvc-body);
  font-size: 13.6px;
  letter-spacing: 0.5px;
  line-height: 1.75;
}

/* ---------- Boton principal ---------- */
#dvc-popup-scope .dvc-btn {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 14px 34px;
  border: 1px solid var(--dvc-gold);
  border-radius: 150px;
  background: var(--dvc-gold);
  color: #fff;
  font-family: var(--dvc-sans);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: normal;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

#dvc-popup-scope .dvc-btn:hover {
  transform: translateY(-2px);
  background: var(--dvc-gold-deep);
  border-color: var(--dvc-gold-deep);
  color: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  #dvc-popup-scope .dvc-modal {
    padding: 76px 12px 16px;
  }

  #dvc-popup-scope .dvc-modal__panel {
    max-height: 100%;
  }

  #dvc-popup-scope .dvc-modal__grid {
    grid-template-columns: 1fr;
  }

  #dvc-popup-scope .dvc-modal__image {
    min-height: 180px;
    height: 220px;
  }

  #dvc-popup-scope .dvc-modal__image img {
    min-height: 0;
    height: 100%;
  }

  #dvc-popup-scope .dvc-modal__body {
    padding: 24px 20px 28px;
  }

  #dvc-popup-scope .dvc-modal .dvc-btn {
    width: 100%;
  }
}

/* Respeta la preferencia de menos animacion. */
@media (prefers-reduced-motion: reduce) {
  #dvc-popup-scope *,
  #dvc-popup-scope *::before,
  #dvc-popup-scope *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
