
/* =========================================
   COMUNIDADES - MEDIA MODAL
   ========================================= */

.cm-modal,
.cm-modal * {
  box-sizing: border-box;
}

.cm-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  color: #fff;
  font-family: inherit;
}

.cm-modal.is-open {
  display: block;
}

.cm-modal [hidden] {
  display: none !important;
}

/* Overlay */

.cm-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}

/* Contenedor principal */

.cm-modal__dialog {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 70px;
}

.cm-modal__content {
  width: 100%;
  max-width: 1100px;
  margin: auto;
  position: relative;
}

/* Encabezado */

.cm-modal__heading {
  margin: 0 0 16px;
  color: #fff;
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
}

/* Multimedia */

.cm-modal__media {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100px;
}

.cm-modal__media.is-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(65vh, 680px);
  max-height: min(65dvh, 680px);
  object-fit: contain;
  border-radius: 16px;
}

/* Video YouTube */

.cm-modal__media.is-video {
  width: 100%;
}

.cm-modal__video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 65vh;
  max-height: 65dvh;
  margin: auto;
  overflow: hidden;
  border-radius: 16px;
  background: #000;
}

.cm-modal__video-wrapper iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Información y flechas */

.cm-modal__bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  margin-top: 12px;
}

.cm-modal__information {
  flex: 1;
  min-width: 0;
  color: #fff;
}

.cm-modal__title {
  font-size: clamp(18px, 1.7vw, 24px);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 4px;
}

.cm-modal__description,
.cm-modal__ficha {
  font-size: clamp(13px, 1vw, 16px);
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
}

.cm-modal__description p,
.cm-modal__ficha p {
  margin: 0;
}

.cm-modal__description p + p {
  margin-top: 6px;
}

.cm-modal__description ul,
.cm-modal__description ol {
  margin: 6px 0;
  padding-left: 22px;
}

.cm-modal__description a {
  color: inherit;
}

/* Flechas del sitio */

.cm-modal__arrows.custom_arrows {
  position: static;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  gap: 10px;
  width: auto;
  height: auto;
  margin: 4px 0 0;
  padding: 0;
  transform: none;
}

.cm-modal__arrows .custom__arrow {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 12px;
  background: #d9edf2;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cm-modal__arrows .custom__arrow:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.cm-modal__arrows .custom__arrow img {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* Botón cerrar */

.cm-modal__close {
  position: fixed;
  top: 22px;
  right: 26px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(216, 237, 242, 0.6);
  color: #093747;
  font-family: Arial, sans-serif;
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cm-modal__close:hover {
  background: rgba(216, 237, 242, 1);
}

/* Tarjetas clicables */

.thumb_view.image,
.thumb_view.video,
.thumb_view.pdf {
  cursor: pointer;
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 768px) {

  .cm-modal__dialog {
    padding: 65px 18px 30px;
  }

  .cm-modal__heading {
    margin-bottom: 14px;
    font-size: 24px;
  }

  .cm-modal__media.is-image img {
    max-height: 60vh;
    max-height: 60dvh;
    border-radius: 12px;
  }

  .cm-modal__video-wrapper {
    max-height: 60vh;
    max-height: 60dvh;
    border-radius: 12px;
  }

  .cm-modal__bottom {
    gap: 15px;
    margin-top: 14px;
  }

  .cm-modal__title {
    font-size: 19px;
  }

  .cm-modal__description,
  .cm-modal__ficha {
    font-size: 13px;
  }

  .cm-modal__arrows.custom_arrows {
    gap: 6px;
  }

  .cm-modal__arrows .custom__arrow {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 10px;
  }

  .cm-modal__arrows .custom__arrow img {
    width: 14px;
    height: 14px;
  }

  .cm-modal__close {
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    font-size: 28px;
  }
}

@media (max-width: 480px) {

  .cm-modal__bottom {
    flex-wrap: wrap;
  }

  .cm-modal__information {
    flex-basis: 100%;
  }

  .cm-modal__arrows.custom_arrows {
    margin-left: auto;
  }
}
