/******************
    User custom CSS
    ---------------

    In this file you can add your own custom CSS
    It will be loaded last, so you can override any other property.
    Also, it will never be updated. So if you inheritate a core template and just add here some CSS, you'll still benefit of all the updates
*/
/* === Forzar título de GRUPO pequeño en LS6 (cubre .h2 / display-* / fs-*) === */

/* Tamaño base del contenedor del título */
.ls-group-heading,
.group-title { font-size: 1.05rem !important; line-height: 1.25 !important; }

/* Cualquier heading o utilidad de Bootstrap dentro del contenedor */
.ls-group-heading h1,
.ls-group-heading h2,
.ls-group-heading h3,
.ls-group-heading .h1,
.ls-group-heading .h2,
.ls-group-heading .h3,
.ls-group-heading [class*="display-"],
.ls-group-heading .fs-1, .ls-group-heading .fs-2, .ls-group-heading .fs-3,
.group-title h1,
.group-title h2,
.group-title h3,
.group-title .h1,
.group-title .h2,
.group-title .h3,
.group-title [class*="display-"],
.group-title .fs-1, .group-title .fs-2, .group-title .fs-3 {
  font-size: 1em !important;          /* hereda 1.05rem del contenedor */
  line-height: 1.25 !important;
  font-weight: 600 !important;
  color: #004884 !important;
  text-transform: none !important;
  letter-spacing: .2px !important;
  border-bottom: 1px solid rgba(0,72,132,.18);
  display: inline-block;
  padding-bottom: 2px;
  margin: .25rem 0 .5rem !important;
}

/* Descripción del grupo y espaciados */
.group-desc, .group-description {
  font-size: .95rem; color: #4b5563; margin: .3rem 0 1rem; line-height: 1.5;
}
.group-container, #group-container { padding-top: .5rem !important; }
.ls-question { margin-top: .25rem !important; }

/***** Tipografía compacta global para preguntas (tema UNIMAYOR) *****/
.unm-theme{
  /* Escala centralizada: ajusta aquí si quieres más/menos compacto */
  --q-title: clamp(1.00rem, 0.9rem + 0.6vw, 1.20rem); /* título h3 de pregunta */
  --q-head:  clamp(.90rem,  .85rem + 0.4vw, 1.05rem); /* encabezados SIEMPRE…NUNCA en matrices */
  --q-row:   clamp(.95rem,  .90rem + 0.35vw, 1.05rem); /* etiquetas de filas y labels */
  --q-help:  .95rem;                                   /* ayudas/descripciones */
}

/* ===== Título y descripción de la pregunta ===== */
.unm-theme .question-title-container h3{
  font-size: var(--q-title) !important;
  line-height: 1.30;
  margin-bottom: .45rem;
  letter-spacing: .2px;
}
.unm-theme .ls-question-help,
.unm-theme .question-help,
.unm-theme .question-title-container .question-number,
.unm-theme .question-title-container .mandatory{
  font-size: var(--q-help);
}

/* ===== List (radio/checkbox), short/long text, numérico, etc. ===== */
.unm-theme .answers-list li label,
.unm-theme .answer-item label,
.unm-theme .checkbox-item label,
.unm-theme .radio-item label{
  font-size: var(--q-row) !important;
  line-height: 1.35;
  color: #0f172a;
}

/* Inputs de texto: tamaño legible pero compacto */
.unm-theme .form-control,
.unm-theme select,
.unm-theme textarea{
  font-size: 1rem;
  min-height: 42px;
  padding: .65rem .85rem;
}

/* ===== Array/Matriz (5 puntos, 10 puntos, etc.) ===== */
.unm-theme table.ls-answers,
.unm-theme table.answers-list{           /* asegurar control de anchos */
  table-layout: fixed;
  width: 100%;
}

/* Encabezados de columnas (SIEMPRE…NUNCA) más compactos y sin cortes raros */
.unm-theme table.ls-answers thead th{
  font-size: var(--q-head) !important;
  line-height: 1.15;
  padding: .55rem .45rem;
  text-align: center;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: manual;
}

/* 1ª columna de filas un poco más ancha; celdas equilibradas */
.unm-theme table.ls-answers thead th:first-child,
.unm-theme table.ls-answers tbody th.answertext{
  width: 42%;
  text-align: left;
  font-size: var(--q-row) !important;
  line-height: 1.35;
  white-space: normal;            /* permite varias líneas */
  word-break: normal;
  overflow-wrap: normal;
  hyphens: manual;
}
.unm-theme table.ls-answers thead th:nth-child(n+2),
.unm-theme table.ls-answers tbody td{
  width: 11.6%;
  text-align: center;
  padding: .55rem .4rem;
}

/* Radios/checkbox: foco accesible, tamaño moderado */
.unm-theme input[type="radio"]:focus-visible,
.unm-theme input[type="checkbox"]:focus-visible{
  outline: 3px solid #ffbf47;
  outline-offset: 2px;
}
/* (Opcional) reducir sutilmente el tamaño visual de radios/checkboxes */
@media (min-width: 992px){
  .unm-theme input[type="radio"],
  .unm-theme input[type="checkbox"]{
    transform: scale(.95);
  }
}

/* ===== Badges/píldoras informativas que pones sobre cada pregunta ===== */
.unm-theme .qbadge .qbadge-text{
  font-size: var(--q-title);
  line-height: 1.25;
  text-wrap: balance;
}

