body {
  overflow-x: hidden;
}

.barra-preguntas-ciudadanas {
	margin-top: 10px;
	width: 90%;
	margin-left: auto;
	margin-right: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 24px 12px 24px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 2px 8px #eee;
  box-sizing: border-box;
}
.btn-volver-pregunta {
	display: flex;
	align-items: center;
	gap: 8px;
  border: 1px solid transparent;
	background: transparent;
	cursor: pointer;
	font-size: 1.1em;
	padding: 8px 18px;
  transition: box-shadow 0.2s, background 0.2s, border-color 0.2s;
	outline: none;  
	color: #222;
	position: relative;
	z-index: 1;
  box-sizing: border-box;
}
.btn-volver-pregunta:hover, .btn-volver-pregunta:focus {
	background: #f0a4a4;
  border-color: #a19e9e;
	box-shadow: 0 2px 8px #c5c5c5;
}

body.modal-aviso-activo {
  overflow: hidden;
}

.modal-aviso-pregunta {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.68);
}

.modal-aviso-pregunta.oculto {
  display: none;
}

.modal-aviso-pregunta-contenido {
  width: min(760px, 100%);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  padding: 28px;
  border-top: 6px solid #dd1515;
}

.modal-aviso-pregunta-contenido h3 {
  margin: 0 0 16px 0;
  font-size: 1.5rem;
  color: #111827;
}

.modal-aviso-pregunta-texto p {
  margin: 0 0 14px 0;
  line-height: 1.65;
  color: #374151;
}

