:root {
  --modal-backdrop: rgba(16, 18, 27, 0.52);
  --modal-blur: 8px;
  --modal-radius: 16px;
  --modal-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
  --modal-ring: rgba(147, 197, 114, 0.38); /* toma el verde del sitio approx */
}

.modal {
  /* contenedor overlay */
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1300;
}
.modal.is-open {
  display: flex;
}
.modal.show {
  display: flex;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(var(--modal-blur));
  animation: modalFade 0.18s ease both;
}

.modal__content {
  position: relative;
  width: min(900px, 96vw);
  max-height: 90dvh;
  overflow: auto;
  background: #fff;
  border-radius: var(--modal-radius);
  box-shadow: var(--modal-shadow);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  animation: modalPop 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) 0.06s both;
}

@keyframes modalFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.modal__close:hover {
  background: rgba(0, 0, 0, 0.04);
}
.modal__close:focus-visible {
  outline: 3px solid var(--modal-ring);
  outline-offset: 3px;
}

/* ---------- Noticias modal ---------- */
.news-hero {
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: 1px solid #eee;
}
.news-hero img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
}
@media (min-width: 700px) {
  .news-hero img {
    height: 420px;
  }
}
.news-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px 0 18px;
  color: #57606a;
}
.news-body {
  padding: 14px 18px 22px 18px;
  line-height: 1.68;
  font-size: 1.02rem;
}
.news-body p {
  margin: 0.6rem 0;
}

.news-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 18px 18px;
  border-top: 1px solid #eee;
}
.news-nav {
  display: flex;
  gap: 8px;
}
.news-nav button {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
}
.news-nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.share-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.share-row a {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 6px 10px;
  text-decoration: none;
  color: inherit;
}
.share-row a:hover {
  background: #f5f5f5;
}

/* ---------- Mini CV modal (Especialidades) ---------- */
.cv-wrap {
  padding: 16px;
}
.cv-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 120px 1fr;
}
@media (min-width: 720px) {
  .cv-grid {
    grid-template-columns: 200px 1fr;
    gap: 22px;
  }
}


.cv-head h3 {
  margin: 0 0 2px 0;
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
}
.cv-head small {
  color: #6b7280;
}
.cv-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.badge {
    color: #000000;
    font-family: Arial;
    font-size: 15px;
    border-radius: 999px;
    display: inline-flex;
    justify-content: flex-start;
    flex-wrap: initial;
    align-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 0.5;
    width: 100%;
}

