/*
Biblioteca Jurídica — Frontend público (shortcode)
Prefijo: bj-, aislado bajo .bj-frontend
*/

.bj-frontend {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    sans-serif;
  color: #1a1a1a;
  line-height: 1.5;
  width: 90rem;
  margin: 0 auto;
  padding: 24px 16px;
  box-sizing: border-box;
}

.bj-frontend *,
.bj-frontend *::before,
.bj-frontend *::after {
  box-sizing: border-box;
}

/* ---------- Layout: sidebar + contenido ---------- */
.bj-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.bj-sidebar {
  flex: 0 0 260px;
  min-width: 400px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  position: sticky;
  top: 24px;
}

.bj-contenido {
  flex: 1;
  min-width: 0;
}

/* ---------- Sidebar ---------- */
.bj-sidebar-titulo {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 20px;
  color: #111827;
}

.bj-filtro-grupo {
  margin-bottom: 20px;
}

.bj-filtro-etiqueta {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bj-select {
  width: 100%;
  padding: 8px 12px !important;
  font-size: 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 6px !important;
  background: #fff;
  color: #1f2937;
  cursor: pointer;
  appearance: auto;
}

.bj-select:focus {
  outline: none;
  border-color: #b8ff65;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15);
}

.bj-radios {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}

.bj-radio-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.9rem;
}

.bj-radio-item:hover {
  background: #e5e7eb;
}

.bj-radio-item.bj-radio-activo {
  font-weight: 500;
}

.bj-radio-item input[type="radio"] {
  margin: 0;
  flex-shrink: 0;
  accent-color: #059669;
}

.bj-radio-label {
  color: #374151;
}

.bj-btn-limpiar {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 8px;
}

.bj-btn-limpiar:hover {
  background: #1f2937;
}

/* ---------- Encabezado ---------- */
.bj-encabezado {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 16px;
  flex-wrap: wrap;
}

.bj-encabezado-izq {
  flex: 1;
  min-width: 0;
}

.bj-titulo-busqueda {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: #111827;
}

.bj-subtitulo {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
}

.bj-encabezado-der {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.bj-ordenar-etiqueta {
  font-size: 0.85rem;
  color: #374151;
  font-weight: 500;
  white-space: nowrap;
}

.bj-select-orden {
  width: auto;
  min-width: 150px;
}

/* ---------- Chip de filtro activo ---------- */
.bj-chip-container {
  margin-bottom: 12px;
  display: flex;
  justify-content: start;
}

.bj-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #000;
  color: #fff;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.bj-chip-cerrar {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #fff;
  padding: 0 2px;
  margin-bottom: 0px !important;
}

.bj-chip-cerrar:hover {
  color: #dc2626;
}

/* ---------- Buscador de texto ---------- */
.bj-buscador {
  position: relative;
  margin-bottom: 16px;
}

.bj-input-buscar {
  width: 100% !important;
  max-width: 100% !important;
  padding: 10px 36px 10px 14px;
  font-size: 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #1f2937;
}

.bj-input-buscar:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15);
}

.bj-btn-limpiar-busqueda {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: #9ca3af;
  padding: 4px;
  line-height: 1;
}

.bj-btn-limpiar-busqueda:hover {
  color: #374151;
}

/* ---------- Lista de tarjetas ---------- */
.bj-lista-tarjetas {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bj-tarjeta {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}

.bj-tarjeta:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.bj-tarjeta-acento {
  position: absolute;
  inset: 0 auto 0 0;
  width: 60px;
  background: #b8ff65;
  display: flex;
  justify-content: center;
  align-items: center;
}

.bj-tarjeta-icono {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.bj-tarjeta-cuerpo {
  flex: 1;
  min-width: 0;
  margin-left: 70px;
}

.bj-tarjeta-titulo {
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0 0 8px;
  color: #262626;
  line-height: 1.4;
}

.bj-tarjeta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bj-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
}

.bj-badge-categoria,
.bj-badge-fecha {
  background: #f1f5f9;
  color: #565657;
}

.bj-tarjeta-accion {
  flex-shrink: 0;
}

.bj-btn-consultar {
  display: inline-block;
  padding: 8px 20px;
  background: #262626;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.bj-btn-consultar:hover {
  /*background: #047857;*/
  box-shadow: 0 2px 3px rgba(37, 46, 37, 0.4);
  color: #fff;
}

/* ---------- Sin resultados ---------- */
.bj-sin-resultados {
  text-align: center;
  padding: 48px 16px;
  color: #6b7280;
}

.bj-sin-resultados p {
  font-size: 1rem;
  margin: 0;
}

/* ---------- Paginación ---------- */
.bj-paginacion {
  margin-top: 24px;
  text-align: center;
}

.bj-paginacion ul {
  display: inline-flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}

.bj-paginacion li {
  margin: 0;
}

.bj-paginacion a,
.bj-paginacion span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  font-size: 0.9rem;
  border-radius: 6px;
  text-decoration: none;
  color: #374151;
  background: #fff;
  border: 1px solid #d1d5db;
  transition: all 0.15s;
}

.bj-paginacion a:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #111827;
}

.bj-paginacion .bj-page-actual {
  background: #b8ff65;
  border-color: #059669;
  color: #262626;
  font-weight: 600;
}

.bj-paginacion .bj-page-disabled {
  color: #d1d5db;
  cursor: default;
  border-color: #e5e7eb;
  background: #f9fafb;
}

.bj-paginacion .bj-page-elipsis {
  border: none;
  background: none;
  color: #9ca3af;
  min-width: auto;
  width: auto;
  padding: 0 4px;
  cursor: default;
}

.bj-page-info {
  display: block;
  margin-top: 8px;
  font-size: 0.85rem;
  color: #6b7280;
}

/* ---------- Badge subcategoría ---------- */
.bj-badge-subcategoria {
  background: #dbeafe;
  color: #1e40af;
}

/* ---------- Contenedor de publicación padre-hijo ---------- */
.bj-tarjeta-publicacion {
  background: #f1f5f9;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .bj-layout {
    flex-direction: column;
    gap: 16px;
  }

  .bj-sidebar {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    position: static;
  }

  .bj-encabezado {
    flex-direction: column;
  }

  .bj-encabezado-der {
    width: 100%;
  }

  .bj-select-orden {
    width: 100%;
  }

  .bj-tarjeta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }

  .bj-tarjeta-accion {
    width: 100%;
  }

  .bj-btn-consultar {
    width: 100%;
    text-align: center;
  }

  .bj-radios {
    max-height: 200px;
  }

  .bj-paginacion a,
  .bj-paginacion span {
    min-width: 32px;
    height: 32px;
    font-size: 0.8rem;
    padding: 0 6px;
  }

  .bj-paginacion .bj-page-elipsis {
    min-width: auto;
    padding: 0 2px;
  }
}

@media (max-width: 480px) {
  .bj-frontend {
    padding: 16px 12px;
  }

  .bj-titulo-busqueda {
    font-size: 1.1rem;
  }

  .bj-tarjeta-titulo {
    font-size: 0.9rem;
  }
}