.modal-aviso-pregunta-acciones {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.aviso-pregunta-banner {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #111827;
}

.aviso-pregunta-banner strong {
  display: block;
  margin-bottom: 6px;
}

.aviso-pregunta-banner p {
  margin: 0;
  line-height: 1.55;
}
/* Eliminar borde negro de botones de votación y respuesta */
.voto-favor, .voto-contra, .pregunta-responder-btn {
	border: none !important;
    background: none !important;
	outline: none;
}
/* preguntas.css - estilos para preguntas y modales */
.preguntas-main { padding: 24px; }
.preguntas-grid { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; align-items: stretch; width: 100%; }
.pregunta-card { background: #fff; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 2px 8px #eee; padding: 16px; width: 340px; cursor:pointer; transition: box-shadow .2s; }
.pregunta-card:hover { box-shadow: 0 4px 16px #ccc; }
.pregunta-fotos { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; }
.modulo-fotos-bloque { min-height: var(--modulo-fotos-bloque-height, 0px); }
.modulo-fotos-respuesta strong { display: block; width: 100%; margin-bottom: 5px; }
.pregunta-fotos img { max-width: 120px; max-height: 120px; margin: 0; border-radius: 4px; }
.pregunta-contenido { margin-top: 8px; display: flex; flex-direction: column; min-height: 0; }
.pregunta-usuario, .pregunta-fecha { display: block; color: #888; font-size: 0.95em; margin-bottom: 4px; }
.pregunta-respuesta-preferencia {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 2px 0 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82em;
  font-weight: 700;
  line-height: 1.2;
}
.pregunta-respuesta-preferencia.respuesta-si {
  background: #e7f7ec;
  color: #1f6b39;
}
.pregunta-respuesta-preferencia.respuesta-no {
  background: #f3f4f6;
  color: #4b5563;
}
.modulo-meta-etiqueta {
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}
.modulo-meta-bloque {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.modulo-meta-bloque .modulo-meta-etiqueta {
  margin-bottom: 0;
}
.modulo-respuesta-bloque {
  margin-top: 8px;
  flex-shrink: 0;
}
.pregunta-texto { font-size: 1.1em; margin-bottom: 8px; }
.pregunta-respuesta { background: #e6ffe6; border-left: 4px solid #f73a18; padding: 8px; margin-top: 8px; border-radius: 4px; }
.pregunta-respuesta-admin {
  margin-top: 10px;
  padding: 8px 10px;
  border-left: 4px solid #2f7d32;
  background: #eef8ee;
  border-radius: 4px;
  color: #244b26;
  font-size: 0.96em;
}
.pregunta-fecha-respuesta {
  margin-top: 6px;
}
.pregunta-votos { margin-top: auto; margin-bottom: 10px; display: flex; gap: 16px; align-items: center; justify-content: flex-start; }
.pregunta-responder-btn { margin-left: 16px; color: #555; cursor:pointer; font-size:1em; }
.pregunta-estado-indicador {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.pregunta-estado-indicador.estado-pendiente { background: #7b4a12; }
.pregunta-estado-indicador.estado-respondido { background: #1f8f3a; }
.pregunta-estado-indicador.estado-rechazado { background: #c62828; }
.modal-foto, .modal-comentario { position: fixed; top:0; left:0; width:100vw; height:100vh; z-index:99999; background:rgba(0,0,0,0.7); display:none; }
.modal-foto { overflow-y:auto; }
.modal-comentario { overflow-y:auto; padding:24px 16px; }
.modal-foto-contenido, .modal-comentario-contenido { background:#fff; margin:60px auto; padding:24px; border-radius:8px; max-width:600px; box-shadow:0 0 24px #0003; position:relative; }
.modal-foto-contenido { width:min(600px, calc(100vw - 32px)); max-height:calc(100vh - 48px); overflow-y:auto; }
.modal-comentario-contenido { width:min(600px, 100%); max-height:calc(100vh - 48px); overflow-y:auto; }
.cerrar-modal-foto, .cerrar-modal-comentario { position:absolute; top:16px; right:24px; font-size:2em; color:#888; cursor:pointer; }
.btn-guardar-respuesta { background:#dd1515; color:#fff; border:none; border-radius:4px; padding:8px 16px; margin-top:8px; cursor:pointer; font-size:1em; }
.btn-guardar-respuesta:hover { background:#a01111; }
.btn-guardar-respuesta.is-disabled-soft,
.btn-guardar-respuesta[aria-disabled="true"] {
  background: #f0c7c7;
  color: #7a2727;
  cursor: not-allowed;
  box-shadow: inset 0 0 0 1px rgba(122, 39, 39, 0.18);
}
.btn-guardar-respuesta.is-disabled-soft:hover,
.btn-guardar-respuesta[aria-disabled="true"]:hover {
  background: #f0c7c7;
  color: #7a2727;
}

.textarea-resaltada-wrap {
  position: relative;
  width: 100%;
}

.textarea-resaltada-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  padding: 12px 14px;
  background: #fff;
  color: #111;
  white-space: pre-wrap;
  overflow: hidden;
  word-break: break-word;
  pointer-events: none;
  line-height: 1.5;
  font-size: 1em;
  font-family: inherit;
}

.textarea-resaltada-backdrop mark {
  background: #fde68a;
  color: #111;
  border-radius: 4px;
  padding: 0 2px;
}

.campo-pregunta-resaltada textarea {
  position: relative;
  z-index: 2;
  background: transparent;
  color: transparent;
  caret-color: #111;
  text-shadow: 0 0 0 #111;
}

.campo-formulario textarea.campo-bloqueado-amarillo,
.campo-formulario .campo-bloqueado-amarillo {
  border-color: #eab308;
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.22);
}

.palabras-prohibidas-detectadas {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
  color: #92400e;
}

.palabras-prohibidas-detectadas.visible {
  display: flex;
}

.palabra-prohibida-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fde68a;
  color: #78350f;
  font-weight: 700;
  font-size: 0.9rem;
}
.campo-texto-moderado-modal .textarea-resaltada-backdrop {
  color: transparent;
  border-color: transparent;
}

.campo-texto-moderado-modal .textarea-resaltada-backdrop mark {
  color: transparent;
  background: #fde68a;
}

.campo-texto-moderado-modal textarea.textarea-moderada-modal {
  color: #111;
  caret-color: #111;
  text-shadow: none;
  background: transparent;
}
.btn-ver-respuestas-comentario-pregunta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  color: #666;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
}
.btn-ver-respuestas-comentario-pregunta:hover,
.btn-ver-respuestas-comentario-pregunta:focus {
  color: #dd1515;
  outline: none;
}

/* Solución robusta: asegurar que .pregunta-card ocupa toda la altura disponible y los botones siempre quedan a 10px del fondo */
.pregunta-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 340px;
    box-sizing: border-box;
}
.pregunta-contenido {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.pregunta-votos {
    margin-top: auto;
    margin-bottom: 10px;
    display: flex;
    gap: 16px;
  row-gap: 10px;
  flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
  flex-shrink: 0;
}

.noticias-pagination {
  margin-top: 24px;
  padding: 16px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px #eee;
}

.noticias-pagination .noticias-page-btn,
.noticias-pagination .noticias-page-btn:hover,
.noticias-pagination .noticias-page-btn:focus,
.noticias-pagination .noticias-page-btn:focus-visible,
.noticias-pagination .noticias-page-btn:active,
.noticias-pagination .noticias-page-btn.is-active,
.noticias-pagination .noticias-page-btn[disabled] {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 3px !important;
  border-radius: 0 !important;
  color: inherit !important;
  min-width: auto !important;
  height: auto !important;
  font-weight: 700;
  -webkit-appearance: none;
  appearance: none;
}

.noticias-pagination .noticias-page-btn[disabled] {
  opacity: 0.55;
}

@media (min-width: 1200px) {
  .preguntas-grid {
    width: 92vw;
    max-width: 1680px;
    margin-left: auto;
    margin-right: auto;
    justify-content: space-between;
  }

  .pregunta-card {
    width: calc((100% - 48px) / 3);
    max-width: calc((100% - 48px) / 3);
  }
}

@media (min-width: 1501px) {
  .preguntas-grid {
    max-width: 1880px;
  }

  .pregunta-card {
    width: calc((100% - 72px) / 4);
    max-width: calc((100% - 72px) / 4);
  }
}

@media (max-width: 670px) {
  .modal-aviso-pregunta-contenido {
    padding: 20px;
  }

  .modal-aviso-pregunta-acciones {
    justify-content: stretch;
  }

  .modal-aviso-pregunta-acciones .btn-guardar-respuesta {
    width: 100%;
  }

  .barra-preguntas-ciudadanas {
    flex-direction: column;
    align-items: center;
    padding: 12px 8px 12px 8px;
    gap: 10px;
    text-align: center;
  }
  .barra-preguntas-ciudadanas h2 {
    margin: 0 0 0 0;
    text-align: center;
    font-size: 1.2em;
    order: 2;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .btn-volver-pregunta {
    justify-content: center;
    width: 100%;
    order: 1;
    margin-bottom: 8px;
  }
  .barra-preguntas-ciudadanas .espaciador-barra {
    display: none;
  }

  .noticias-pagination {
    padding-left: 14px;
    padding-right: 14px;
  }
}