.cv-section {
  margin-top: 12px;
}
.cv-section h4 {
  font-size: 0.96rem;
  margin: 0 0 6px 0;
  color: #374151;
}
.cv-section ul {
  padding-left: 18px;
  margin: 0;
}
.cv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.cv-actions a,
.cv-actions button {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fafafa;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.cv-actions a:hover,
.cv-actions button:hover {
  background: #f5f5f5;
}

/* --- Ajustes de tamaño más conservadores (Noticias) --- */
.modal__content {
  width: min(820px, 92vw);
  max-height: 85dvh;
}
.news-hero img {
  height: clamp(220px, 42vh, 380px) !important;
}
.news-body {
  font-size: 1rem;
}

/* --- Z‑index y clics sobre contenido del modal --- */
.modal__overlay {
  z-index: 1;
}
.modal__content {
  z-index: 2;
}
.modal__close {
  z-index: 3;
  pointer-events: auto;
}

/* --- Fallback de visibilidad: si reduce-motion está activo o la animación no corre --- */
.modal.is-open .modal__content,
.modal.show .modal__content {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  animation: none !important;
      overflow: auto;
}

/* Asegurar clics */
.modal__content {
  pointer-events: auto;
}
.modal__overlay {
  pointer-events: auto;
}

.cv-frame {
  width: 100%;
  height: 70vh;
  border: 0;
  background: #fff;
}
.cv-text {
  white-space: pre-wrap;
}
.cv-head {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.cv-head .avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

/* --- CV Modal layout rules (auto-added v2) --- */
.cv-modal .modal__content {
  width: min(1200px, 96vw);
  max-height: 90dvh;
  overflow: auto;
  padding: 0;
}
.cv-modal .cv-body {
  padding: 0;
}
.cv-modal .cv-layout img {
  display: block;
  margin: 0 auto;
  width: 20vw;
  height: 50vh;
}
@media (max-width: 900px) {
  .cv-modal .cv-layout td[style*="52.4962%"],
  .cv-modal .cv-layout td[style*="47.3543%"] {
    display: block;
    width: 100% !important;
  }
}

/* --- Polished typography for CV modal (auto-added) --- */
.cv-modal .cv-left {
  color: #0f172a;
}
.cv-modal .cv-name {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 800;
  margin: 0 0 6px 0;
  letter-spacing: 0.2px;
}
.cv-modal .cv-spec {
  margin: 0 0 12px 0;
  font-size: 16px;
  opacity: 0.85;
}
.cv-modal .cv-contact {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 18px 0;
}
.cv-modal .cv-contact .sep {
  opacity: 0.5;
}
.cv-modal .cv-contact a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.cv-modal .cv-contact a:hover {
  border-bottom-color: currentColor;
}
.cv-modal .cv-summary {
  line-height: 1.65;
  font-size: 16px;
}
.cv-modal .cv-empty {
  color: #475569;
}

.cv-modal .modal__content {
  border-radius: 18px;
}

/* --- Responsive stack for CV modal (image first on mobile) --- */
@media (max-width: 768px) {
  .cv-modal .modal__content {
    width: 96vw;
    max-height: 100vh;
  }
  .cv-modal .cv-layout,
  .cv-modal .cv-layout tbody {
    display: block;
  }
  .cv-modal .cv-layout tr {
    display: flex;
    flex-direction: column-reverse; /* puts the image (2nd TD) first */
    gap: 16px;
  }
  .cv-modal .cv-layout td {
    display: block;
    width: 100% !important;
    padding: 18px !important;
  }
}

/* ============================
   OVERRIDES FINALES CV MODAL
   ============================ */

/* La tabla no se estira raro y respeta anchos fijos */
.cv-modal .cv-layout{
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}
.cv-modal .cv-layout td{
  padding: 24px 28px !important;
  vertical-align: top;
}

/* Anchos de columnas (desktop) */
.cv-modal .cv-layout td:first-child{  /* texto */
  width: 50%;
}
.cv-modal .cv-layout td:last-child{   /* imagen */
  text-align: center;
}

/* Anula cualquier tamaño forzado en <img> dentro del layout */
.cv-modal .cv-layout img{
  width: 20vw !important;
  height: 30vh !important;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
}

/* Estilo maestro de la foto */
.cv-modal .cv-photo{
  object-fit: fill;
}

/* Responsive: apilar, imagen primero, y un tamaño menor */
@media (max-width: 768px){
  .cv-modal .cv-layout,
  .cv-modal .cv-layout tbody { display: block; }

  .cv-modal .cv-layout tr{
    display: flex;
    flex-direction: column-reverse; /* imagen arriba, texto abajo */
    gap: 16px;
  }
  
  .cv-modal .cv-layout td:first-child{  /* texto */
  width: 100% !important;
}

  .cv-modal .cv-layout td{
    width: 100% !important;
    padding: 16px !important;
  }
  
  .cv-modal .cv-layout img{
  width: 50vw !important;
}

}

/* Harmonize noticias modal with CV modal */
.modal .news-header h2{margin:0 0 6px 0;font-size:clamp(1.25rem,1.6vw,1.75rem);}
.modal .news-meta{color:var(--muted,#667085);font-size:.9rem;margin-bottom:0px;}
.modal .news-body img{max-width:100%;height:auto;border-radius:10px;}
.modal .news-footer{margin-top:16px;}


/* ====== Igualar modal de Especialistas al de Noticias (overrides 2025-11-09) ====== */
.cv-modal .modal__content{
  max-width: 1120px;
  width: min(92vw, 1120px);
  border-radius: 20px;
  overflow: hidden;
}
.cv-modal .cv-grid{
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(380px, 520px);
  gap: clamp(16px, 3vw, 28px);
  align-items: start;
}
.cv-modal .cv-col{ align-self: start; }
.cv-modal .cv-body{ padding: clamp(20px, 3vw, 32px); }
.cv-modal .cv-col--text{ padding-right: clamp(8px, 2.2vw, 24px); }
.cv-modal .cv-name{
  margin: 0 0 10px;
  font-weight: 800;
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  line-height: 1.15;
}

.cv-modal .cv-meta{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 14px;
  justify-content: center;
  align-items: center;
}

.cv-modal .cv-col--photo{
  padding: clamp(8px, 2vw, 24px);
  background: rgba(143,177,128,.25);
}
.cv-modal .cv-photo{
  display:flex; justify-content:center; align-items:flex-start;
  padding: clamp(8px, 1.6vw, 18px);
  background:#fff; border-radius:14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.12);
}
.cv-modal .cv-photo img{
  width: 100%;
  height: -webkit-fill-available;
  display:block; 
  margin:0 auto;
  object-fit: fill;
  border-radius: 12px;
}

@media (max-width: 768px){

  .cv-modal .cv-photo img{
    height: 100%;
  }
}


/* ==== FIX fuerte para que el modal no se corte en móviles ==== */
@media (max-width: 600px) {
  /* El overlay sin padding lateral extra */
  .cv-modal {
    padding: 0px !important;
  }
  
  .cv-modal .cv-body {
    padding: 0 !important;
    margin-top: 50px !important;
    margin-bottom: 50px !important;
  }
  
  .cv-modal .modal__close {
    top: 40px !important;
    right: 10px !important;
  }

  /* El contenedor del modal ocupa todo el ancho de la pantalla */
  .cv-modal .modal__content {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
    box-sizing: border-box;
  }

  /* La grilla interna pasa a una sola columna flexible */
  .cv-modal .cv-grid {
    display: block !important;
    grid-template-columns: 1fr !important;
  }

  /* Cada columna y panel usa el 100% del ancho disponible */
  .cv-modal .cv-col,
  .cv-modal .cv-col--text,
  .cv-modal .cv-col--photo {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* La foto también se adapta al ancho */
  .cv-modal .cv-photo {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
  }

  .cv-modal .cv-photo img {
    width: 100% !important;
    height: 100% !important;
  }
}

@media (max-width: 920px){
  .cv-modal .cv-grid{ grid-template-columns: 1fr; }
  .cv-modal .cv-col--photo{ order: 2; }
}


/* ====== Two-panel style to match provided reference (2025-11-09) ====== */
.cv-modal .modal__content{
  background: transparent;   /* panels control the background */
  border-radius: var(--cv-radius1);
  box-shadow: 0 25px 80px rgba(0,0,0,.25);
}
.cv-modal .cv-body{ padding: 0; } /* padding handled inside panels */

.cv-modal .cv-grid{
  display: grid;
  grid-template-columns: minmax(520px, 1.35fr) minmax(380px, 1fr);
  gap: 0;                  /* no gap between panels */
  align-items: start;
  border-radius: var(--cv-radius1);
  overflow: hidden;
}

/* LEFT panel (text) */
.cv-modal .cv-col--text{
  background: #ffffff;
  padding: clamp(24px, 3.6vw, 48px);
  border-top-left-radius: var(--cv-radius1);
  border-bottom-left-radius: var(--cv-radius1);
}

/* RIGHT panel (media) */
.cv-modal .cv-col--photo{
  background: color-mix(in srgb, var(--color-principal) 85%, transparent);
  tra
  padding: clamp(24px, 3.6vw, 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-top-right-radius: var(--cv-radius1);
  border-bottom-right-radius: var(--cv-radius1);
}

/* Inner media card */
.cv-modal .cv-photo{
  background: #fff;
  border-radius: 16px;
  padding: clamp(8px, 1.2vw, 14px);
  box-shadow: 0 30px 80px rgba(0,0,0,.18);
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
}


/* Titles & text to match proportions from reference */
.cv-modal .cv-name{
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.05;
  margin: 0 0 12px;
}

/* Responsive stack */
@media (max-width: 980px){
  .cv-modal .cv-grid{ grid-template-columns: 1fr; }
  .cv-modal .cv-col--text{
    border-radius: var(--cv-radius1) var(--cv-radius1) 0 0;
  }
  .cv-modal .cv-col--photo{
    border-radius: 0 0 var(--cv-radius1) var(--cv-radius1);
  }
  .cv-modal .cv-photo{ width: min(92%, 520px); }
}



/* === Hotfix: botón cerrar y alturas iguales (2025-11-09) === */
.cv-modal{ z-index: 9999; } /* sobre cualquier capa */
.cv-modal .modal__overlay{ z-index: 1; }
.cv-modal .modal__content{ position: relative; z-index: 2; }
.cv-modal .modal__close{ position: absolute; top: 14px; right: 14px; z-index: 3; pointer-events: auto; }

/* Igualar alturas entre columnas */
.cv-modal .cv-grid{ align-items: stretch; }
.cv-modal .cv-col{ align-self: stretch; display: flex; flex-direction: column; border-bottom-right-radius: 0px;
    border-bottom-left-radius: 0px;}
.cv-modal .cv-col--photo{ justify-content: center; }
.cv-modal .cv-photo{ margin: 0 auto; } /* mantiene centrado */

/* Altura mínima para que no quede "cortado" el panel izquierdo */
.cv-modal .cv-col--text,
.cv-modal .cv-col--photo{ min-height: clamp(360px, 52vh, 640px); box-shadow: inset 0 0 5px 1px rgba(0, 0, 0, 0.5);}



/* === Close + responsive stacking (image first on small screens) === */
.cv-modal .modal__overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
}
@media (max-width: 980px){
  .cv-modal .cv-grid{ grid-template-columns: 1fr; }
  .cv-modal .cv-col--photo{ order: -1; margin-bottom: 0; }
  .cv-modal .cv-col--text{ order: 0; }
}

/* === Unificación final: Noticias = Especialistas (2025-11-09) === */
.cv-modal .modal__content{
  max-width: 1120px;
  width: min(92vw, 1120px);
  border-radius: 22px;
  overflow: hidden;
  background: transparent !important;
}
.cv-modal .cv-grid{
  display: flex;
    grid-template-columns: minmax(520px, 1.35fr) minmax(380px, 1fr);
    align-items: center;
    flex-direction: column;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: center;
}
@media (max-width: 920px){
  .cv-modal .cv-grid{ grid-template-columns: 1fr; }
  .cv-modal .cv-col--photo{ order: 2; }
}

/* Panel izquierdo (texto): blanco plano */
.cv-modal .cv-col--text{
  background: #fff !important;
  padding: clamp(24px, 3.6vw, 48px);
      padding-bottom: 0px;
}

/* Panel derecho (media): morado de marca */
.cv-modal .cv-col--photo{
  background: color-mix(in srgb, var(--color-principal) 85%, transparent) !important;
  padding: clamp(24px, 3.6vw, 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
  min-height: clamp(360px, 52vh, 640px);
      border-top-right-radius: 0px;
    border-top-left-radius: 0px;
}

/* Título y meta */
.cv-modal .cv-name{
  margin: 0px;
  font-weight: 800;
  font-size: clamp(2rem, 3.6vw, 3.6rem);
  line-height: 1.1;
}

/* Overlay y botón cierre como CV */
.modal__overlay{ background: rgba(0,0,0,.45); backdrop-filter: blur(2px); }
.cv-modal .close{
  position: absolute;
  top: 12px; right: 12px;
  background: var(--color-principal);
  color: #fff;
  border: none; border-radius: 999px;
  width: 36px; height: 36px; line-height: 36px;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--color-principal) 30%, transparent);
}

/* ===== Carrusel de fotos SOLO para el modal de noticias ===== */

.cv-modal--noticia .cv-col.cv-col--photo {
  display: flex;
  align-items: stretch;
}

.cv-modal--noticia .cv-photo {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Contenedor del carrusel */
.cv-modal--noticia .news-carousel {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Imagen adaptada tipo portada */
.cv-modal--noticia .news-carousel img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
}

/* Botones de navegación de fotos */
.cv-modal--noticia .news-carousel__btn {
position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: #ffffff;
    color: var(--text);
    width: 44px;
    height: 44px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: var(--shadow);
    border: 1px var(--color-principal) solid;
}

.cv-modal--noticia .news-carousel__btn--prev {
  left: 10px;
}

.cv-modal--noticia .news-carousel__btn--next {
  right: 10px;
}

/* Dots indicadores */
.cv-modal--noticia .news-carousel__dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.cv-modal--noticia .news-carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  border: 2px var(--color-principal) solid;
}

.cv-modal--noticia .news-carousel__dot.is-active {
  background: rgba(255, 255, 255, 0.95);
}

/* Pequeñas mejoras para la fila de compartir */
.share-row .share-label {
  font-size: 0.85rem;
  color: #6b7280;
}

.share-row button {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 6px 10px;
  background: #fff;
  cursor: pointer;
}

.share-row button:hover {
  background: #f5f5f5;
}



/* =========================================================
   Ajustes específicos para el modal de noticias
   - La imagen ocupa más espacio que el texto
   - El contenido de texto hace scroll si se pasa de alto
   ========================================================= */
.cv-modal--noticia .modal__content {
  /* El alto máximo lo controla el contenedor pero
     evitamos que todo el modal tenga scroll doble */
  max-height: 90dvh;
  overflow: hidden;
}

/* Layout de columnas: foto más ancha que el texto */
.cv-modal--noticia .cv-grid {
 display: flex;
    grid-template-columns: minmax(260px, 0.85fr) minmax(360px, 1.25fr);
    align-items: center;
    flex-direction: column;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: center;
}

/* Forzamos a que ambas columnas ocupen todo el alto disponible */
.cv-modal--noticia .cv-col--text,
.cv-modal--noticia .cv-col--photo {
  min-height: clamp(360px, 60vh, 720px);
}

/* Columna de texto: distribuida en vertical +
   el cuerpo (cv-summary) es el que scrollea */
.cv-modal--noticia .cv-col--text {
  display: flex;
  flex-direction: column;
}

/* Espacio para título + meta + footer, el texto se adapta */
.cv-modal--noticia .cv-summary {
  margin-top: 10px;
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 4px; /* deja lugar al scroll */
  text-align: justify !important;
}

/* Footer siempre visible abajo de la columna de texto */
.cv-modal--noticia .news-footer {
  margin-top: 12px;
}

/* Columna de foto: que rellene todo y la imagen cubra */
.cv-modal--noticia .cv-col--photo {
  display: flex;
  align-items: stretch;
}

.cv-modal--noticia .cv-photo {
  width: 100%;
  height: 100%;
}

.cv-modal--noticia .news-carousel {
  width: 100%;
  height: 100%;
}

.cv-modal--noticia .news-carousel img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

/* Responsive: en móviles apilamos y quitamos scroll interno
   para que sea más cómodo de leer */
@media (max-width: 768px) {
  .cv-modal--noticia .modal__content {
    max-height: 100vh;
    overflow: auto;
  }

  .cv-modal--noticia .cv-grid {
    grid-template-columns: 1fr;
  }

  .cv-modal--noticia .cv-col--text,
  .cv-modal--noticia .cv-col--photo {
    min-height: auto;
  }

  .cv-modal--noticia .cv-summary {
    max-height: none;
    overflow-y: visible;
  }
}

div.modal__content h2 {
    display: block;
    font-size: 1.5em !important;
    margin-block-start: 0.83em;
    margin-block-end: 0.83em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
    font-weight: bold;
    unicode-bidi: isolate;
}

div.modal__content p {
    display: block;
    margin: 0px;
    unicode-bidi: isolate;
}

.cv-photo370
{
  max-width: 370px;
}