/* ===== Responsivo ===== */
@media (max-width: 720px){
  .unm-theme table.ls-answers thead th:first-child,
  .unm-theme table.ls-answers tbody th.answertext{ width: 38%; }
  .unm-theme table.ls-answers thead th:nth-child(n+2),
  .unm-theme table.ls-answers tbody td{ width: 12.4%; }
  .unm-theme table.ls-answers thead th{ font-size: .92rem !important; }
  .unm-theme table.ls-answers tbody th.answertext{ font-size: .95rem !important; }
}

/* Evitar particiones feas de palabras en español en todo el cuerpo de la encuesta */
.unm-theme .question-container, 
.unm-theme .question-container *{
  word-break: normal;
  overflow-wrap: normal;
  hyphens: manual;
}

/* ====== FIX: Array (5 puntos) encabezados se pegan / se ven en una sola línea ====== */
/* Aplica SOLO a la pregunta con clase qs-participacion */
.unm-theme .qs-participacion table.ls-answers{
  table-layout: fixed;         /* control de anchos */
  width: 100%;
}

/* Asegura que el thead funciona como cabecera de tabla */
.unm-theme .qs-participacion table.ls-answers thead{
  display: table-header-group;
}

/* Encabezados SIEMPRE…NUNCA: permitir salto ENTRE palabras, no dentro */
.unm-theme .qs-participacion table.ls-answers thead th{
  font-size: clamp(.90rem, .85rem + .35vw, 1.02rem);
  line-height: 1.15;
  padding: .55rem .45rem;
  text-align: center;

  white-space: normal !important;   /* 💡 permitir varias líneas */
  word-break: keep-all !important;  /* 💡 no cortar palabras */
  overflow-wrap: normal !important; /* 💡 saltos solo en espacios */
  hyphens: manual !important;       /* 💡 sin guionado auto */
  text-wrap: balance;               /* mejor distribución de líneas */
}

/* 1ª columna (texto de la fila) más ancha; 5 opciones equilibradas */
.unm-theme .qs-participacion table.ls-answers thead th:first-child,
.unm-theme .qs-participacion table.ls-answers tbody th.answertext{
  width: 44%;
  text-align: left;
  font-size: clamp(.95rem, .9rem + .35vw, 1.05rem);
  line-height: 1.35;
  white-space: normal; word-break: normal; overflow-wrap: normal; hyphens: manual;
}
.unm-theme .qs-participacion table.ls-answers thead th:nth-child(n+2),
.unm-theme .qs-participacion table.ls-answers tbody td{
  width: 11.2%;
  text-align: center;
}

/* Foco accesible en radios */
.unm-theme .qs-participacion input[type="radio"]:focus-visible,
.unm-theme .qs-participacion input[type="radio"]:focus-visible + label{
  outline: 3px solid #ffbf47; outline-offset: 2px;
}

/* Responsive: en móviles da un poco más a la 1ª columna */
@media (max-width: 720px){
  .unm-theme .qs-participacion table.ls-answers thead th:first-child,
  .unm-theme .qs-participacion table.ls-answers tbody th.answertext{ width: 38%; }
  .unm-theme .qs-participacion table.ls-answers thead th:nth-child(n+2),
  .unm-theme .qs-participacion table.ls-answers tbody td{ width: 12.4%; }
  .unm-theme .qs-participacion table.ls-answers thead th{ font-size: .92rem; }
  .unm-theme .qs-participacion table.ls-answers tbody th.answertext{ font-size: .95rem; }
  
  /* ==================== FIX móvil para matrices/arrays ==================== */
/* Mantener semántica de tabla + scroll horizontal en pantallas pequeñas   */
/* Aplica a todas las matrices del tema UNIMAYOR                           */

@media (max-width: 760px){

  /* 1) El contenedor de la tabla hace el scroll horizontal */
  .unm-theme table.ls-answers,
  .unm-theme table.answers-list{
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    /* ancho mínimo para que no se colapse en columna */
    min-width: 720px; /* ajusta a 680–820px según lo largo de tus textos */
    mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  }

  /* 2) Forzar que la tabla SIGA siendo tabla (evita apilamiento vertical) */
  .unm-theme table.ls-answers thead{ display: table-header-group !important; }
  .unm-theme table.ls-answers tbody{ display: table-row-group !important; }
  .unm-theme table.ls-answers thead tr,
  .unm-theme table.ls-answers tbody tr{ display: table-row !important; }
  .unm-theme table.ls-answers th,
  .unm-theme table.ls-answers td{ display: table-cell !important; float: none !important; position: static !important; }

  /* 3) Sin sticky en móvil (evita solapado raro) */
  .unm-theme table.ls-answers thead th{ position: static !important; }

  /* 4) Tipografía y cortes limpios */
  .unm-theme table.ls-answers thead th{
    white-space: normal !important;      /* permite 1–2 líneas */
    word-break: keep-all !important;      /* no cortes dentro de palabras */
    overflow-wrap: normal !important;     /* saltos solo en espacios */
    hyphens: manual !important;
    font-size: .92rem; line-height: 1.15;
  }

  /* 5) Anchos mínimos para que cada columna mantenga su espacio */
  .unm-theme table.ls-answers thead th:first-child,
  .unm-theme table.ls-answers tbody th.answertext{
    min-width: 260px !important;          /* etiqueta de la fila */
    white-space: normal !important;
  }
  .unm-theme table.ls-answers thead th:nth-child(n+2),
  .unm-theme table.ls-answers tbody td{
    min-width: 92px !important;           /* cada opción (SIEMPRE…NUNCA) */
    text-align: center;
  }

  /* 6) Mejora tap-target de radios/checkbox en móvil */
  .unm-theme input[type="radio"],
  .unm-theme input[type="checkbox"]{ transform: scale(1.15); }
}

}
