/*======================================================================
  POP-UP HOME  ·  "Conoce las trampas del gas contra las ballenas"
  Overlay oscuro + tarjeta centrada, ambos position:fixed.
  Aparece 1s después de cargar el home. Cierra con: click en el overlay
  (click-away), botón X, o tecla Esc.
======================================================================*/

.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(4, 14, 24, 0.72);
  /* oculto por defecto: si el JS no corre, el pop-up nunca aparece */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    visibility 0s linear 0.35s;
}
.popup-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.35s ease;
}

/*--- Tarjeta --------------------------------------------------------- */
.popup {
  position: relative;
  width: min(580px, 100%);
  border-radius: 22px;
  overflow: hidden;
  color: #ffffff;
  background:
    #1b3450 url("../images/texto_web/bloque_3_fondo.png") center / cover
    no-repeat;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  transform: translateY(16px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.popup-overlay.is-open .popup {
  transform: none;
}
/* velo para que el texto blanco se lea sobre la ilustración */
.popup::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 25, 45, 0.2),
    rgba(8, 20, 38, 0.42)
  );
  pointer-events: none;
}

.popup__inner {
  position: relative;
  z-index: 2;
  min-height: 19.5rem;
  /* padding derecho grande: el contenido centrado queda a la izquierda
     y le deja el rincón inferior derecho a la ballena */
  padding: 2.75rem 5.5rem 2.75rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/*--- Botón cerrar --------------------------------------------------- */
.popup__close {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  z-index: 3;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  line-height: 0;
  opacity: 0.85;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
.popup__close:hover {
  opacity: 1;
  transform: scale(1.08);
}
.popup__close svg {
  display: block;
  width: 100%;
  height: 100%;
}

/*--- Título (fuente dibujada) ------------------------------------------ */
.popup__title {
  font-family: "Costra", "KievitOT", sans-serif;
  font-weight: 400;
  font-style: normal;
  text-transform: uppercase;
  color: #ffffff;
  font-size: 1.7rem;
  line-height: 1.22;
  letter-spacing: 0.01em;
  max-width: 18rem;
  margin: 0 auto 1.6rem;
}

/*--- Botón CTA ------------------------------------------------------- */
.popup__cta {
  display: inline-block;
  font-family: "KievitOT", sans-serif;
  font-weight: bold;
  color: #ffffff;
  background: #a7cfe6;
  border-radius: 11px;
  padding: 0.85rem 1.9rem;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.2s ease;
}
.popup__cta:hover {
  background: #de2926;
}

/*--- Marcas rojas dibujadas, a los lados del título ------------------- */
.popup__mark {
  position: absolute;
  z-index: 2;
  top: 40%;
  transform: translateY(-50%);
  height: 2.9rem;
  width: auto;
  pointer-events: none;
  user-select: none;
}
.popup__mark--left {
  left: 4.5%;
}
.popup__mark--right {
  right: 4.5%;
}

/*--- Ballena detective, abajo a la derecha, asomándose del marco ----- */
.popup__whale {
  position: absolute;
  z-index: 2;
  right: -0.5rem;
  bottom: -0.75rem;
  width: 30%;
  max-width: 168px;
  pointer-events: none;
  user-select: none;
}

/*--- Móvil -------------------------------------------------------------*/
@media (max-width: 480px) {
  .popup-overlay {
    padding: 1rem;
  }
  .popup__inner {
    min-height: 17.5rem;
    padding: 2.6rem 4.2rem 1.9rem 1.4rem;
  }
  .popup__title {
    font-size: 1.42rem;
    max-width: 12rem;
    margin-bottom: 1.3rem;
  }
  .popup__mark {
    top: 36%;
    height: 2.3rem;
  }
  .popup__mark--left {
    left: 3%;
  }
  .popup__mark--right {
    right: 3%;
  }
  .popup__whale {
    width: 34%;
    max-width: 128px;
    right: -0.4rem;
    bottom: -0.4rem;
  }
  .popup__cta {
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
  }
}
