/**
 * HechosEnergia View Component
 * Estilo de tarjetas con modal para la vista HechosEnergia.
 */

/* ============================================================
   Sección contenedora (fondo gris-teal #eef4f4)
   ============================================================ */
.he-cards-section {
  background-color: #eef4f4;
  padding: 35px 10px;
}

/* ============================================================
   Grilla de tarjetas (3 columnas)
   ============================================================ */
.he-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.he-cards-grid__item {
  display: flex;
}

.he-cards-grid__item .views-row {
  width: 100%;
}

.he-cards-grid__item--hidden {
  display: none;
}

.he-cards-grid__item--hidden.he-cards-grid__item--visible {
  display: flex;
}

/* ============================================================
   Tarjeta individual
   ============================================================ */
.he-card {
  background-color: #ffffff;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 103%;
  height: -webkit-fill-available;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

/* ============================================================
   Imagen con ícono de play
   ============================================================ */
.he-card__image-wrapper {
  position: relative;
  width: 100%;
  height: 153px;
  overflow: hidden;
}

.he-card__image {
  width: 100%;
  height: 100%;
}

.he-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.he-card__image picture,
.he-card__image figure {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
}

.he-card__play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.9;
}

/* ============================================================
   Cuerpo de la tarjeta
   ============================================================ */
.he-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 21.5px;
}

/* ============================================================
   Título
   ============================================================ */
.he-card__title {
  color: #686868;
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 4px 0;
  line-height: 1.4;
}

/* ============================================================
   Rol
   ============================================================ */
.he-card__rol {
  color: #666666;
  font-size: 0.85rem;
  font-weight: 400;
  margin: 0 0 14px 0;
  line-height: 1.4;
}

/* ============================================================
   Botón "Conoce más de ella aquí"
   ============================================================ */
.he-card__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
}

.he-card__button {
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  color: #2AD2C9 !important;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.he-card__button:hover,
.he-card__button:focus {
  text-decoration: underline;
}

/* ============================================================
   Botón "Ver todas las entrevistas"
   ============================================================ */
.he-cards-show-more {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.he-cards-show-more__button {
  display: inline-block;
  background-color: transparent;
  color: #2AD2C9;
  border: 2px solid #2AD2C9;
  padding: 12px 40px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.he-cards-show-more__button:hover,
.he-cards-show-more__button:focus {
  background-color: #2AD2C9;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(42, 210, 201, 0.35);
}

.he-cards-show-more--hidden {
  display: none;
}

/* ============================================================
   Modal / Popup
   ============================================================ */
.he-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
}

.he-modal-overlay--open {
  display: flex;
}

.he-modal {
  background-color: #ffffff;
  border-radius: 14px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
  animation: heModalFadeIn 0.25s ease-out;
}

@keyframes heModalFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Botón cerrar */
.he-modal__close {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 10;
  background: rgba(217, 217, 217, 0.44);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 2.3rem;
  line-height: 1;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: background-color 0.15s ease;
  backdrop-filter: blur(5px);
}

.he-modal__close:hover {
  background-color: #e0e0e0;
}

/* Video en el modal */
.he-modal__video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
}

.he-modal__video iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Cuerpo del modal */
.he-modal__body {
  padding: 20px 24px 28px;
}

.he-modal__title {
  color: #2AD2C9;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.he-modal__rol {
  color: #666666;
  font-size: 0.9rem;
  font-weight: 400;
  margin: 0 0 16px 0;
  line-height: 1.4;
}

.he-modal__description {
  color: #444444;
  font-size: 0.875rem;
  line-height: 1.7;
}

.he-modal__description p {
  margin: 0 0 10px 0;
}

.he-modal__description p:last-child {
  margin-bottom: 0;
}

/* Body scroll lock cuando modal está abierto */
body.he-modal-open {
  overflow: hidden;
}

/* ============================================================
   Responsivo
   ============================================================ */
@media (max-width: 900px) {
  .he-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .he-cards-grid {
    grid-template-columns: 1fr;
  }

  .he-cards-section {
    padding: 24px 16px;
  }

  .he-modal {
    width: 95%;
    max-width: none;
  }
}
