#portal-breadcrumbs {
  display:none;
}

h1 {
  margin: 1.5rem 0 .25rem 0 !important;
}

.lead {
  margin-bottom: 0 !important;
}

article>header {
    margin-bottom: 1rem !important;
}

/* ================================
   Personas - Estilos principales
   ================================ */

/* Layout general */
#personas-layout {
  display: flex;
  gap: 2rem;
}

#personas-sidebar {
  flex: 0 0 30%;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: .25rem;
  background: #fafafa;
}

#personas-resultados {
  flex: 1;
}

/* ================================
   Formulario de búsqueda
   ================================ */
#busqueda-form-vertical {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#busqueda-form-vertical input[type="text"],
#personas-sidebar select,
#personas-sidebar input[type="text"] {
  width: 100%;
  padding: .4em;
  border: 1px solid #ccc;
  border-radius: .25rem;
  box-sizing: border-box;
  height: 2.5em;
  line-height: 2.5em;
}

/* Campo múltiple (select[multiple]) */
#personas-sidebar select[multiple] {
  min-height: 2.5em;
  background-color: #fff;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
  font-size: .9em;
  line-height: 1.4;
  overflow-y: auto;
}

#personas-sidebar select[multiple] option {
  padding: .3em .4em;
  margin: 1px 0;
  border-radius: .2rem;
  cursor: pointer;
}

#personas-sidebar select[multiple] option:hover {
  background-color: #f0f8ff;
}

#personas-sidebar select[multiple] option:checked {
  background-color: #007bff;
  color: #fff;
}

/* ================================
   Radios inline (modo, coincidencia)
   ================================ */
.modo-busqueda-inline,
.coincidencia-inline {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.modo-busqueda-inline label,
.coincidencia-inline label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: .3em;
}

/* ================================
   Territorio (País + CP)
   ================================ */
.territorio-fields {
  display: flex;
  justify-content: space-between;
  gap: 5%;
}

.territorio-fields .pais-field {
  flex: 0 0 60%;
}

.territorio-fields .cp-field {
  flex: 0 0 35%;
}

/* ================================
   Botones y acciones
   ================================ */
.btn {
  display: inline-block;
  padding: .4em .8em;
  font-size: .9em;
  border-radius: .25rem;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-sm {
  font-size: .8em;
  padding: .25em .6em;
}

.btn-primary {
  background-color: #007bff;
  border-color: #007bff;
  color: #fff;
}

.btn-primary:hover {
  background-color: #0069d9;
  border-color: #0062cc;
}

.limpiar {
  display: inline-block;
  margin-left: 0;
  font-size: 1.2em;
  font-weight: bold;
  line-height: 1;
  color: #c00;
  text-decoration: none;
  cursor: pointer;
}

.limpiar:hover {
  color: #900;
}

/* ================================
   Resumen y filtros aplicados
   ================================ */
#resumen {
  margin-bottom: 1rem;
}

#filtros-aplicados {
  margin-bottom: 1rem;
}

#filtros-label {
  margin-right: .25rem;
}

.filtros-inline {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.filtros-inline fieldset {
  margin: 0 1rem 0 0;
  padding: 0;
  border: none;
}

.remove-filter {
  color: #c00;
  text-decoration: none;
}

.remove-filter:hover {
  color: #900;
}

.pagesize-form {
  margin-bottom: 1rem;
}

#personas-resultados nav.d-flex.justify-content-center {
  justify-content: flex-start !important;
}

/* ================================
   Accesibilidad
   ================================ */
.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap;
}

/* ================================
   Temas (checkboxes como pills)
   ================================ */
#personas-sidebar .temas-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .6rem;
}

#personas-sidebar .temas-opt input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

#personas-sidebar .temas-opt span {
  display: inline-block;
  padding: .28rem .6rem;
  border: 1px solid #d0d7de;
  border-radius: 999px;
  background: #f8f9fa;
  cursor: pointer;
  line-height: 1.1;
}

#personas-sidebar .temas-opt input[type="checkbox"]:checked + span {
  background: #1155991a;
  border-color: #115599;
  color: #115599;
}

/* Foco accesible */
@supports selector(label:has(input:focus-visible)) {
  #personas-sidebar .temas-opt:has(input:focus-visible) span {
    outline: 2px solid #115599;
    outline-offset: 2px;
  }
}

#personas-sidebar .temas-opt input[type="checkbox"]:focus + span {
  box-shadow: 0 0 0 2px #115599;
}

/* ================================
   Política (select múltiple horizontal)
   ================================ */
select.politica-select {
  height: 2.5em;
  border: none;
  background: transparent;
  padding: 0;
}

select.politica-select option {
  display: inline-block;
  width: auto;
  padding: 0 .5em;
}

/* WebKit/Blink */
select.politica-select::-webkit-scrollbar {
  display: none;
}

/* Firefox */
@-moz-document url-prefix() {
  #personas-sidebar select[multiple] { 
    min-height: 3em; 
  }
  select.politica-select { 
    height: 3em; 
  }
}

/* ================================
   Responsive (móviles < 768px)
   ================================ */
@media (max-width: 768px) {
  #personas-layout {
    flex-direction: column; /* apilar */
  }

  #personas-sidebar,
  #personas-resultados {
    flex: 1 1 auto;
    max-width: 100%;
  }

  .territorio-fields .pais-field,
  .territorio-fields .cp-field {
    flex: 1 1 100%;
  }
}

/* ================================
   Responsive (móviles < 480px)
   ================================ */

@media (max-width: 480px) {
  #resumen {
    display: flex;
    flex-direction: column;
    gap: .4rem;
  }
  #resumen .resumen-total,
  #resumen .resumen-encontradas {
    display: block;
  }

  .pagination {
    display: flex;
    flex-wrap: wrap;   /* permite saltos de línea */
    gap: .4rem;
    padding-left: 0;
  }

  .pagination .page-item {
    display: inline-flex;
    width: auto;
  }

  .pagination .page-item.previous,
  .pagination .page-item.next,
  .pagination .page-item.first,
  .pagination .page-item.last {
    flex: 1 1 100%;   /* ancho completo -> nueva línea */
    justify-content: flex-start;
  }

  .pagination .page-item:not(.previous):not(.next):not(.first):not(.last) {
    flex: 0 0 auto;   /* solo el ancho necesario */
  }
}

